-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update lronacpho to use LROC's newer photometric model and parameters file #4519
Conversation
… get from calibration file but still backwards compatible if old parameters file exists will use old model
What do we need to do to get this moving forward? Can I work on the missing pieces, like gtest, or do I have to wait for the review to be made? |
1 similar comment
What do we need to do to get this moving forward? Can I work on the missing pieces, like gtest, or do I have to wait for the review to be made? |
isis/src/lro/apps/lronacpho/main.cpp
Outdated
if(algoFile.toLower() == "default" || algoFile.length() == 0){ | ||
GetCalibrationDirectory("", calDir); | ||
algoFile = calDir + "NAC_PHO_LROC_Empirical.????.pvl"; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can embed this logic in the app XML, see how hical specifies this:
https://github.com/USGS-Astrogeology/ISIS3/blob/dev/isis/src/mro/apps/hical/hical.xml#L1485
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Jesse. Updated with suggested changes.
@jessemapel I think I hit all items on your review. Let me know if you need anything else before proceeding. |
If there aren't any issues, is there a chance to get this into the next sprint? |
@jessemapel Just making sure this doesn't get lost. Please let me know if you still need anything from me. |
This looks good now. I'm not sure how to handle updating the tests on this. For the moment, can you e-mail me or attach a zip of a test image with the validated output? |
Jesse, I'll send that to you here shortly. Thanks. |
For testing on this, I'd like to see one test that uses the old parameter file, this likely already exists, and one test that uses the new parameter file. The tests should check that the proper parameters are actually being used and that the report is correct. |
This is the error I'm getting when changing the app to be callable. I'll take a closer look later tonight but if something jumps out, please let me know. It's probably an easy typo.
|
@victoronline I can look at the code if need be, the fact that there seems to be a merge issue here (look at files changed) makes it kinda hard. But basically that error is telling you that ISIS.h is not included where it needs to be. It should only be at the very top of the |
0a48527
to
961eca5
Compare
@victoronline: In the version I pulled down earlier, lronacpho.cpp was included, but I don't see it now. It had a semicolon at the end of the #include for Isis.h, but Isis.h only needs to be included in the main. Isis.h actually houses the C++ int main(argc, argv){} function and should not be include anywhere else. |
lronacpho.cpp has a { on line 6. Should be ; From what I'm seeing, the Isis.h error was masking compile/syntax errors like the one above |
I'm fixing the merge errors. I'll upload it again here shortly. |
2341902
to
961eca5
Compare
@Kelvinrr Are you able to take a look at this today and get a review back to @victoronline? @victoronline This has merge conflicts that are going to need to be fixed before it is mergeable. Let us know if you have questions about how to handle those. Thanks! |
17a4b3a
to
29781cc
Compare
@jlaura Merge conflicts resolved. |
Should I also check the test cub into the data directory? |
@victoronline how large is the test cub? We might want to crop not down first if possible. @Kelvinrr @jessemapel what is the best method to get test data from an external source? Email if small enough and we will check in to the test data on PR merge? |
|
||
ASSERT_TRUE(prefix.isValid()); | ||
|
||
QString inCubeFileName = "data/lronacpho/M143947267L.cal.echo.crop.cub"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming this image is small enough (like single digit MB), you can just check it in as part of this PR. It seems you already cropped it so I image its good as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not a single-digit MB. It is 8.4 MB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll crop down to 1 MB and add to PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added test cube
@jlaura I didn't see your comment before I added the test cube. I can still email if needed. |
@victoronline Nope, less than a MB and in the data area like @Kelvinrr said is great! @Kelvinrr is going to give the updated code a review so that we can get it merged since a number of commits have come in since the original review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few questions, overall looks fine to me. The only other change I would make before approving is adding a line to CHANGELOG.MD under "Unreleased", basically a short description of the change with a link to the relevant issue similar to the history logs. After that I'll approve assuming no other objections from anyone else and we can get this merged.
pars.aTerms.push_back(toDouble(ConfKey(profile, "A" + toString(i), toString(0.0)))); | ||
for (int i=0; i<7; i++) | ||
pars.bTerms.push_back(toDouble(ConfKey(profile, "B" + toString(i), toString(0.0)))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed Jesse suggested changing the toString
call with the string literal "0.0"
, and that you made the change, was this reverted somehow? Or do you need to explicitly cast to a QString
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must have gotten reverted when I corrected the merge issue. Thanks. Fixed in code.
pars.wavelength = toDouble(ConfKey(profile, "BandBinCenter", toString(Null))); | ||
pars.tolerance = toDouble(ConfKey(profile, "BandBinCenterTolerance", toString(Null))); | ||
// Determine equation units - defaults to Radians | ||
pars.units = ConfKey(profile, "Units", QString("Radians")); | ||
pars.phaUnit = (pars.units.toLower() == "degrees") ? 1.0 : rpd_c(); | ||
pars.algoVersion = toInt(ConfKey(profile, "AlgorithmVersion", QString("0"))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same string question here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must have gotten reverted when I corrected the merge issue. Thanks. Fixed in code.
extern void lronacpho(Cube *iCube, UserInterface &ui, Pvl *log=nullptr); | ||
extern void lronacpho(UserInterface &ui, Pvl *appLog=nullptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kinda minor, but might as well change appLog
here to log
for consistency with how they're defined in the rest of the lronacpho
signatures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in code.
LineManager oLine(outputCube); | ||
oLine.SetLine(300); | ||
outputCube.read(oLine); | ||
|
||
EXPECT_NEAR(oLine[300],algo3Result, 0.002); | ||
outputCube.close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anything particular about this DN that makes it important to check or is it a random sample?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a random sample compared to the same output using fx equation the science team is using manually. I would've included testing against fx so any random pixel value could be checked but fx isn't yet callable. This should be updated once it is in case a cube that doesn't have (300,300) pixel.
@victoronline Do you need anything else from us on this right now or are you good with making the minor adjustments based on the re-review? Then we can get this merged and start on the next PR. |
@jlaura I should be able to address the items above shortly. Appreciate the note. |
I don't know the etiquette regarding who does the "Resolve conversation" here so I left it up to the reviewer to resolve. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@victoronline looks good! 🎉
Description
This update needs to set the default photometric model (LROC_Empirical) to the newer model (2019) and look for the default parameters file in the data/mission/calibration directory. If the old parameter file is provided, the old algorithm(2014) will be used.
Default behavior:
Should use a newer photometric model as default with the newer parameters file (NAC_PHO_LROC_Empirical.0003.pvl).
Optional behavior:
If another pvl is provided with and doesn't specify the algorithm version (NAC_PHO_LROC_Empirical.0001.pvl), then the old photometric model will be used.
If the 2014 version is specified, such as in NAC_PHO_LROC_Empirical.0002.pvl, then the old photometric model will be used.
Related Issue
#4512
Motivation and Context
LROC has created a newer photometric model requiring updated parameters.
How Has This Been Tested?
This has been tested by the science team comparing photometric products using both the old and newer models and validated the results.
Types of changes
Checklist:
Licensing
This project is mostly composed of free and unencumbered software released into the public domain, and we are unlikely to accept contributions that are not also released into the public domain. Somewhere near the top of each file should have these words: