Skip to content
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

Marcical update to be fully congruent with calibration method #5004

Merged
merged 4 commits into from
Jul 19, 2022

Conversation

ladoramkershner
Copy link
Contributor

One small functional update to make sure we are fully implimenting the MARCI calibration method outlined here. Specifically step 3 is being implemented in this PR.

Description

In the MARCI calibration documentation output by the MRO mission team, after the flat file is taken through normalization and flattening there should be a check applied. If the flat file value is below 0.25 the equation in the follow step (step 4) should be set to zero. This was not reflected in the code.

All other changes are syntax improvements.

Related Issue

Related to issue #4619

Motivation and Context

Our MARCI calibration was not fully congruent to what the mission teams outlined for calibration of MARCI images.

How Has This Been Tested?

Output from running tests locally

The following tests did not run:
	1732 - TempTestingFiles.FunctionalTestJitterfitDefault (Disabled)
	1763 - TempTestingFiles.UnitTestImageImporterTestJpeg (Disabled)

The following tests FAILED:
	128 - isis_unit_test_JP2Importer (Failed)
	811 - deltack_app_test_directOffTarget (Failed)
	905 - cassini_module_test_vims (Failed)
	951 - hayabusa_module_test_fullframe (Failed)
	952 - hayabusa_module_test_subframe (Failed)
	984 - lronaccal_app_test_nacl-full (Failed)
	985 - lronaccal_app_test_nacl-summed (Failed)
	986 - lronaccal_app_test_nacr-full (Failed)
	987 - lronaccal_app_test_nacr-summed (Failed)
	1042 - mex_unit_test_MexHrscSrcCamera (Failed)
	1109 - mro_module_test_hirise (Failed)
	1110 - near_module_test_msi (Failed)
	1759 - TempTestingFiles.FunctionalTestStd2isisJp2 (Failed)
	1765 - TempTestingFiles.UnitTestImageImporterStd2IsisJp2 (Failed)
	1912 - IsisTruthCube.FunctionalTestsIsis2StdJpeg2KGray (Failed)
	1913 - IsisTruthCube.FunctionalTestsIsis2StdJpeg2KU16 (Failed)
	1914 - IsisTruthCube.FunctionalTestsIsis2StdJpeg2KS16 (Failed)
	1924 - SmallARGBCube.FunctionalTestsIsis2StdJpeg2KRGB (Failed)
	1925 - SmallARGBCube.FunctionalTestsIsis2StdJpeg2KARGB (Failed)
	1997 - LronaccalDefault.FunctionalTestsLronaccal (Failed)
	1998 - LronaccalNear.FunctionalTestsLronaccal (Failed)
	1999 - LronaccalPair.FunctionalTestsLronaccal (Failed)

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation change (update to the documentation; no code change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have read and agree to abide by the Code of Conduct
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have added myself to the .zenodo.json document.
  • I have added any user impacting changes to the CHANGELOG.md document.

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:

This work is free and unencumbered software released into the public domain. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain.

  • I dedicate any and all copyright interest in this software to the public domain. I make this dedication for the benefit of the public at large and to the detriment of my heirs and successors. I intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

@ladoramkershner
Copy link
Contributor Author

The tests that are failing are unrelated to the changes created in this PR. I am not sure if these test failures are expected however.

filterNameToFilterIndex.insert(pair<QString, int>("NIR", 5));
filterNameToFilterIndex.insert(pair<QString, int>("SHORT_UV", 6));
filterNameToFilterIndex.insert(pair<QString, int>("LONG_UV", 7));
map<QString, int> filterNameToFilterNumber;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filter index used in this code is zero based, so renamed for accuracy.

@@ -347,21 +337,14 @@ namespace Isis {
PvlKeyword &colOff = icube.label()->findGroup("Instrument", Pvl::Traverse)["ColorOffset"];
int colorOffset = toInt(colOff[0]);

for (int filter = 0; filter < numFilters; filter++) {
for (int i = 0; i < numFilters; i++) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filter variable is set previously, it did not seem to be resetting the larger variable, but changed for readability

Comment on lines +494 to +499
if ((*fcubeMgrs[fcubeIndex])[i] < 0.25) {
ocubeMgr[i] = 0;
}
else {
ocubeMgr[i] = stretch.Map(icubeMgr[i]) / (*fcubeMgrs[fcubeIndex])[i];
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the portion of the calibration logic missing from our implementation

See step 3 of https://pds-imaging.jpl.nasa.gov/data/mro/mars_reconnaissance_orbiter/marci/mrom_1343/calib/marcical.txt

@@ -524,6 +512,11 @@ namespace Isis {
icubeMgr++;
ocubeMgr++;

// checks if we have reached the end before setting higher band
if (ocubeMgr.end()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prevents non-existent band from being set in the last chunk of code in the loop.

Copy link
Contributor

@jessemapel jessemapel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure you add an entry to the changelog and to the marcical.xml file.

@ladoramkershner ladoramkershner changed the title Small clean up of single use variables and convoluted logic Marcical update to be fully congruent with calibration method Jul 18, 2022
@ladoramkershner ladoramkershner force-pushed the marci branch 2 times, most recently from c2db8c6 to 73b00cb Compare July 18, 2022 17:08
CHANGELOG.md Outdated
@@ -34,6 +34,7 @@ release.
-->

## [Unreleased]
- Update marcical to include step 3 of the mission team's MARCI calibration process described [here](https://pds-imaging.jpl.nasa.gov/data/mro/mars_reconnaissance_orbiter/marci/mrom_1343/calib/marcical.txt). [#5004](https://github.com/USGS-Astrogeology/ISIS3/pull/5004)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put this under an appropriate header

Copy link
Contributor Author

@ladoramkershner ladoramkershner Jul 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can do! I will move the other entries while I am at it!

Copy link
Contributor

@jessemapel jessemapel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to go in

@jessemapel
Copy link
Contributor

@ladoramkershner Go ahead and merge then when you're ready to add the new data

1 similar comment
@jessemapel
Copy link
Contributor

@ladoramkershner Go ahead and merge then when you're ready to add the new data

@ladoramkershner ladoramkershner merged commit ad3d02c into DOI-USGS:dev Jul 19, 2022
@jessemapel jessemapel mentioned this pull request Jul 21, 2022
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants