From 3e79dc7c43dc8ba74eea1d7adc6dd9abe3ba1b03 Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Mon, 4 Nov 2019 17:36:42 -0700 Subject: [PATCH 01/10] Added support for all MCP gain settings. Closes #3190 --- .../src/clementine/apps/clemhirescal/main.cpp | 25 ++----------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/isis/src/clementine/apps/clemhirescal/main.cpp b/isis/src/clementine/apps/clemhirescal/main.cpp index cd73c2e176..d4bc46b7ad 100644 --- a/isis/src/clementine/apps/clemhirescal/main.cpp +++ b/isis/src/clementine/apps/clemhirescal/main.cpp @@ -57,32 +57,11 @@ void IsisMain() { int MCP = label->findGroup("Instrument", Pvl::Traverse)["MCPGainModeID"]; // Two possible MCP gains for filter A if(wave == "A") { - if(MCP == 156) { - abscoef = 0.00105; - } - else if(MCP == 159) { - abscoef = 0.00089; - } - else { - QString message = "Image is not one of supported MCP Gain Mode IDs, enter your own K value"; - throw IException(IException::Unknown, message, _FILEINFO_); - } + abscoef = ((-5.33333333333333 * pow(10, -5) * MCP) + 0.00937); } // Three possiblities for filter D else if(wave == "D") { - if(MCP == 151) { - abscoef = 0.001655; - } - else if(MCP == 154) { - abscoef = 0.001375; - } - else if(MCP == 158) { - abscoef = 0.00097; - } - else { - QString message = "Image is not one of supported MCP Gain Mode IDs, enter your own K value"; - throw IException(IException::User, message, _FILEINFO_); - } + abscoef = ((-9.75301204819275 * pow(10, -5) * MCP) + 0.0163866265); } // Other filters not supported for preset K value else { From e5f67c60989a4fda46ab33feeb8c9c89f63601a7 Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Wed, 6 Nov 2019 15:05:56 -0700 Subject: [PATCH 02/10] Revised comments to better reflect updated logic --- isis/src/clementine/apps/clemhirescal/main.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/isis/src/clementine/apps/clemhirescal/main.cpp b/isis/src/clementine/apps/clemhirescal/main.cpp index d4bc46b7ad..157abfba28 100644 --- a/isis/src/clementine/apps/clemhirescal/main.cpp +++ b/isis/src/clementine/apps/clemhirescal/main.cpp @@ -48,22 +48,25 @@ void IsisMain() { double dataOffset[] = { -49.172, -41.0799, -32.8988, -24.718, -16.98, -8.0}; offset = dataOffset[index]; - // Computer the K value to convert to I/F. The K value per MCP and wavelength - // were obtained from JGR publication Vol 108, A radiometric calibration for the - // Clementine HIRES camera: Robinson, Malart, White, page 17 + // Compute the K value to convert to I/F. The functions for K value per MCP + // gain state and filter are based on Robinson, M. S., Malaret, E., + // and White, T. ( 2003), A radiometric calibration for the Clementine HIRES + // camera, J. Geophys. Res., 108, 5028, doi:10.1029/2000JE001241, E4. + // The functions were determined by fitting a line to the data in Table 5 (A filter) + // or Table 6 (D filter) of Robinson et al., as described on page 11. UserInterface &ui = Application::GetUserInterface(); if(ui.GetString("KFROM").compare("COMPUTED") == 0) { wave = wave.toUpper(); int MCP = label->findGroup("Instrument", Pvl::Traverse)["MCPGainModeID"]; - // Two possible MCP gains for filter A + // Linear fit of values in Table 5 if(wave == "A") { abscoef = ((-5.33333333333333 * pow(10, -5) * MCP) + 0.00937); } - // Three possiblities for filter D + // Linear fit of values in Table 6 else if(wave == "D") { abscoef = ((-9.75301204819275 * pow(10, -5) * MCP) + 0.0163866265); } - // Other filters not supported for preset K value + // Other filters not supported for calculated K value else { QString message = "Image is of filter [" + wave + "], not supported type A or D, enter your own K value"; throw IException(IException::User, message, _FILEINFO_); From 063ddf89e1a044f3f0f472e6e7987405e5a4abf5 Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Wed, 6 Nov 2019 15:59:42 -0700 Subject: [PATCH 03/10] Added history comment. --- isis/src/clementine/apps/clemhirescal/clemhirescal.xml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/isis/src/clementine/apps/clemhirescal/clemhirescal.xml b/isis/src/clementine/apps/clemhirescal/clemhirescal.xml index 501c8b5a86..eb10adbb47 100644 --- a/isis/src/clementine/apps/clemhirescal/clemhirescal.xml +++ b/isis/src/clementine/apps/clemhirescal/clemhirescal.xml @@ -9,14 +9,17 @@ camera. It does so through the use of some constants based on offset and flat images based on filter type. There are six possible offsets, with the resultant change being anywhere between eight and fifty to the DN. There - are four flat images, one for each of the four possible filters. - Information for this program came from JGR Vol 108, A radiometric + are four flat images, one for each of the four possible filters. + Information for this program came from JGR Vol 108, A radiometric calibration for the Clementine Hires camera: Robinson, Malaret, White. Original version + + Replaced lookup tables with calibration equations. + @@ -110,7 +113,7 @@ The K value is the absolute coefficient per wavelength and MCP gain - state. This is an average of several possible K values, the default + state. This is an average of several possible K values, the default should not be used when possible as it is an average. From eaf88519932964c5fd1f271f17bb63b24fea14d4 Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Fri, 8 Nov 2019 11:19:55 -0700 Subject: [PATCH 04/10] Added additional description and link to Robinson paper. --- .../clementine/apps/clemhirescal/clemhirescal.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/isis/src/clementine/apps/clemhirescal/clemhirescal.xml b/isis/src/clementine/apps/clemhirescal/clemhirescal.xml index eb10adbb47..b94d8382e8 100644 --- a/isis/src/clementine/apps/clemhirescal/clemhirescal.xml +++ b/isis/src/clementine/apps/clemhirescal/clemhirescal.xml @@ -12,6 +12,19 @@ are four flat images, one for each of the four possible filters. Information for this program came from JGR Vol 108, A radiometric calibration for the Clementine Hires camera: Robinson, Malaret, White. + The original paper can be found at https://doi.org/10.1029/2000JE001241 + + The equation for the A filter yields k values that are identical to those + in Table 5 from Robinson et al. (2003), therefore the pixel values in the + output image are the same as they would be if the k values from Table 5 + were hard coded into the script. + + The equation for the D filter yields k values that differ from the + hard-coded values by less than 1 standard deviation as reported in Table 6 + of Robinson et al. (2003). The radiance values that result from the + computed k values differ by no more than .0583% of the radiance values + computed from the k values published in Table 6. + @@ -19,6 +32,7 @@ Replaced lookup tables with calibration equations. + See description for more detailed information. From 19f3ea845bf2908d8519b933526d45b5d81fe626 Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Fri, 15 Nov 2019 17:39:38 -0700 Subject: [PATCH 05/10] Added preferences variable to shapemodel path. --- isis/src/base/apps/spiceinit/tsts/shapemodel/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/isis/src/base/apps/spiceinit/tsts/shapemodel/Makefile b/isis/src/base/apps/spiceinit/tsts/shapemodel/Makefile index aa7267c93a..f1c58f71c4 100644 --- a/isis/src/base/apps/spiceinit/tsts/shapemodel/Makefile +++ b/isis/src/base/apps/spiceinit/tsts/shapemodel/Makefile @@ -9,13 +9,13 @@ commands: # Test with IsisPreferences set for Embree cp $(INPUT)/st_2458542208_v.cub $(OUTPUT)/ > /dev/null; $(APPNAME) from=$(OUTPUT)/st_2458542208_v.cub shape=user \ - model=$(ISIS3DATA)/hayabusa/kernels/dsk/hay_a_amica_5_itokawashape_v1_0_512q.bds \ + model='$$hayabusa/kernels/dsk/hay_a_amica_5_itokawashape_v1_0_64q.bds' \ -pref=$(INPUT)/IsisPreferences_embree > /dev/null; catlab from=$(OUTPUT)/st_2458542208_v.cub to=$(OUTPUT)/label_embree.pvl > /dev/null; # Test with IsisPreferences set for Bullet $(APPNAME) from=$(OUTPUT)/st_2458542208_v.cub shape=user \ - model=$(ISIS3DATA)/hayabusa/kernels/dsk/hay_a_amica_5_itokawashape_v1_0_512q.bds \ + model='$$hayabusa/kernels/dsk/hay_a_amica_5_itokawashape_v1_0_64q.bds' \ -pref=$(INPUT)/IsisPreferences_bullet > /dev/null; catlab from=$(OUTPUT)/st_2458542208_v.cub to=$(OUTPUT)/label_bullet.pvl > /dev/null; From c512f660fa9a0ab3a0d0c1ef30a0b0365d77e241 Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Wed, 16 Sep 2020 12:10:42 -0700 Subject: [PATCH 06/10] Test if l37 is causing test failure. --- isis/tests/FunctionalTestsGetsn.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/isis/tests/FunctionalTestsGetsn.cpp b/isis/tests/FunctionalTestsGetsn.cpp index 5e73aba573..e15555ab0f 100644 --- a/isis/tests/FunctionalTestsGetsn.cpp +++ b/isis/tests/FunctionalTestsGetsn.cpp @@ -32,9 +32,9 @@ TEST_F(DefaultCube, FunctionalTestGetsnAllTrue) { Pvl appLog; getsn( testCube, options, &appLog ); - PvlGroup results = appLog.findGroup("Results"); - - EXPECT_PRED_FORMAT2(AssertQStringsEqual, results.findKeyword("Filename"), testCube->fileName()); + PvlGroup results = appLog.findGroup("Results"); + + //EXPECT_PRED_FORMAT2(AssertQStringsEqual, results.findKeyword("Filename"), testCube->fileName()); EXPECT_PRED_FORMAT2(AssertQStringsEqual, results.findKeyword("SerialNumber"), expectedSN); EXPECT_PRED_FORMAT2(AssertQStringsEqual, results.findKeyword("ObservationNumber"), expectedON); } @@ -66,9 +66,9 @@ TEST_F(DefaultCube, FunctionalTestGetsnDefaultTrue) { Pvl appLog; Pvl *testLabel = testCube->label(); testLabel->findObject( "IsisCube" ).deleteGroup( "Instrument" ); - + getsn( testCube, options, &appLog ); - PvlGroup results = appLog.findGroup("Results"); + PvlGroup results = appLog.findGroup("Results"); EXPECT_PRED_FORMAT2(AssertQStringsEqual, fileName , results.findKeyword("SerialNumber")); } @@ -83,9 +83,9 @@ TEST_F(DefaultCube, FunctionalTestGetsnDefaultFalse) { Pvl appLog; Pvl *testLabel = testCube->label(); testLabel->findObject( "IsisCube" ).deleteGroup( "Instrument" ); - + getsn( testCube, options, &appLog ); - PvlGroup results = appLog.findGroup("Results"); + PvlGroup results = appLog.findGroup("Results"); EXPECT_PRED_FORMAT2(AssertQStringsEqual, fileName , results.findKeyword("SerialNumber")); } @@ -114,7 +114,7 @@ TEST_F(DefaultCube, FunctionalTestGetsnFlat) { // Test that append true appends to file TEST_F(DefaultCube, FunctionalTestGetsnAppend) { QFile flatFile(tempDir.path()+"testOut.txt"); - QVector args = { + QVector args = { "FORMAT=FLAT", "TO="+flatFile.fileName(), "APPEND=TRUE"}; @@ -133,7 +133,7 @@ TEST_F(DefaultCube, FunctionalTestGetsnAppend) { // Test that append false overwrites file TEST_F(DefaultCube, FunctionalTestGetsnOverwrite) { QFile flatFile(tempDir.path()+"testOut.txt"); - QVector args = { + QVector args = { "FORMAT=FLAT", "TO="+flatFile.fileName(), "APPEND=FALSE"}; From 167b5b55f759aea97a350e078fcc11aa47335ade Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Wed, 16 Sep 2020 16:00:18 -0700 Subject: [PATCH 07/10] . --- isis/tests/FunctionalTestsGetsn.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/isis/tests/FunctionalTestsGetsn.cpp b/isis/tests/FunctionalTestsGetsn.cpp index e15555ab0f..9d3c981514 100644 --- a/isis/tests/FunctionalTestsGetsn.cpp +++ b/isis/tests/FunctionalTestsGetsn.cpp @@ -24,19 +24,19 @@ static QString APP_XML = FileName("$ISISROOT/bin/xml/getsn.xml").expanded(); TEST_F(DefaultCube, FunctionalTestGetsnAllTrue) { QString expectedSN = "Viking1/VISB/33322515"; QString expectedON = "Viking1/VISB/33322515"; - QVector args = { - "FILE=TRUE", + QVector args = { "FILE=TRUE", "SN=TRUE", "OBSERVATION=TRUE"}; UserInterface options(APP_XML, args); Pvl appLog; - getsn( testCube, options, &appLog ); + /*getsn( testCube, options, &appLog ); PvlGroup results = appLog.findGroup("Results"); - //EXPECT_PRED_FORMAT2(AssertQStringsEqual, results.findKeyword("Filename"), testCube->fileName()); + EXPECT_PRED_FORMAT2(AssertQStringsEqual, results.findKeyword("Filename"), testCube->fileName()); EXPECT_PRED_FORMAT2(AssertQStringsEqual, results.findKeyword("SerialNumber"), expectedSN); EXPECT_PRED_FORMAT2(AssertQStringsEqual, results.findKeyword("ObservationNumber"), expectedON); + */ } From c4f6e13d4bb3432d5b9290728b682c5ba7ed8237 Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Wed, 16 Sep 2020 17:24:45 -0700 Subject: [PATCH 08/10] .. --- isis/tests/FunctionalTestsGetsn.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/isis/tests/FunctionalTestsGetsn.cpp b/isis/tests/FunctionalTestsGetsn.cpp index 9d3c981514..afb8b10080 100644 --- a/isis/tests/FunctionalTestsGetsn.cpp +++ b/isis/tests/FunctionalTestsGetsn.cpp @@ -22,6 +22,8 @@ static QString APP_XML = FileName("$ISISROOT/bin/xml/getsn.xml").expanded(); // check for all correct outputs TEST_F(DefaultCube, FunctionalTestGetsnAllTrue) { + ASSERT_TRUE(1==1); + /* QString expectedSN = "Viking1/VISB/33322515"; QString expectedON = "Viking1/VISB/33322515"; QVector args = { "FILE=TRUE", From d17213b913acdfc8415aa6dbe86be9e28f3e0005 Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Wed, 16 Sep 2020 21:49:29 -0700 Subject: [PATCH 09/10] Comment out UI instantiation --- isis/tests/FunctionalTestsGetsn.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/isis/tests/FunctionalTestsGetsn.cpp b/isis/tests/FunctionalTestsGetsn.cpp index afb8b10080..47be1761ad 100644 --- a/isis/tests/FunctionalTestsGetsn.cpp +++ b/isis/tests/FunctionalTestsGetsn.cpp @@ -22,16 +22,15 @@ static QString APP_XML = FileName("$ISISROOT/bin/xml/getsn.xml").expanded(); // check for all correct outputs TEST_F(DefaultCube, FunctionalTestGetsnAllTrue) { - ASSERT_TRUE(1==1); - /* QString expectedSN = "Viking1/VISB/33322515"; QString expectedON = "Viking1/VISB/33322515"; QVector args = { "FILE=TRUE", "SN=TRUE", "OBSERVATION=TRUE"}; - UserInterface options(APP_XML, args); + //UserInterface options(APP_XML, args); Pvl appLog; + ASSERT_TRUE(1==1); /*getsn( testCube, options, &appLog ); PvlGroup results = appLog.findGroup("Results"); From 42bf6a153496b8c067b577a091f12553f7420256 Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Wed, 16 Sep 2020 23:17:54 -0700 Subject: [PATCH 10/10] Instantiated non-static app_xml --- isis/tests/FunctionalTestsGetsn.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/isis/tests/FunctionalTestsGetsn.cpp b/isis/tests/FunctionalTestsGetsn.cpp index 47be1761ad..f3d8201465 100644 --- a/isis/tests/FunctionalTestsGetsn.cpp +++ b/isis/tests/FunctionalTestsGetsn.cpp @@ -22,22 +22,22 @@ static QString APP_XML = FileName("$ISISROOT/bin/xml/getsn.xml").expanded(); // check for all correct outputs TEST_F(DefaultCube, FunctionalTestGetsnAllTrue) { + QString d_APP_XML = FileName("$ISISROOT/bin/xml/getsn.xml").expanded(); QString expectedSN = "Viking1/VISB/33322515"; QString expectedON = "Viking1/VISB/33322515"; QVector args = { "FILE=TRUE", "SN=TRUE", "OBSERVATION=TRUE"}; - //UserInterface options(APP_XML, args); + UserInterface options(d_APP_XML, args); Pvl appLog; ASSERT_TRUE(1==1); - /*getsn( testCube, options, &appLog ); + getsn( testCube, options, &appLog ); PvlGroup results = appLog.findGroup("Results"); EXPECT_PRED_FORMAT2(AssertQStringsEqual, results.findKeyword("Filename"), testCube->fileName()); EXPECT_PRED_FORMAT2(AssertQStringsEqual, results.findKeyword("SerialNumber"), expectedSN); EXPECT_PRED_FORMAT2(AssertQStringsEqual, results.findKeyword("ObservationNumber"), expectedON); - */ }