From 5515d34340203d08bc598e80e54509e5c43d9429 Mon Sep 17 00:00:00 2001 From: Tim Giroux Date: Tue, 24 Nov 2020 13:41:30 -0700 Subject: [PATCH 1/6] write tests with cropped data --- isis/src/base/apps/pds2isis/Makefile | 7 - isis/src/base/apps/pds2isis/tsts/Makefile | 4 - .../base/apps/pds2isis/tsts/bandbin/Makefile | 11 - .../base/apps/pds2isis/tsts/default/Makefile | 10 - .../apps/pds2isis/tsts/offsetTest/Makefile | 9 - .../apps/pds2isis/tsts/projection/Makefile | 15 - .../apps/pds2isis/tsts/specialPixels/Makefile | 16 - .../base/apps/pds2isis/tsts/testBIL/Makefile | 9 - .../base/apps/pds2isis/tsts/testBIP/Makefile | 12 - .../apps/pds2isis/tsts/testNIMSQub/Makefile | 8 - isis/tests/FunctionalTestsPds2isis.cpp | 352 ++++++++++++++++++ 11 files changed, 352 insertions(+), 101 deletions(-) delete mode 100644 isis/src/base/apps/pds2isis/Makefile delete mode 100644 isis/src/base/apps/pds2isis/tsts/Makefile delete mode 100644 isis/src/base/apps/pds2isis/tsts/bandbin/Makefile delete mode 100644 isis/src/base/apps/pds2isis/tsts/default/Makefile delete mode 100644 isis/src/base/apps/pds2isis/tsts/offsetTest/Makefile delete mode 100644 isis/src/base/apps/pds2isis/tsts/projection/Makefile delete mode 100644 isis/src/base/apps/pds2isis/tsts/specialPixels/Makefile delete mode 100644 isis/src/base/apps/pds2isis/tsts/testBIL/Makefile delete mode 100644 isis/src/base/apps/pds2isis/tsts/testBIP/Makefile delete mode 100644 isis/src/base/apps/pds2isis/tsts/testNIMSQub/Makefile create mode 100644 isis/tests/FunctionalTestsPds2isis.cpp diff --git a/isis/src/base/apps/pds2isis/Makefile b/isis/src/base/apps/pds2isis/Makefile deleted file mode 100644 index 7578f0b21d..0000000000 --- a/isis/src/base/apps/pds2isis/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ifeq ($(ISISROOT), $(BLANK)) -.SILENT: -error: - echo "Please set ISISROOT"; -else - include $(ISISROOT)/make/isismake.apps -endif \ No newline at end of file diff --git a/isis/src/base/apps/pds2isis/tsts/Makefile b/isis/src/base/apps/pds2isis/tsts/Makefile deleted file mode 100644 index 46d84c74c2..0000000000 --- a/isis/src/base/apps/pds2isis/tsts/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -BLANKS = "%-6s" -LENGTH = "%-40s" - -include $(ISISROOT)/make/isismake.tststree diff --git a/isis/src/base/apps/pds2isis/tsts/bandbin/Makefile b/isis/src/base/apps/pds2isis/tsts/bandbin/Makefile deleted file mode 100644 index e978b5b36d..0000000000 --- a/isis/src/base/apps/pds2isis/tsts/bandbin/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -APPNAME = pds2isis - - -include $(ISISROOT)/make/isismake.tsts - -# Test translation of PDS BAND_BIN group with BAND_BIN prefixed keywords. -commands: - $(APPNAME) from=$(INPUT)/gaspra_nims_hires_radiance.lbl \ - to=$(OUTPUT)/gaspra_nims_hires_radiance.cub > /dev/null; \ - catlab from=$(OUTPUT)/gaspra_nims_hires_radiance.cub \ - to=$(OUTPUT)/gaspra_nims_hires_radiance.pvl > /dev/null; diff --git a/isis/src/base/apps/pds2isis/tsts/default/Makefile b/isis/src/base/apps/pds2isis/tsts/default/Makefile deleted file mode 100644 index db8e6fa4b1..0000000000 --- a/isis/src/base/apps/pds2isis/tsts/default/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -APPNAME = pds2isis - -labels.txt.IGNORELINES = Bytes StartByte ByteOrder TileSamples TileLines - -include $(ISISROOT)/make/isismake.tsts - -commands: - $(APPNAME) from=$(INPUT)/ab102401.img \ - to=$(OUTPUT)/pds2isisTruth.cub > /dev/null; - catlab from=$(OUTPUT)/pds2isisTruth.cub to=$(OUTPUT)/pds2isisTruth.pvl > /dev/null; diff --git a/isis/src/base/apps/pds2isis/tsts/offsetTest/Makefile b/isis/src/base/apps/pds2isis/tsts/offsetTest/Makefile deleted file mode 100644 index ed1e3e7f00..0000000000 --- a/isis/src/base/apps/pds2isis/tsts/offsetTest/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -APPNAME = pds2isis - -include $(ISISROOT)/make/isismake.tsts - -commands: - $(APPNAME) from=$(INPUT)/ldem_4.lbl \ - to=$(OUTPUT)/ldem_4.cub > /dev/null; - catlab from=$(OUTPUT)/ldem_4.cub to=$(OUTPUT)/ldem_4truth.pvl > /dev/null; - diff --git a/isis/src/base/apps/pds2isis/tsts/projection/Makefile b/isis/src/base/apps/pds2isis/tsts/projection/Makefile deleted file mode 100644 index fd71b1d7f8..0000000000 --- a/isis/src/base/apps/pds2isis/tsts/projection/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -APPNAME = pds2isis - -labels.txt.IGNORELINES = Bytes StartByte ByteOrder TileSamples TileLines - -include $(ISISROOT)/make/isismake.tsts - -commands: - $(APPNAME) from=$(INPUT)/ff17.lbl \ - to=$(OUTPUT)/ff17Truth.cub \ - | $(SED) 's+.*% Processed.*#+#+' \ - | grep -v "Processed" \ - | grep -v "Working" \ - | grep -v "Importing" \ - >& $(OUTPUT)/print.txt; - catlab from=$(OUTPUT)/ff17Truth.cub to=$(OUTPUT)/ff17Truth.pvl > /dev/null; diff --git a/isis/src/base/apps/pds2isis/tsts/specialPixels/Makefile b/isis/src/base/apps/pds2isis/tsts/specialPixels/Makefile deleted file mode 100644 index ee86ab1978..0000000000 --- a/isis/src/base/apps/pds2isis/tsts/specialPixels/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -APPNAME = pds2isis - -labels.txt.IGNORELINES = Bytes StartByte ByteOrder TileSamples TileLines - -include $(ISISROOT)/make/isismake.tsts - -commands: - $(APPNAME) from=$(INPUT)/ab102401.img \ - to=$(OUTPUT)/pds2isisTruth.cub+32bit \ - setnullrange=yes nullmin=15.0 nullmax=45.0 \ - sethrsrange=yes hrsmin=220.0 hrsmax=250.0 \ - sethisrange=yes hismin=190.0 hismax=219.0 \ - setlrsrange=yes lrsmin=96.0 lrsmax=125.0 \ - setlisrange=yes lismin=65.0 lismax=95.0 \ - > /dev/null; - catlab from=$(OUTPUT)/pds2isisTruth.cub to=$(OUTPUT)/pds2isisTruth.pvl > /dev/null; diff --git a/isis/src/base/apps/pds2isis/tsts/testBIL/Makefile b/isis/src/base/apps/pds2isis/tsts/testBIL/Makefile deleted file mode 100644 index 9299c05af0..0000000000 --- a/isis/src/base/apps/pds2isis/tsts/testBIL/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -APPNAME = pds2isis - -include $(ISISROOT)/make/isismake.tsts - -commands: - $(APPNAME) from=$(INPUT)/BILtestData.LBL \ - to=$(OUTPUT)/testBILtruth.cub+32bit > /dev/null; - catlab from=$(OUTPUT)/testBILtruth.cub to=$(OUTPUT)/testBILtruth.pvl > /dev/null; - diff --git a/isis/src/base/apps/pds2isis/tsts/testBIP/Makefile b/isis/src/base/apps/pds2isis/tsts/testBIP/Makefile deleted file mode 100644 index bcf0f803a2..0000000000 --- a/isis/src/base/apps/pds2isis/tsts/testBIP/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -APPNAME = pds2isis - -include $(ISISROOT)/make/isismake.tsts - -# The output of this test will not look like a usable image -# because the band storage type was changed from BIL to BIP -# for this test. - -commands: - $(APPNAME) from=$(INPUT)/BIPtestData.LBL \ - to=$(OUTPUT)/testBIPtruth.cub+32bit > /dev/null; - catlab from=$(OUTPUT)/testBIPtruth.cub to=$(OUTPUT)/testBIPtruth.pvl > /dev/null; diff --git a/isis/src/base/apps/pds2isis/tsts/testNIMSQub/Makefile b/isis/src/base/apps/pds2isis/tsts/testNIMSQub/Makefile deleted file mode 100644 index ee35d052b6..0000000000 --- a/isis/src/base/apps/pds2isis/tsts/testNIMSQub/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -APPNAME = pds2isis - -include $(ISISROOT)/make/isismake.tsts - -commands: - $(APPNAME) from=$(INPUT)/30i001ci.qub \ - to=$(OUTPUT)/30i001ci.cub > /dev/null; - catlab from=$(OUTPUT)/30i001ci.cub to=$(OUTPUT)/30i001ci.pvl > /dev/null; diff --git a/isis/tests/FunctionalTestsPds2isis.cpp b/isis/tests/FunctionalTestsPds2isis.cpp new file mode 100644 index 0000000000..52fd6e97d0 --- /dev/null +++ b/isis/tests/FunctionalTestsPds2isis.cpp @@ -0,0 +1,352 @@ +#include + +#include "pds2isis.h" +#include "Fixtures.h" +#include "Pvl.h" +#include "PvlGroup.h" +#include "TestUtilities.h" + +#include "gtest/gtest.h" + +using namespace Isis; + +static QString APP_XML = FileName("$ISISROOT/bin/xml/pds2isis.xml").expanded(); + +TEST(Pds2Isis, Pds2isisTestDefault) { + Pvl appLog; + QTemporaryDir prefix; + QString cubeFileName = prefix.path() + "/pds2isis_out.cub"; + QVector args = { "from=data/pds2isis/ab102401_cropped.img", + "to=" + cubeFileName }; + UserInterface options(APP_XML, args); + try { + pds2isis(options, &appLog); + } + catch (IException &e) { + FAIL() << "Unable to ingest file: " << e.toString().toStdString().c_str() << std::endl; + } + + Cube outCube(cubeFileName); + Pvl *outLabel = outCube.label(); + + PvlGroup dimensions = outLabel->findGroup("Dimensions", Pvl::Traverse); + ASSERT_EQ((int)dimensions["Samples"], 640); + ASSERT_EQ((int)dimensions["Lines"], 5); + ASSERT_EQ((int)dimensions["Bands"], 1); + + PvlGroup pixels = outLabel->findGroup("Pixels", Pvl::Traverse); + ASSERT_EQ(pixels["Type"][0].toStdString(), "UnsignedByte"); + ASSERT_EQ(pixels["ByteOrder"][0].toStdString(), "Lsb"); + ASSERT_EQ((double)pixels["Base"], 0.0); + ASSERT_EQ((double)pixels["Multiplier"], 1.0); + + PvlGroup archive = outLabel->findGroup("Archive", Pvl::Traverse); + ASSERT_EQ(archive["DataSetId"][0].toStdString(), "MGS-M-MOC-NA/WA-2-DSDP-L0-V1.0"); + ASSERT_EQ(archive["ProducerId"][0].toStdString(), "MGS_MOC_TEAM"); + ASSERT_EQ(archive["ProductId"][0].toStdString(), "AB-1-024/01"); + ASSERT_EQ(archive["InstrumentId"][0].toStdString(), "MOC-WA"); + ASSERT_EQ(archive["TargetName"][0].toStdString(), "MARS"); + ASSERT_EQ(archive["MissionPhaseName"][0].toStdString(), "AB-1"); + ASSERT_EQ(archive["RationaleDescription"][0].toStdString(), "OLYMPUS MONS SPECIAL RED WIDE ANGLE"); +} + + +TEST(Pds2Isis, Pds2isisTestBandBin) { + Pvl appLog; + QTemporaryDir prefix; + QString cubeFileName = prefix.path() + "/pds2isis_out.cub"; + QVector args = { "from=data/pds2isis/gaspra_nims_hires_radiance_cropped.lbl", + "to=" + cubeFileName }; + UserInterface options(APP_XML, args); + + try { + pds2isis(options, &appLog); + } + catch (IException &e) { + FAIL() << "Unable to ingest file: " << e.toString().toStdString().c_str() << std::endl; + } + + Cube outCube(cubeFileName); + Pvl *outLabel = outCube.label(); + + PvlGroup dimensions = outLabel->findGroup("Dimensions", Pvl::Traverse); + ASSERT_EQ((int)dimensions["Samples"], 1); + ASSERT_EQ((int)dimensions["Lines"], 66); + ASSERT_EQ((int)dimensions["Bands"], 17); + + bool ok = false; + PvlGroup bandbin = outLabel->findGroup("BandBin", Pvl::Traverse); + ASSERT_EQ(bandbin["Center"][0].toDouble(&ok), 0.7360); + ASSERT_EQ(bandbin["Center"][1].toDouble(&ok), 0.8750); + ASSERT_EQ(bandbin["Center"][2].toDouble(&ok), 1.0546); + ASSERT_EQ(bandbin["Center"][3].toDouble(&ok), 1.3326); + ASSERT_EQ(bandbin["Center"][4].toDouble(&ok), 1.6110); + ASSERT_EQ(bandbin["Center"][5].toDouble(&ok), 1.8914); + ASSERT_EQ(bandbin["Center"][6].toDouble(&ok), 2.1728); + ASSERT_EQ(bandbin["Center"][7].toDouble(&ok), 2.4529); + ASSERT_EQ(bandbin["Center"][8].toDouble(&ok), 2.7382); + ASSERT_EQ(bandbin["Center"][9].toDouble(&ok), 3.0178); + ASSERT_EQ(bandbin["Center"][10].toDouble(&ok), 3.3012); + ASSERT_EQ(bandbin["Center"][11].toDouble(&ok), 3.5839); + ASSERT_EQ(bandbin["Center"][12].toDouble(&ok), 3.8670); + ASSERT_EQ(bandbin["Center"][13].toDouble(&ok), 4.1503); + ASSERT_EQ(bandbin["Center"][14].toDouble(&ok), 4.4343); + ASSERT_EQ(bandbin["Center"][15].toDouble(&ok), 4.7164); + ASSERT_EQ(bandbin["Center"][16].toDouble(&ok), 4.9988); + + ASSERT_EQ(bandbin["Width"][0].toDouble(&ok), 0.0125); + ASSERT_EQ(bandbin["Width"][1].toDouble(&ok), 0.0125); + ASSERT_EQ(bandbin["Width"][2].toDouble(&ok), 0.0250); + ASSERT_EQ(bandbin["Width"][3].toDouble(&ok), 0.0250); + ASSERT_EQ(bandbin["Width"][4].toDouble(&ok), 0.0250); + ASSERT_EQ(bandbin["Width"][5].toDouble(&ok), 0.0250); + ASSERT_EQ(bandbin["Width"][6].toDouble(&ok), 0.0250); + ASSERT_EQ(bandbin["Width"][7].toDouble(&ok), 0.0250); + ASSERT_EQ(bandbin["Width"][8].toDouble(&ok), 0.0250); + ASSERT_EQ(bandbin["Width"][9].toDouble(&ok), 0.0250); + ASSERT_EQ(bandbin["Width"][10].toDouble(&ok), 0.0250); + ASSERT_EQ(bandbin["Width"][11].toDouble(&ok), 0.0250); + ASSERT_EQ(bandbin["Width"][12].toDouble(&ok), 0.0250); + ASSERT_EQ(bandbin["Width"][13].toDouble(&ok), 0.0250); + ASSERT_EQ(bandbin["Width"][14].toDouble(&ok), 0.0250); + ASSERT_EQ(bandbin["Width"][15].toDouble(&ok), 0.0250); + ASSERT_EQ(bandbin["Width"][16].toDouble(&ok), 0.0250); + + ASSERT_EQ(bandbin["FilterNumber"][0].toInt(&ok, 10), 1); + ASSERT_EQ(bandbin["FilterNumber"][1].toInt(&ok, 10), 2); + ASSERT_EQ(bandbin["FilterNumber"][2].toInt(&ok, 10), 3); + ASSERT_EQ(bandbin["FilterNumber"][3].toInt(&ok, 10), 4); + ASSERT_EQ(bandbin["FilterNumber"][4].toInt(&ok, 10), 5); + ASSERT_EQ(bandbin["FilterNumber"][5].toInt(&ok, 10), 6); + ASSERT_EQ(bandbin["FilterNumber"][6].toInt(&ok, 10), 7); + ASSERT_EQ(bandbin["FilterNumber"][7].toInt(&ok, 10), 8); + ASSERT_EQ(bandbin["FilterNumber"][8].toInt(&ok, 10), 9); + ASSERT_EQ(bandbin["FilterNumber"][9].toInt(&ok, 10), 10); + ASSERT_EQ(bandbin["FilterNumber"][10].toInt(&ok, 10), 11); + ASSERT_EQ(bandbin["FilterNumber"][11].toInt(&ok, 10), 12); + ASSERT_EQ(bandbin["FilterNumber"][12].toInt(&ok, 10), 13); + ASSERT_EQ(bandbin["FilterNumber"][13].toInt(&ok, 10), 14); + ASSERT_EQ(bandbin["FilterNumber"][14].toInt(&ok, 10), 15); + ASSERT_EQ(bandbin["FilterNumber"][15].toInt(&ok, 10), 16); + ASSERT_EQ(bandbin["FilterNumber"][16].toInt(&ok, 10), 17); +} + + +TEST(Pds2Isis, Pds2isisTestOffset) { + Pvl appLog; + QTemporaryDir prefix; + QString cubeFileName = prefix.path() + "/pds2isis_out.cub"; + QVector args = { "from=data/pds2isis/ldem_4_cropped.img", + "to=" + cubeFileName }; + UserInterface options(APP_XML, args); + + try { + pds2isis(options, &appLog); + } + catch (IException &e) { + FAIL() << "Unable to ingest file: " << e.toString().toStdString().c_str() << std::endl; + } + + Cube outCube(cubeFileName); + Pvl *outLabel = outCube.label(); + + PvlGroup mapping = outLabel->findGroup("Mapping", Pvl::Traverse); + ASSERT_EQ(mapping["ProjectionName"][0].toStdString(), "SimpleCylindrical"); + ASSERT_EQ((double)mapping["CenterLongitude"], 180.0); + ASSERT_EQ(mapping["TargetName"][0].toStdString(), "Moon"); + ASSERT_EQ((double)mapping["EquatorialRadius"], 1737400.0); + ASSERT_EQ((double)mapping["PolarRadius"], 1737400.0); + ASSERT_EQ(mapping["LatitudeType"][0].toStdString(), "Planetocentric"); + ASSERT_EQ(mapping["LongitudeDirection"][0].toStdString(), "PositiveEast"); + ASSERT_EQ((int)mapping["LongitudeDomain"], 360); + ASSERT_EQ((double)mapping["MinimumLatitude"], -90.0); + ASSERT_EQ((double)mapping["MaximumLatitude"], 90.0); + ASSERT_EQ((double)mapping["MinimumLongitude"], 0.0); + ASSERT_EQ((double)mapping["MaximumLongitude"], 360.0); + ASSERT_EQ((double)mapping["UpperLeftCornerX"], -5458204.8); + ASSERT_EQ((double)mapping["UpperLeftCornerY"], 2729102.4); + ASSERT_EQ((double)mapping["PixelResolution"], 7580.84); + ASSERT_EQ((double)mapping["Scale"], 4.0); + +} + +TEST(Pds2Isis, Pds2isisTestProjection) { + Pvl appLog; + QTemporaryDir prefix; + QString cubeFileName = prefix.path() + "/pds2isis_out.cub"; + QVector args = { "from=data/pds2isis/ff17_cropped.lbl", + "to=" + cubeFileName }; + UserInterface options(APP_XML, args); + + try { + pds2isis(options, &appLog); + } + catch (IException &e) { + FAIL() << "Unable to ingest file: " << e.toString().toStdString().c_str() << std::endl; + } + + Cube outCube(cubeFileName); + Pvl *outLabel = outCube.label(); + + PvlGroup mapping = outLabel->findGroup("Mapping", Pvl::Traverse); + ASSERT_EQ(mapping["ProjectionName"][0].toStdString(), "Sinusoidal"); + ASSERT_EQ((double)mapping["CenterLongitude"], 325.3829); + ASSERT_EQ(mapping["TargetName"][0].toStdString(), "Venus"); + ASSERT_EQ((double)mapping["EquatorialRadius"], 6051920.0); + ASSERT_EQ((double)mapping["PolarRadius"], 6051920.0); + ASSERT_EQ(mapping["LatitudeType"][0].toStdString(), "Planetocentric"); + ASSERT_EQ(mapping["LongitudeDirection"][0].toStdString(), "PositiveEast"); + ASSERT_EQ((int)mapping["LongitudeDomain"], 360); + ASSERT_EQ((double)mapping["MinimumLatitude"], -29.6357); + ASSERT_EQ((double)mapping["MaximumLatitude"], -28.9092); + ASSERT_EQ((double)mapping["MinimumLongitude"], 322.0367); + ASSERT_EQ((double)mapping["MaximumLongitude"], 322.8903); + ASSERT_EQ((double)mapping["UpperLeftCornerX"], -307162.5); + ASSERT_EQ((double)mapping["UpperLeftCornerY"], -3053025.0); + ASSERT_EQ((double)mapping["PixelResolution"], 75.0); + ASSERT_EQ((double)mapping["Scale"], 1407.4); +} + +TEST(Pds2Isis, Pds2isisTestSpecialPixels) { + Pvl appLog; + QTemporaryDir prefix; + QVector args; + QString cubeFileName = prefix.path() + "/pds2isis_out.cub"; + + // test setnullrange + args = { "from=data/pds2isis/ab102401_cropped.img", + "to=" + cubeFileName, + "setnullrange=yes", "nullmin=15.0", "nullmax=45.0" }; + UserInterface options_nullrange(APP_XML, args); + try { + pds2isis(options_nullrange, &appLog); + } + catch (IException &e) { + FAIL() << "Failed for setnullrange=yes on file: " << e.toString().toStdString().c_str() << std::endl; + } + + // test sethrsrange + args = { "from=data/pds2isis/ab102401_cropped.img", + "to=" + cubeFileName, + "sethrsrange=yes", "hrsmin=220.0", "hrsmax=250.0"}; + UserInterface options_hrsrange(APP_XML, args); + try { + pds2isis(options_hrsrange, &appLog); + } + catch (IException &e) { + FAIL() << "Failed for sethrsrange=yes on file: " << e.toString().toStdString().c_str() << std::endl; + } + + // test sethisrange + args = { "from=data/pds2isis/ab102401_cropped.img", + "to=" + cubeFileName, + "sethisrange=yes", "hismin=190.0", "hismax=219.0"}; + UserInterface options_hisrange(APP_XML, args); + try { + pds2isis(options_hisrange, &appLog); + } + catch (IException &e) { + FAIL() << "Failed for sethisrange=yes on file: " << e.toString().toStdString().c_str() << std::endl; + } + + // test setlrsrange + args = { "from=data/pds2isis/ab102401_cropped.img", + "to=" + cubeFileName, + "setlrsrange=yes", "lrsmin=96.0", "lrsmax=125.0"}; + UserInterface options_lrsrange(APP_XML, args); + try { + pds2isis(options_lrsrange, &appLog); + } + catch (IException &e) { + FAIL() << "Failed for setlrsrange=yes on file: " << e.toString().toStdString().c_str() << std::endl; + } + + // test setlisrange + args = { "from=data/pds2isis/ab102401_cropped.img", + "to=" + cubeFileName, + "setlisrange=yes", "lismin=65.0", "lismax=95.0"}; + UserInterface options_lisrange(APP_XML, args); + try { + pds2isis(options_lisrange, &appLog); + } + catch (IException &e) { + FAIL() << "Failed for setlisrange=yes on file: " << e.toString().toStdString().c_str() << std::endl; + } +} + +TEST(Pds2Isis, Pds2isisTestBIL) { + Pvl appLog; + QTemporaryDir prefix; + QVector args; + QString cubeFileName = "/home/tgiroux/Desktop/pds2isis_BIL_out.cub"; + + args = { "from=data/pds2isis/BILtestData_cropped.LBL", + "to=" + cubeFileName}; + UserInterface options(APP_XML, args); + try { + pds2isis(options, &appLog); + } + catch (IException &e) { + FAIL() << "Failed to ingest file: " << e.toString().toStdString().c_str() << std::endl; + } + + Cube outCube(cubeFileName); + Pvl *outLabel = outCube.label(); + + PvlGroup dimensions = outLabel->findGroup("Dimensions", Pvl::Traverse); + ASSERT_EQ((int)dimensions["Lines"], 1); + ASSERT_EQ((int)dimensions["Samples"], 304); + ASSERT_EQ((int)dimensions["Bands"], 1); +} + +TEST(Pds2Isis, Pds2isisTestBIP) { + Pvl appLog; + QTemporaryDir prefix; + QVector args; + QString cubeFileName = "/home/tgiroux/Desktop/pds2isis_BIP_out.cub"; + + args = { "from=data/pds2isis/BIPtestData_cropped.LBL", + "to=" + cubeFileName}; + UserInterface options(APP_XML, args); + try { + pds2isis(options, &appLog); + } + catch (IException &e) { + FAIL() << "Failed to ingest file: " << e.toString().toStdString().c_str() << std::endl; + } + + Cube outCube(cubeFileName); + Pvl *outLabel = outCube.label(); + + PvlGroup dimensions = outLabel->findGroup("Dimensions", Pvl::Traverse); + ASSERT_EQ((int)dimensions["Lines"], 1); + ASSERT_EQ((int)dimensions["Samples"], 304); + ASSERT_EQ((int)dimensions["Bands"], 1); +} + +TEST(Pds2Isis, Pds2isisTestNIMSQub) { + Pvl appLog; + QTemporaryDir prefix; + QVector args; + QString cubeFileName = "/home/tgiroux/Desktop/pds2isis_QUB_out.cub"; + + args = { "from=data/pds2isis/30i001ci_cropped.qub", + "to=" + cubeFileName}; + UserInterface options(APP_XML, args); + try { + pds2isis(options, &appLog); + } + catch (IException &e) { + FAIL() << "Failed to ingest file: " << e.toString().toStdString().c_str() << std::endl; + } + + Cube outCube(cubeFileName); + Pvl *outLabel = outCube.label(); + + PvlGroup dimensions = outLabel->findGroup("Dimensions", Pvl::Traverse); + ASSERT_EQ((int)dimensions["Lines"], 46); + ASSERT_EQ((int)dimensions["Samples"], 1); + ASSERT_EQ((int)dimensions["Bands"], 12); + + +} From 20f46666dfdc2c7daaf59706e252196934c0880d Mon Sep 17 00:00:00 2001 From: Tim Giroux Date: Tue, 24 Nov 2020 13:43:51 -0700 Subject: [PATCH 2/6] add cropped data --- isis/tests/FunctionalTestsPds2isis.cpp | 2 - isis/tests/data/pds2isis/30i001ci_cropped.qub | Bin 0 -> 9396 bytes .../data/pds2isis/BILtestData_cropped.LBL | 250 ++++++++++++++++++ .../data/pds2isis/BIPtestData_cropped.LBL | 250 ++++++++++++++++++ .../M3G20081118T222604_V02_RDN_cropped.IMG | Bin 0 -> 3125 bytes isis/tests/data/pds2isis/ab102401_cropped.img | 43 +++ isis/tests/data/pds2isis/ff17_cropped.img | 1 + isis/tests/data/pds2isis/ff17_cropped.lbl | 50 ++++ .../gaspra_nims_hires_radiance_cropped.fit | Bin 0 -> 28800 bytes .../gaspra_nims_hires_radiance_cropped.lbl | 151 +++++++++++ isis/tests/data/pds2isis/ldem_4_cropped.img | Bin 0 -> 5805 bytes 11 files changed, 745 insertions(+), 2 deletions(-) create mode 100644 isis/tests/data/pds2isis/30i001ci_cropped.qub create mode 100644 isis/tests/data/pds2isis/BILtestData_cropped.LBL create mode 100644 isis/tests/data/pds2isis/BIPtestData_cropped.LBL create mode 100644 isis/tests/data/pds2isis/M3G20081118T222604_V02_RDN_cropped.IMG create mode 100644 isis/tests/data/pds2isis/ab102401_cropped.img create mode 100644 isis/tests/data/pds2isis/ff17_cropped.img create mode 100644 isis/tests/data/pds2isis/ff17_cropped.lbl create mode 100644 isis/tests/data/pds2isis/gaspra_nims_hires_radiance_cropped.fit create mode 100644 isis/tests/data/pds2isis/gaspra_nims_hires_radiance_cropped.lbl create mode 100644 isis/tests/data/pds2isis/ldem_4_cropped.img diff --git a/isis/tests/FunctionalTestsPds2isis.cpp b/isis/tests/FunctionalTestsPds2isis.cpp index 52fd6e97d0..c79919a2a2 100644 --- a/isis/tests/FunctionalTestsPds2isis.cpp +++ b/isis/tests/FunctionalTestsPds2isis.cpp @@ -347,6 +347,4 @@ TEST(Pds2Isis, Pds2isisTestNIMSQub) { ASSERT_EQ((int)dimensions["Lines"], 46); ASSERT_EQ((int)dimensions["Samples"], 1); ASSERT_EQ((int)dimensions["Bands"], 12); - - } diff --git a/isis/tests/data/pds2isis/30i001ci_cropped.qub b/isis/tests/data/pds2isis/30i001ci_cropped.qub new file mode 100644 index 0000000000000000000000000000000000000000..5b2e153e8750dce63d0ca00832cdb8d7262ef1de GIT binary patch literal 9396 zcmeHMe{dYteK$5OMpzC|C#GOvEr>0!ZoR+mm-U{_>TXY3`)>Ex-IL`Xus%sATOgf` zBwH1Yiyd$?g~r4XLcov)W|%^L5+KE~1PMQE;*eo%T2cnW6bQw!iJeZ23uK_}_xpDD zv?ra3Gp+y0^ycQ??t7p2ec$)}{obWgc3NJY5#S@@4}3&pc|I%a86lsxC9g{mIm+3Y zbivK4En2p|&eBq*m3Ey~c@0J~dWV*FvzpQBv{lAhRymptgHcJUugmCJ&GjZ>pO~nx zW0b;ua(!K@O-rq?3ps#D2{|rH(WpPyc2ozKN@X?GsIR-WO}8D>S_M5qeVy5PU8!pr zp8ekXI<4I8dc6U*)lze=o>Nl%x)hBCudc1;@>$la2*5qZc^!cW z3Wlw>8XyJTaI{v<3L#o_2lpJFWT-i0qeV5+l?D7hoDZ~|RXAXnY|{&STqYJssrNN<1LtJOE+|89Y^>>yAdCu8Ts>1Xa zN4d@tmo}O>tJvLJEO(WfxPd{gC2eK6#+Kelx_1y1;W1;Cdivl6L02$Tk?R`h@9ZrX z5rBNKX(PSE8$#6BD;wx6^$m=0Flp29Ku=GYF%UyHH|R6K6*~tumpop5CqIO7r`s4tdx<3ekEkj*oWlQ4rY1a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(#y?L{w=&K(*0_RHI7`{QTQJzGB^ z+kO?sUrk=RKqSh>56BDKx6*NSHhpW>f04s)x6x&niS)YfzDQP%gz@-XM^|z)>8>@+ z^xoUL=NtNtfWX{@|RH&KnUKqc1#T|6_dF$z~ zI@i%7-51mA4tzwEJ02!S8*0(NYkc|}-x%Nh{*CmP5B1RvombJ@ht8(EJ~)duy;2L0 zecj`iUD7`O!C0Q|KhQ!~ch97KAHGM1-#Zz8##4)a_=B+{a~3y$R_E#ai>J|h?>}`Rgac1^s)+-`;vZ QS+-NBPc52HAMU98A3$!0F8}}l literal 0 HcmV?d00001 diff --git a/isis/tests/data/pds2isis/BILtestData_cropped.LBL b/isis/tests/data/pds2isis/BILtestData_cropped.LBL new file mode 100644 index 0000000000..682ee73864 --- /dev/null +++ b/isis/tests/data/pds2isis/BILtestData_cropped.LBL @@ -0,0 +1,250 @@ +PDS_VERSION_ID = PDS3 +LABEL_REVISION_NOTE = "2009-01-26, S. Lundeen, + 2011-01-07, S. Lundeen" +DATA_SET_ID = "CH1-ORB-L-M3-4-L1B-RADIANCE-V2.0" +PRODUCT_ID = "M3G20081118T222604_V02_RDN" +RECORD_TYPE = UNDEFINED + +MISSION_ID = "CH1" +MISSION_NAME = "CHANDRAYAAN-1" +INSTRUMENT_HOST_ID = "CH1-ORB" +INSTRUMENT_HOST_NAME = "CHANDRAYAAN-1 ORBITER" +INSTRUMENT_NAME = "MOON MINERALOGY MAPPER" +INSTRUMENT_ID = M3 +TARGET_NAME = "MOON" +TARGET_TYPE = "SATELLITE" +MISSION_PHASE_NAME = "PRIMARY MISSION" +PRODUCT_TYPE = CALIBRATED_IMAGE +PRODUCT_CREATION_TIME = 2010-12-23T07:32:00 +START_TIME = 2008-11-18T22:26:04 +STOP_TIME = 2008-11-18T22:28:04 +SPACECRAFT_CLOCK_START_COUNT = "2/599338.975" +SPACECRAFT_CLOCK_STOP_COUNT = "2/599459.153" +ORBIT_NUMBER = 00141 +PRODUCT_VERSION_TYPE = "ACTUAL" +PRODUCT_VERSION_ID = "2.0" +SOURCE_PRODUCT_ID = "M3G20081118T222604_V01_L0.IMG" + +PRODUCER_INSTITUTION_NAME = "JET PROPULSION LABORATORY" +SOFTWARE_NAME = "m3g_l1b_v04.exe" +SOFTWARE_VERSION_ID = "04" +DESCRIPTION = "M3 Level 1B data product which contains +pixel located, radiometrically-calibrated data." + +/* Calibrated Image Instrument and Observation Parameters */ + +SOLAR_DISTANCE = 0.988788923392 +INSTRUMENT_MODE_ID = "GLOBAL" +DETECTOR_TEMPERATURE = 160.71 +CH1:SWATH_WIDTH = 304 +CH1:SWATH_LENGTH = 1182 +CH1:SPACECRAFT_YAW_DIRECTION = "FORWARD" +CH1:ORBIT_LIMB_DIRECTION = "DESCENDING" +SPACECRAFT_ORIENTATION = (0.770443460000,-0.229314980000, + 0.000000000000) + +/* Spectral calibration parameters and radiometric gain factor data */ + +CH1:SPECTRAL_CALIBRATION_FILE_NAME = "M3G20081211_RDN_SPC.TAB" +CH1:RAD_GAIN_FACTOR_FILE_NAME = "M3G20081211_RDN_GAIN.TAB" +CH1:GLOBAL_BANDPASS_FILE_NAME = "M3G20081211_RDN_BPF.IMG" + +/* Description of Radiance-corrected image file */ + +^IMAGE = "M3G20081118T222604_V02_RDN_cropped.IMG" +OBJECT = IMAGE + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 3125 + FILE_RECORDS = 1 + + LINES = 1 + LINE_SAMPLES = 304 + SAMPLE_TYPE = PC_REAL + SAMPLE_BITS = 32 + UNIT = "W/(m^2 um sr)" + BANDS = 1 + BAND_STORAGE_TYPE = LINE_INTERLEAVED + LINE_DISPLAY_DIRECTION = DOWN + SAMPLE_DISPLAY_DIRECTION = RIGHT + +END_OBJECT = IMAGE +END + + +/* Description of Radiance-corrected header file */ + +OBJECT = RDN_HDR_FILE + ^RDN_ENVI_HEADER = "M3G20081118T222604_V02_RDN.HDR" + RECORD_TYPE = VARIABLE_LENGTH + FILE_RECORDS = 0 + + OBJECT = RDN_ENVI_HEADER + INTERCHANGE_FORMAT = "ASCII" + BYTES = 31502 + HEADER_TYPE = ENVI + DESCRIPTION = "Header file for compatibility with the commercial software + package ENVI." + END_OBJECT = RDN_ENVI_HEADER + +END_OBJECT = RDN_HDR_FILE + +/* Description of selenolocation data file */ + +OBJECT = LOC_FILE + ^LOC_IMAGE = "M3G20081118T222604_V02_LOC.IMG" + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 7296 + FILE_RECORDS = 0 + + OBJECT = LOC_IMAGE + LINES = 1182 /* (same as RDN image) */ + LINE_SAMPLES = 304 /* (same as RDN image) */ + SAMPLE_TYPE = PC_REAL + SAMPLE_BITS = 64 + BANDS = 0 + BAND_STORAGE_TYPE = LINE_INTERLEAVED + BAND_NAME = ("Longitude", + "Latitude", + "Radius") + LINE_DISPLAY_DIRECTION = DOWN + SAMPLE_DISPLAY_DIRECTION = RIGHT + END_OBJECT = LOC_IMAGE + +END_OBJECT = LOC_FILE + +/* Description of selenolocation header file */ + +OBJECT = LOC_HDR_FILE + ^LOC_ENVI_HEADER = "M3G20081118T222604_V02_LOC.HDR" + RECORD_TYPE = VARIABLE_LENGTH + FILE_RECORDS = 0 + + OBJECT = LOC_ENVI_HEADER + INTERCHANGE_FORMAT = "ASCII" + BYTES = 372 + HEADER_TYPE = ENVI + DESCRIPTION = "Header file for compatibility with the commercial + software package ENVI." + END_OBJECT = LOC_ENVI_HEADER + +END_OBJECT = LOC_HDR_FILE + +/* Description of observation geometry data file */ + +OBJECT = OBS_FILE + ^OBS_IMAGE = "M3G20081118T222604_V02_OBS.IMG" + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 12160 + FILE_RECORDS = 0 + + OBJECT = OBS_IMAGE + LINES = 1182 /* (same as RDN image) */ + LINE_SAMPLES = 304 /* (same as RDN image) */ + SAMPLE_TYPE = PC_REAL + SAMPLE_BITS = 32 + BANDS = 0 + BAND_STORAGE_TYPE = LINE_INTERLEAVED + BAND_NAME = ("To-Sun AZM", + "To-Sun Zenith", + "To-Inst AZM", + "To-Inst Zenith", + "Phase-angle", + "To-Sun Path Length", + "To-Inst Path Length", + "Facet Slope", + "Facet Aspect", + "Facet Cos i") + LINE_DISPLAY_DIRECTION = DOWN + SAMPLE_DISPLAY_DIRECTION = RIGHT + END_OBJECT = OBS_IMAGE + +END_OBJECT = OBS_FILE + +/* Description of observation geometry header file */ + +OBJECT = OBS_HDR_FILE + ^OBS_ENVI_HEADER = "M3G20081118T222604_V02_OBS.HDR" + RECORD_TYPE = VARIABLE_LENGTH + FILE_RECORDS = 0 + + OBJECT = OBS_ENVI_HEADER + INTERCHANGE_FORMAT = "ASCII" + BYTES = 707 + HEADER_TYPE = ENVI + DESCRIPTION = "Header file for compatibility with the commercial + software package ENVI." + END_OBJECT = OBS_ENVI_HEADER + +END_OBJECT = OBS_HDR_FILE + +/* Description of UTC timing data file */ + +OBJECT = UTC_FILE + ^UTC_TIME_TABLE = "M3G20081118T222604_V02_TIM.TAB" + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 57 + FILE_RECORDS = 0 /* (same as RDN image) */ + + OBJECT = UTC_TIME_TABLE + NAME = "UTC OBSERVATION TIMING DATA" + INTERCHANGE_FORMAT = "ASCII" + ROWS = 1182 /* (same as RDN image) */ + COLUMNS = 4 + ROW_BYTES = 57 + OBJECT = COLUMN + COLUMN_NUMBER = 1 + NAME = "LINE NUMBER" + DATA_TYPE = ASCII_INTEGER + START_BYTE = 1 + BYTES = 6 + FORMAT = "I6" + DESCRIPTION = "Record number for each RDN image line" + END_OBJECT = COLUMN + + OBJECT = COLUMN + COLUMN_NUMBER = 2 + NAME = "UTC_TIME" + DATA_TYPE = TIME + START_BYTE = 8 + BYTES = 26 + FORMAT = "A26" + DESCRIPTION = "UTC Time for the middle of the integration period + for each RDN image line expressed as + YYYY-MM-DDTHH:MM:SS.SSSSSS" + END_OBJECT = COLUMN + + OBJECT = COLUMN + COLUMN_NUMBER = 3 + NAME = "YEAR" + DATA_TYPE = CHARACTER + START_BYTE = 35 + BYTES = 4 + FORMAT = "I4" + DESCRIPTION = "Decimal Day of Year (DDOY) Year reference + extracted from the earliest time of each RDN + image line" + END_OBJECT = COLUMN + + OBJECT = COLUMN + COLUMN_NUMBER = 4 + NAME = "DDOY" + DATA_TYPE = DATE + START_BYTE = 40 + BYTES = 16 + FORMAT = "F16.12" + DESCRIPTION = "Decimal Day of Year represented as the number of + days elapsed since 00:00 UTC of January 1 of the + year associated with the time stamp of the first + line of the RDN image file. DDOY is expressed + using seventeen characters where 1-3 = three + characters that contain the integer number of + days; 4 = a decimal point; 5-16 = twelve charact- + ers after the decimal for the fractional part of + the day of year value." + END_OBJECT = COLUMN + + END_OBJECT = UTC_TIME_TABLE + +END_OBJECT = UTC_FILE + +END diff --git a/isis/tests/data/pds2isis/BIPtestData_cropped.LBL b/isis/tests/data/pds2isis/BIPtestData_cropped.LBL new file mode 100644 index 0000000000..47dc06cb49 --- /dev/null +++ b/isis/tests/data/pds2isis/BIPtestData_cropped.LBL @@ -0,0 +1,250 @@ +PDS_VERSION_ID = PDS3 +LABEL_REVISION_NOTE = "2009-01-26, S. Lundeen, + 2011-01-07, S. Lundeen" +DATA_SET_ID = "CH1-ORB-L-M3-4-L1B-RADIANCE-V2.0" +PRODUCT_ID = "M3G20081118T222604_V02_RDN" +RECORD_TYPE = UNDEFINED + +MISSION_ID = "CH1" +MISSION_NAME = "CHANDRAYAAN-1" +INSTRUMENT_HOST_ID = "CH1-ORB" +INSTRUMENT_HOST_NAME = "CHANDRAYAAN-1 ORBITER" +INSTRUMENT_NAME = "MOON MINERALOGY MAPPER" +INSTRUMENT_ID = M3 +TARGET_NAME = "MOON" +TARGET_TYPE = "SATELLITE" +MISSION_PHASE_NAME = "PRIMARY MISSION" +PRODUCT_TYPE = CALIBRATED_IMAGE +PRODUCT_CREATION_TIME = 2010-12-23T07:32:00 +START_TIME = 2008-11-18T22:26:04 +STOP_TIME = 2008-11-18T22:28:04 +SPACECRAFT_CLOCK_START_COUNT = "2/599338.975" +SPACECRAFT_CLOCK_STOP_COUNT = "2/599459.153" +ORBIT_NUMBER = 00141 +PRODUCT_VERSION_TYPE = "ACTUAL" +PRODUCT_VERSION_ID = "2.0" +SOURCE_PRODUCT_ID = "M3G20081118T222604_V01_L0.IMG" + +PRODUCER_INSTITUTION_NAME = "JET PROPULSION LABORATORY" +SOFTWARE_NAME = "m3g_l1b_v04.exe" +SOFTWARE_VERSION_ID = "04" +DESCRIPTION = "M3 Level 1B data product which contains +pixel located, radiometrically-calibrated data." + +/* Calibrated Image Instrument and Observation Parameters */ + +SOLAR_DISTANCE = 0.988788923392 +INSTRUMENT_MODE_ID = "GLOBAL" +DETECTOR_TEMPERATURE = 160.71 +CH1:SWATH_WIDTH = 304 +CH1:SWATH_LENGTH = 1182 +CH1:SPACECRAFT_YAW_DIRECTION = "FORWARD" +CH1:ORBIT_LIMB_DIRECTION = "DESCENDING" +SPACECRAFT_ORIENTATION = (0.770443460000,-0.229314980000, + 0.000000000000) + +/* Spectral calibration parameters and radiometric gain factor data */ + +CH1:SPECTRAL_CALIBRATION_FILE_NAME = "M3G20081211_RDN_SPC.TAB" +CH1:RAD_GAIN_FACTOR_FILE_NAME = "M3G20081211_RDN_GAIN.TAB" +CH1:GLOBAL_BANDPASS_FILE_NAME = "M3G20081211_RDN_BPF.IMG" + +/* Description of Radiance-corrected image file */ + +^IMAGE = "M3G20081118T222604_V02_RDN_cropped.IMG" +OBJECT = IMAGE + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 3125 + FILE_RECORDS = 1 + + LINES = 1 + LINE_SAMPLES = 304 + SAMPLE_TYPE = PC_REAL + SAMPLE_BITS = 32 + UNIT = "W/(m^2 um sr)" + BANDS = 1 + BAND_STORAGE_TYPE = SAMPLE_INTERLEAVED + LINE_DISPLAY_DIRECTION = DOWN + SAMPLE_DISPLAY_DIRECTION = RIGHT + +END_OBJECT = IMAGE +END + + +/* Description of Radiance-corrected header file */ + +OBJECT = RDN_HDR_FILE + ^RDN_ENVI_HEADER = "M3G20081118T222604_V02_RDN.HDR" + RECORD_TYPE = VARIABLE_LENGTH + FILE_RECORDS = 0 + + OBJECT = RDN_ENVI_HEADER + INTERCHANGE_FORMAT = "ASCII" + BYTES = 31502 + HEADER_TYPE = ENVI + DESCRIPTION = "Header file for compatibility with the commercial software + package ENVI." + END_OBJECT = RDN_ENVI_HEADER + +END_OBJECT = RDN_HDR_FILE + +/* Description of selenolocation data file */ + +OBJECT = LOC_FILE + ^LOC_IMAGE = "M3G20081118T222604_V02_LOC.IMG" + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 7296 + FILE_RECORDS = 0 + + OBJECT = LOC_IMAGE + LINES = 1182 /* (same as RDN image) */ + LINE_SAMPLES = 304 /* (same as RDN image) */ + SAMPLE_TYPE = PC_REAL + SAMPLE_BITS = 64 + BANDS = 0 + BAND_STORAGE_TYPE = SAMPLE_INTERLEAVED + BAND_NAME = ("Longitude", + "Latitude", + "Radius") + LINE_DISPLAY_DIRECTION = DOWN + SAMPLE_DISPLAY_DIRECTION = RIGHT + END_OBJECT = LOC_IMAGE + +END_OBJECT = LOC_FILE + +/* Description of selenolocation header file */ + +OBJECT = LOC_HDR_FILE + ^LOC_ENVI_HEADER = "M3G20081118T222604_V02_LOC.HDR" + RECORD_TYPE = VARIABLE_LENGTH + FILE_RECORDS = 0 + + OBJECT = LOC_ENVI_HEADER + INTERCHANGE_FORMAT = "ASCII" + BYTES = 372 + HEADER_TYPE = ENVI + DESCRIPTION = "Header file for compatibility with the commercial + software package ENVI." + END_OBJECT = LOC_ENVI_HEADER + +END_OBJECT = LOC_HDR_FILE + +/* Description of observation geometry data file */ + +OBJECT = OBS_FILE + ^OBS_IMAGE = "M3G20081118T222604_V02_OBS.IMG" + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 12160 + FILE_RECORDS = 0 + + OBJECT = OBS_IMAGE + LINES = 1182 /* (same as RDN image) */ + LINE_SAMPLES = 304 /* (same as RDN image) */ + SAMPLE_TYPE = PC_REAL + SAMPLE_BITS = 32 + BANDS = 10 + BAND_STORAGE_TYPE = SAMPLE_INTERLEAVED + BAND_NAME = ("To-Sun AZM", + "To-Sun Zenith", + "To-Inst AZM", + "To-Inst Zenith", + "Phase-angle", + "To-Sun Path Length", + "To-Inst Path Length", + "Facet Slope", + "Facet Aspect", + "Facet Cos i") + LINE_DISPLAY_DIRECTION = DOWN + SAMPLE_DISPLAY_DIRECTION = RIGHT + END_OBJECT = OBS_IMAGE + +END_OBJECT = OBS_FILE + +/* Description of observation geometry header file */ + +OBJECT = OBS_HDR_FILE + ^OBS_ENVI_HEADER = "M3G20081118T222604_V02_OBS.HDR" + RECORD_TYPE = VARIABLE_LENGTH + FILE_RECORDS = 0 + + OBJECT = OBS_ENVI_HEADER + INTERCHANGE_FORMAT = "ASCII" + BYTES = 707 + HEADER_TYPE = ENVI + DESCRIPTION = "Header file for compatibility with the commercial + software package ENVI." + END_OBJECT = OBS_ENVI_HEADER + +END_OBJECT = OBS_HDR_FILE + +/* Description of UTC timing data file */ + +OBJECT = UTC_FILE + ^UTC_TIME_TABLE = "M3G20081118T222604_V02_TIM.TAB" + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 57 + FILE_RECORDS = 0 /* (same as RDN image) */ + + OBJECT = UTC_TIME_TABLE + NAME = "UTC OBSERVATION TIMING DATA" + INTERCHANGE_FORMAT = "ASCII" + ROWS = 1182 /* (same as RDN image) */ + COLUMNS = 4 + ROW_BYTES = 57 + OBJECT = COLUMN + COLUMN_NUMBER = 1 + NAME = "LINE NUMBER" + DATA_TYPE = ASCII_INTEGER + START_BYTE = 1 + BYTES = 6 + FORMAT = "I6" + DESCRIPTION = "Record number for each RDN image line" + END_OBJECT = COLUMN + + OBJECT = COLUMN + COLUMN_NUMBER = 2 + NAME = "UTC_TIME" + DATA_TYPE = TIME + START_BYTE = 8 + BYTES = 26 + FORMAT = "A26" + DESCRIPTION = "UTC Time for the middle of the integration period + for each RDN image line expressed as + YYYY-MM-DDTHH:MM:SS.SSSSSS" + END_OBJECT = COLUMN + + OBJECT = COLUMN + COLUMN_NUMBER = 3 + NAME = "YEAR" + DATA_TYPE = CHARACTER + START_BYTE = 35 + BYTES = 4 + FORMAT = "I4" + DESCRIPTION = "Decimal Day of Year (DDOY) Year reference + extracted from the earliest time of each RDN + image line" + END_OBJECT = COLUMN + + OBJECT = COLUMN + COLUMN_NUMBER = 4 + NAME = "DDOY" + DATA_TYPE = DATE + START_BYTE = 40 + BYTES = 16 + FORMAT = "F16.12" + DESCRIPTION = "Decimal Day of Year represented as the number of + days elapsed since 00:00 UTC of January 1 of the + year associated with the time stamp of the first + line of the RDN image file. DDOY is expressed + using seventeen characters where 1-3 = three + characters that contain the integer number of + days; 4 = a decimal point; 5-16 = twelve charact- + ers after the decimal for the fractional part of + the day of year value." + END_OBJECT = COLUMN + + END_OBJECT = UTC_TIME_TABLE + +END_OBJECT = UTC_FILE + +END diff --git a/isis/tests/data/pds2isis/M3G20081118T222604_V02_RDN_cropped.IMG b/isis/tests/data/pds2isis/M3G20081118T222604_V02_RDN_cropped.IMG new file mode 100644 index 0000000000000000000000000000000000000000..4a20e7033d1da4aab345992c77fa54c5f3233279 GIT binary patch literal 3125 zcmaJ?dsGzX6<2!{4+^O^icuP;_RAU>h@l~VNw~#1?xcZ?+D~e*(dQ_4$N9{@Ki=#%P(rDa$U#NsCiJk{ub06Ws2fVgsFb(!Q&pIB2&TbM@4wv&N@-Koum3Uf29EcPe;< zP)>|n5uKpWdxDLiMTMH$$iRanqC#ox8bvxNQ3${*0;u{VsA8a1R94nt;tZTwW#bdf zTmnla^3WR9W&~?BQ0)T>C2(;GtVKu2?*9X@1_5s11zv#^RpTX@AE5;~dD-hysY2Y4 zSewmkwi<2mv6Ss)Fr{ySwZz(trdZm(fDoF?>qJ4JL?#OrIP|#Cls9$(c-0Hi%i(|& zF?1Md<2ahTeF;Jxhie?w7V03BeU98b&wZ>bmHqLCeaZDn3hqc%O zr)(F3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biNiQeZ3wo_N{}go5{H2t9^L8cr&h^+Z%U2 zGGI<&8kR<{g$COgY*pA5cNK3)<}I6($0k|uf+rGdbNOWJzve+?-6QA}Qwt-@w!&Y& z9f;Ado`KUHU&kM!? +SPACECRAFT_NAME = MARS_GLOBAL_SURVEYOR +MISSION_PHASE_NAME = AB-1 +TARGET_NAME = MARS +INSTRUMENT_ID = MOC-WA +PRODUCER_ID = MGS_MOC_TEAM +DATA_SET_ID = MGS-M-MOC-NA/WA-2-DSDP-L0-V1.0 +PRODUCT_CREATION_TIME = 1999-01-15T20:40:59 +SOFTWARE_NAME = "makepds 1.3" +UPLOAD_ID = moc_p024_v1.sasf +PRODUCT_ID = AB-1-024/01 +START_TIME = 1997-10-20T10:58:37.460000 +IMAGE_TIME = 1997-10-20T10:58:37.460000 +STOP_TIME = 1997-10-20T11:03:44.660000 +SPACECRAFT_CLOCK_START_COUNT = 561812335:32 +SPACECRAFT_CLOCK_STOP_COUNT = N/A +FOCAL_PLANE_TEMPERATURE = 213.1 +GAIN_MODE_ID = 1A +OFFSET_MODE_ID = "5" +LINE_EXPOSURE_DURATION = 100.0 +DOWNTRACK_SUMMING = 4 +CROSSTRACK_SUMMING = 4 +EDIT_MODE_ID = "672" +FILTER_NAME = RED +RATIONALE_DESC = "OLYMPUS MONS SPECIAL RED WIDE ANGLE" +Object = IMAGE + LINES = 5 + LINE_SAMPLES = 640 + LINE_PREFIX_BYTES = 0 + LINE_SUFFIX_BYTES = 0 + SAMPLE_TYPE = UNSIGNED_INTEGER + SAMPLE_BITS = 8 + SAMPLE_BIT_MASK = 255 + CHECKSUM = 65147507 +End_Object +End +₯€££’£‘  žž›šš˜œ™˜——–•””“””‘“’‘ŽŠŠ‰ˆ‡ˆ‡‡………„„„†ƒ‚‚€|}{{xzyx{wwxxxzyuuvuttvttrqrqqpqrrqqqpqrrnonooonmnmnnllkkjkhjjijkkkikhjliigghjhiighhgfffgeeefdhfeceefcbbacabbbcbbb^^________a__^`^^^___``_^_]^]]^^\]\]\\\Z[\[Z[[YZZWYZYZZXVVVWWVVVWYWVWWXUUUVVVWXYVUSUUTTSTUTUUUUVVTTSSSSSSSSUSSRRRRRQQQRSRQRPQQPPPPPQPPONNNOOOONNOOOONNNNNMNNNNLMMMMMLKKKKKKKKIIIIJJJJJJJJJKJJKIGHKHGHGGGGGGGFGGGFFGGGGGFFFGGGHGGGFGGEFDFEDDDCCCCBCCBCBA?@BBA@@@???>??????@??>>>>>===>=======>>>????978::::;9888899:9988:77767656653333223334343313333333332221000000000//0//0001110//.---,,,,+,+*)(('&&%%%%$$##!"!!!! €’£’’£ ž›œš™›˜˜——–”––”““‘‘‘’‘‘Ž‘ŒŠ‰‰‰‰†‡………„ƒƒ…‚‚}}}{|{xzzwywxwxvwxwvuuspttsuusoppqqpqrqrqqpppopoonlmlmmlnmlkkhkjikljljkijkihhhiihhgggfffffefeeedfddcdddcce`ba`abbb``]^^__]___^a_^]`]]^_]^^^^^_^^]]^^\^]]\\\[[[ZY[ZYZZXYXYZ[]XVX[ZWUVVWWVWWWVWUUVVVWXYZUSTWURTVUUUUUUUTTSSSSSSSRTSSSSSSSRQQRRQPQPPQPPQPPQPOONNOOOOOONOOOONONNNMNNMNLLMLLLKJKJKKKJKIIIIJIIIIIIIIJIIJIIJIIHHGHGGHGGGHGGFGGGFGGGFGGGGHHGFGFFEEDEDDCCCDCCCCCBBBA@@CBBA@@??@??>>?>??????>>>>>>>=>>==>=?>>?@@@@=;;=@?====<<<===>?@@?;9::;;;;;;=<:<:;:9998899::988888775455643333234444443122333223222111000000000/0000002210/.-.----,,,,+*)(('&&%%%$$$#"""!!!! €‘’’ £  žœœšš™š–˜˜˜—••–“”’‘‘‘‘Ž‹ŠˆŠ‰Š††††„„„ƒ„€€~}}}{{z|xyxuvtwxxwvxuututrssrtsssspppnrsrrqqpppoooommmmmmmmljjkgjkiijjjhijhiihhhijgfgggdeefeeeeeedeccccdcbabcccca``__a^^^^`___^_`_^^_^^^^]\]]\^a]][[\]\^^^]\\[\\\[[ZYZYYYYYYZ[YYWYYYWXXWWVWVWUWVVVVVWVWWVVVVUSVYWVVVVVVTTTSSSSTSSTRRRSSSSRRQRRQPQOPQPPPPPPOONOOPPPOOOOOOOONONMNMMNMMLLMLLKKJKJKKKKKIIIJJJJJIIJIIJIIJHHIHHHHGGGGGGGGHGGGGGGGGGGFGGGGIJIFEFFEEEFEDDCDDDDDCCBBBA@ACCBABA@?@@@???>????????????>>>>>>>>?>?????@???>?>=>======<>>>=>??=;;;<<<;;:::=<;::::9889:998978987544554333333344554313223322222111100000000000000002210/...-.--,,,,+*)(('&&&&%%%$#"""!!!! ’‘’Ÿ’’ Ÿžžœš™˜š—–———•–••‘’‘ŒŠ‰‰‰‰ˆ‡……„„€€€€}~~{y{xwxxvuuwvwyyzxuuusststrsrrtrppprsrrqrqpoopoonmnlmlklkjjkgjkiijjkghgijihihghjhghfeggededeheacbccdbaa```baaccaa``^^a__]_a`_`^]^`]^^_^\]]]]^\^]\\\Z]\]]\\\]]\[ZZYYYYZYYZZZYYX[[YXZZVTUVUVUWVVVVVVVVWVVVVVUVXWWWWVWVUTTSSTSTSSTRRRRRRRRRQRRRPQPQQOOPOPQOOONNOOPOOOONONNNNNMNMMNMMLLMLKKKJKJKKKKKJJIJJJJJIIJIIJIIIHHIHGGHGGGGFGFFHGGGGHHHHGGGHHGGGGGFGGHFGFGFEEEEEEDDCDCCBA@ACCCBCBAAAAA@@@?@@??????????@??????>@?>>??>>>>?>?>====>=>>==>=<===<<==<<<;;::9<;<::::98899::9987998643444444433334455422222221111111111011011000001012210//..-.--,,,++**((''&&&%%$###"""!!! ’ ‘Ÿ ‘ žžœš——›————–”“““’’ŽŠŠ‰ˆ‡‰ˆ‡†………ƒ€~~€~~~{zywsvvuwtvxw|zxuuuvvvyttuqrqrrsrqrtqqpqqpoopoonmmmmlllljkkgijiijhighhjklihfgggggfggiggeeeedeecabbfb``a``bbaaabbaa^^`_`^`__^`]\]`^]__^]]^^]^[Z[\[\\^\\[[[[]]\ZZZYZ[YYXYZ[ZYYXZZYZZZXWWWVVVWVVVVVVVWWVVVVWVWXWWWVWWWUUUTTTTSSSTRRRSRRSSRRRSRQQPQRQQPPPQPOOOOOOONOONOONNMNNMNMMMMMLLMLLLKJKKKKKKKJJJJKJJJIJJJIKIIIHHIHIHIHIIEEFFFGGGGGGHGHHHHJIIIHHGGFGGFGGHGFEEEFEEEEFEDDCABDCCBCBBABABAAAAAA@@@???@????>?????>?>?>?>>>>>?>?>>>==========<<;<<<<=<<;;;;::;;<;;::988889;;9898888644445456443334445332212111112222221211121000110122100/.....-,,,,++)(('''&&%%$$##"""!!!  \ No newline at end of file diff --git a/isis/tests/data/pds2isis/ff17_cropped.img b/isis/tests/data/pds2isis/ff17_cropped.img new file mode 100644 index 0000000000..4a9164fb45 --- /dev/null +++ b/isis/tests/data/pds2isis/ff17_cropped.img @@ -0,0 +1 @@ +UekgcgZR\jqocURbkjea\]]edN=]bbikbcaL@JddYTU^`]WPWSPaaWa_IT]`^\eolaa]_jlgciijeYTF\Q@?ShjbahmkeXjw}~tXTdbboi]^Zelvva +DATA_SET_ID = MGN-V-RDRS-5-MIDR-FULL-RES-V1.0 +SPACECRAFT_NAME = MAGELLAN +MISSION_PHASE_NAME = PRIMARY_MISSION +TARGET_NAME = VENUS +IMAGE_ID = "F-MIDR.30S325;301" +INSTRUMENT_NAME = "RADAR SYSTEM" +Object = IMAGE + LINES = 1 + LINE_SAMPLES = 1024 + SAMPLE_TYPE = UNSIGNED_INTEGER + SAMPLE_BITS = 8 + NOTE = "DN = INT((MIN(MAX(RV,-20),30) + 20) * 5) + 1, where RV = radar crossection/area divided by the Muhleman Law and converted to decibels. Muhleman Law multiplicative constant of 0.0118 was used. (Note: Intention was to use 0.0188.)" +End_Object +Object = IMAGE_MAP_PROJECTION_CATALOG + ^DATA_SET_MAP_PROJECT_CATALOG = DSMAPF.LBL + DATA_SET_ID = MGN-V-RDRS-5-MIDR-FULL-RES-V1.0 + IMAGE_ID = "F-MIDR.30S325;301" + MAP_PROJECTION_TYPE = SINUSOIDAL + MAP_RESOLUTION = 1407.4 + MAP_SCALE = 75 + MAXIMUM_LATITUDE = -28.9092 + MAXIMUM_LONGITUDE = 322.8903 + MINIMUM_LATITUDE = -29.6357 + MINIMUM_LONGITUDE = 322.0367 + X_AXIS_PROJECTION_OFFSET = -40708 + Y_AXIS_PROJECTION_OFFSET = 4096 + X_AXIS_FRAMELET_OFFSET = 3 + Y_AXIS_FRAMELET_OFFSET = 1 + A_AXIS_RADIUS = 6051.92 + B_AXIS_RADIUS = 6051.92 + C_AXIS_RADIUS = 6051.92 + FIRST_STANDARD_PARALLEL = 0.0 + SECOND_STANDARD_PARALLEL = N/A + POSITIVE_LONGITUDE_DIRECTION = EAST + CENTER_LATITUDE = 0.0 + CENTER_LONGITUDE = 325.3829 + REFERENCE_LATITUDE = N/A + REFERENCE_LONGITUDE = N/A + X_AXIS_FIRST_PIXEL = 1 + Y_AXIS_FIRST_PIXEL = 1 + X_AXIS_LAST_PIXEL = 1024 + Y_AXIS_LAST_PIXEL = 1024 + MAP_PROJECTION_ROTATION = 0.0 +End_Object +End diff --git a/isis/tests/data/pds2isis/gaspra_nims_hires_radiance_cropped.fit b/isis/tests/data/pds2isis/gaspra_nims_hires_radiance_cropped.fit new file mode 100644 index 0000000000000000000000000000000000000000..49ae6384fae80f38a7d28fb60ed7b301a4eb60d5 GIT binary patch literal 28800 zcmeHPU5F%C6<#oJl1Na5=mxH?IiYz`z{6Rzlfhg>QQ6Z3h2I=%LmXp9AT$;o)~;^Fa>4MWjNlku2wc)U`< zfNVj$xr8JqVp1lS$jl9K;;iUerVsS9b)(4Ui*Us%l~}2C9M{~!bqca**D{;1Y^+$V zR20qVch0Z2tZVjG%VKKV+_9M9njNp}xIWYOJ>O~{XPAnn&uou1t!=wwHJROEa|O?L zosQGqAK^icvY@-WyYJZzZ|)S^b6UN&#gdDeQ>=^d$#m`!wqI(HVMBL9qCd?sdX@NC!KgJ*BMP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>G!c zvWx1cc~P357iAaKPxJGwSDp$B-%o8`(;VujHfg?}+PvoNr;U^SteWu1p4z<5fB8ed zokeKgEVc*P{I_rpddA(1kzdpF@>i78C}hXCsh`)g+VS&dZS(kidsdwM2R2?rA^Rmg z^FUarpLCQxKOV*i-;*8nQ9DZWcKq}Cc{EP*s7;#sNz?rN{qmm!X+8Z?9%O0pEUq59JbR)X~-8m9Ejb*BU@ z{vJ8364!k0vvqe$PppH!RO!nun^$jJ72va1UUFb`iv0Z z;2#fJLLRanefN9jg#ZUf|6LOT9K@HuD+D+w9J?U|IM7#b3jq$Sk3TB}IJo+$*MtBE z*MGSp1UUHOAATwXIQaTse<%bv_{JM2g}ia{Ui-VPh*vNm7!VAI`VIO&@u1)Nzh8F` z)NiP?}hxUU%Ouj zaPZvke=Gzz*nHoz5a8gwFExb#2k?6vLV$xWJ^!+h=U-mF`InChK@N^SBjo5aOFw&m iQwVVIgP;FK2ypPLTMr7k^`Q7mu3$hgAQ-sU82As_)6X*i literal 0 HcmV?d00001 diff --git a/isis/tests/data/pds2isis/gaspra_nims_hires_radiance_cropped.lbl b/isis/tests/data/pds2isis/gaspra_nims_hires_radiance_cropped.lbl new file mode 100644 index 0000000000..5d0655b1fd --- /dev/null +++ b/isis/tests/data/pds2isis/gaspra_nims_hires_radiance_cropped.lbl @@ -0,0 +1,151 @@ +PDS_VERSION_ID = PDS3 +DD_VERSION_ID = "PDSCAT1R82" +LABEL_REVISION_NOTE = "LABEL VERSION 0" + +/* File Characteristics */ +RECORD_TYPE = FIXED_LENGTH +RECORD_BYTES = 2880 +FILE_RECORDS = 10 + +/* Pointers to Data Objects */ +^HEADER = "gaspra_nims_hires_radiance_cropped.fit" +^SPECTRAL_QUBE = ("gaspra_nims_hires_radiance_cropped.fit", 3) + +/* Identification Data Elements */ +DATA_SET_ID = "GO-A-NIMS-4-GASPRACUBE-V1.0" +PRODUCT_ID = "GASPRA-HIRES-NIMS-RAD" +PRODUCT_NAME = "GASPRA-HIRES-NIMS-RAD" +INSTRUMENT_HOST_NAME = "GALILEO ORBITER" +INSTRUMENT_NAME = "NEAR INFRARED MAPPING SPECTROMETER" +INSTRUMENT_ID = "NIMS" +TARGET_NAME = "951 GASPRA" +START_TIME = 1991-10-29T22:20:56 +STOP_TIME = 1991-10-29T22:28:15 +START_JULIAN_DATE_VALUE = 2448559.4312 +STOP_JULIAN_DATE_VALUE = 2448559.4362 +SPACECRAFT_CLOCK_START_COUNT = "1073178.04.0" +SPACECRAFT_CLOCK_STOP_COUNT = "1073185.25.0" +PRODUCT_CREATION_TIME = 2012-07-20T07:30:00 +PRODUCT_TYPE = "GEOMED_CALIBRATED_IMAGE" + +/* Descriptive Data Elements */ +SPICE_FILE_NAME = ("s970311a.bsp", + "naif0008.tls", + "mips010314.tpc", + "mk00062a.tsc") +MISSION_NAME = "GALILEO" +MISSION_PHASE_NAME = "GASPRA ENCOUNTER" +OBSERVATION_TYPE = "NIMS FIXED MAP" +OBSERVATION_ID = "GAPNGASPAT01" +TARGET_CENTER_DISTANCE = 4376.69 +TARGET_HELIOCENTRIC_DISTANCE = 329616030.0 +SC_SUN_POSITION_VECTOR = +(-76005976.0, 3.2051194e+008, -11761397.0) +TARGET_SUN_POSITION_VECTOR = +(-76001854.0, 3.2051851e+008, -11761393.0) +TARGET_GEOCENTRIC_DISTANCE = 410618250.0 +SC_EARTH_POSITION_VECTOR = +(44028901.0, 4.0807449e+008, -11759634.0) +EARTH_TARGET_POSITION_VECTOR = +(-44033022.0, -4.0808106e+008, 11759631.0) +HORIZONTAL_PIXEL_SCALE = 1285.2 +VERTICAL_PIXEL_SCALE = 1285.2 +PHASE_ANGLE = 49.07 +PROCESSING_HISTORY_TEXT = "This data is derived from DN values + in PDS file GAP016TN.QUB and calibrated with values from + the PDS file G1GNGLOBAL01A_MSY04.IOF" + +/* Data Object Definitions */ +OBJECT = HEADER + BYTES = 5760 + HEADER_TYPE = "FITS" + INTERCHANGE_FORMAT = "BINARY" + RECORDS = 2 + DESCRIPTION = "FITS format defined in + NASA/Science Office Standards Technology 100-1.0" +END_OBJECT = HEADER + +OBJECT = SPECTRAL_QUBE + AXES = 3 + AXIS_NAME = (SAMPLE, LINE, BAND) + ISIS_STRUCTURE_VERSION = "2.1" + /* Core Description */ + CORE_ITEMS = (1, 66, 17) + CORE_NAME = "CALIBRATED SPECTRAL RADIANCE" + CORE_ITEM_BYTES = 4 + CORE_ITEM_TYPE = IEEE_REAL + CORE_BASE = 0.000000 + CORE_MULTIPLIER = 1.000000 + CORE_UNIT = "uWATT*CM**-2*SR**-1*uM**-1" + CORE_NULL = -1.0 + CORE_VALID_MINIMUM = 0.0 + CORE_LOW_REPR_SATURATION = -32767.0 + CORE_LOW_INSTR_SATURATION = -32766.0 + CORE_HIGH_REPR_SATURATION = -32765.0 + CORE_HIGH_INSTR_SATURATION = -32764.0 + + SUFFIX_ITEMS = (0,0,0) + SUFFIX_BYTES = 4 + + GROUP = BAND_BIN + BANDS = 17 + BAND_BIN_UNIT = MICROMETER + BAND_BIN_FILTER_NUMBER = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17) + BAND_BIN_BAND_NUMBER = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17) + BAND_BIN_CENTER = (0.7360, 0.8750, 1.0546, 1.3326, 1.6110, 1.8914, 2.1728, + 2.4529, 2.7382, 3.0178, 3.3012, 3.5839, 3.8670, 4.1503, 4.4343, 4.7164, + 4.9988) + BAND_BIN_WIDTH = (0.0125, 0.0125, 0.0250, 0.0250, 0.0250, 0.0250, 0.0250, + 0.0250, 0.0250, 0.0250, 0.0250, 0.0250, 0.0250, 0.0250, 0.0250, 0.0250, + 0.0250) + BAND_BIN_BASE = (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) + BAND_BIN_MULTIPLIER = (1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0) + END_GROUP = BAND_BIN +END_OBJECT = SPECTRAL_QUBE + +OBJECT = EXTENSION_WAVELENGTH_HEADER + BYTES = 43200 + HEADER_TYPE = "FITS" + INTERCHANGE_FORMAT = "BINARY" + RECORDS = 15 + DESCRIPTION = "This extension contains + the wavelength values, per pixel, for the image array." +END_OBJECT = EXTENSION_WAVELENGTH_HEADER + +OBJECT = EXTENSION_WAVELENGTH_IMAGE + LINE_SAMPLES = 66 + LINES = 1 + BANDS = 17 + SAMPLE_BITS = 32 + SAMPLE_TYPE = "IEEE_REAL" + LINE_DISPLAY_DIRECTION = "UP" + SAMPLE_DISPLAY_DIRECTION = "RIGHT" + UNIT = "MICROMETERS" +END_OBJECT = EXTENSION_WAVELENGTH_IMAGE + +OBJECT = EXTENSION_ERROR_HEADER + BYTES = 43200 + HEADER_TYPE = "FITS" + INTERCHANGE_FORMAT = "BINARY" + RECORDS = 15 + DESCRIPTION = "This extension contains + the radiance precision values, per pixel, for the image + array." +END_OBJECT = EXTENSION_ERROR_HEADER + +OBJECT = EXTENSION_ERROR_IMAGE + LINE_SAMPLES = 66 + LINES = 1 + BANDS = 17 + SAMPLE_BITS = 32 + SAMPLE_TYPE = "IEEE_REAL" + LINE_DISPLAY_DIRECTION = "UP" + SAMPLE_DISPLAY_DIRECTION = "RIGHT" + UNIT = "uWATT*CM**-2*SR**-1*uM**-1" +END_OBJECT = EXTENSION_ERROR_IMAGE + +END diff --git a/isis/tests/data/pds2isis/ldem_4_cropped.img b/isis/tests/data/pds2isis/ldem_4_cropped.img new file mode 100644 index 0000000000000000000000000000000000000000..ceee1300a129a594c7703f84fd00dc3bf09841e0 GIT binary patch literal 5805 zcmaJ@34B!5)xY0EOzUr0xiHn0O`|1y3eJ%#6@sEzt`<^dfLdBW@dz(fl~OVMOm-k z@5{^x0vHOL8p7fnyS*sOUXbO;4LJ(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({K)ym(0m2{7tunxgYKcV^Z?d6T95S@{SH;|IBlli!rpDP zot~%H=q-Ae-o*ZhP7p)?6v*vyYyx`XaMq0xeAO8q>&&_!^Uu(?s16119ix+Ui2hCo z;J+R83~j}kn^0++=n>T49q?TY{+MZbC4_2o(^OP#5Z|)_ufu9YmCnPe!%oo>S^%Hk z3Eul@4Wh6fv3Lmoo2+_WM?Z%pcjN3|(rP?^M?2|dNPZnU`~!L)!SnC*PdW^358?Z3 zSfa46U_CJvy0Z~%G_v4EmWwGf8q=W&_3UCZVPzlI85CKtbqH+j0*f>8-4i^$url%8 z6%<`r4?w=ftTE@&Wvn+QLw~HxFeSRdGiOO+HADJeF)7}G4xgZ#ybXQ+NguHBHND1`PF_eQ2ISTzU8` z{7jyZf01v>=j2woPTnI|$Xn!mIZIBLAz6X>rpt+Pk}Q&Wa=08QuavzclV^;tFw;IW zju;;r?_s@aJa4>WJZC&(Y&W(UFB?xAFBpHs|DW)`&3GNyy~aDnVdHO@gC~qrczy}~ z(?+vFhBPu|XW0X*x9o>WIz|>q7iMaOtduvD*|HAisEdTF9{P$wNhUZ>-1Nrejvf~JyqOUM< zI5Mmc@~R&jifpuF(&XbFRD?Yi^*9N+dOhaO6!bG6ZZ%;xhgIW-(}0e*oc)}wX6x9) z?6+(SdkSkO)^7GDI^sdhn@`apPqTlsPP_;2%ZFf&jN$ow9Og&te=Z)A+*vrtL?*ncNU(WC3oA{&r3H~eo8~zY~fN$Vi z`9|RGMOWVd$XZ|@;H&r&-pFr8KacZSd@lAZ?nZA9@^W6lM{+xKxCS#XlXu7T>x91k z89T-fuy@hfUt-U(XV_M@iEU(?*`sU&TaW!9Tg&c)-4C$`*c!Hy-HWvxYb{%W=VEvz zj;VZ$wUz;Lt3|z Date: Fri, 27 Nov 2020 13:19:48 -0700 Subject: [PATCH 3/6] test DN's and remove accidental paths --- isis/tests/FunctionalTestsPds2isis.cpp | 100 ++++++++++++++++-- .../gaspra_nims_hires_radiance_cropped.fit | Bin 28800 -> 28800 bytes .../gaspra_nims_hires_radiance_cropped.lbl | 14 +-- 3 files changed, 100 insertions(+), 14 deletions(-) diff --git a/isis/tests/FunctionalTestsPds2isis.cpp b/isis/tests/FunctionalTestsPds2isis.cpp index c79919a2a2..4a65f9f64b 100644 --- a/isis/tests/FunctionalTestsPds2isis.cpp +++ b/isis/tests/FunctionalTestsPds2isis.cpp @@ -5,6 +5,7 @@ #include "Pvl.h" #include "PvlGroup.h" #include "TestUtilities.h" +#include "Histogram.h" #include "gtest/gtest.h" @@ -48,13 +49,27 @@ TEST(Pds2Isis, Pds2isisTestDefault) { ASSERT_EQ(archive["TargetName"][0].toStdString(), "MARS"); ASSERT_EQ(archive["MissionPhaseName"][0].toStdString(), "AB-1"); ASSERT_EQ(archive["RationaleDescription"][0].toStdString(), "OLYMPUS MONS SPECIAL RED WIDE ANGLE"); + + + std::unique_ptr hist (outCube.histogram()); + + std::cout << hist->Average() << std::endl; + std::cout << hist->Sum() << std::endl; + std::cout << hist->ValidPixels() << std::endl; + std::cout << hist->StandardDeviation() << std::endl; + + ASSERT_NEAR(hist->Average(), 81.5828125, .00001); + ASSERT_EQ(hist->Sum(), 261065); + ASSERT_EQ(hist->ValidPixels(), 3200); + ASSERT_NEAR(hist->StandardDeviation(), 30.5674, .0001); } TEST(Pds2Isis, Pds2isisTestBandBin) { Pvl appLog; QTemporaryDir prefix; - QString cubeFileName = prefix.path() + "/pds2isis_out.cub"; + // QString cubeFileName = prefix.path() + "/pds2isis_out.cub"; + QString cubeFileName = "/home/tgiroux/Desktop/pds2isis_bandbin_out.cub"; QVector args = { "from=data/pds2isis/gaspra_nims_hires_radiance_cropped.lbl", "to=" + cubeFileName }; UserInterface options(APP_XML, args); @@ -70,9 +85,9 @@ TEST(Pds2Isis, Pds2isisTestBandBin) { Pvl *outLabel = outCube.label(); PvlGroup dimensions = outLabel->findGroup("Dimensions", Pvl::Traverse); - ASSERT_EQ((int)dimensions["Samples"], 1); - ASSERT_EQ((int)dimensions["Lines"], 66); - ASSERT_EQ((int)dimensions["Bands"], 17); + ASSERT_EQ((int)dimensions["Samples"], 100); + ASSERT_EQ((int)dimensions["Lines"], 3); + ASSERT_EQ((int)dimensions["Bands"], 3); bool ok = false; PvlGroup bandbin = outLabel->findGroup("BandBin", Pvl::Traverse); @@ -129,6 +144,18 @@ TEST(Pds2Isis, Pds2isisTestBandBin) { ASSERT_EQ(bandbin["FilterNumber"][14].toInt(&ok, 10), 15); ASSERT_EQ(bandbin["FilterNumber"][15].toInt(&ok, 10), 16); ASSERT_EQ(bandbin["FilterNumber"][16].toInt(&ok, 10), 17); + + std::unique_ptr hist (outCube.histogram(0)); + + std::cout << hist->Average() << std::endl; + std::cout << hist->Sum() << std::endl; + std::cout << hist->ValidPixels() << std::endl; + std::cout << hist->StandardDeviation() << std::endl; + + ASSERT_NEAR(hist->Average(), 0.205984, 1e-3); + ASSERT_NEAR(hist->Sum(), 185.386, 1e-3); + ASSERT_EQ(hist->ValidPixels(), 900); + ASSERT_NEAR(hist->StandardDeviation(), 0.606295, 1e-3); } @@ -168,6 +195,17 @@ TEST(Pds2Isis, Pds2isisTestOffset) { ASSERT_EQ((double)mapping["PixelResolution"], 7580.84); ASSERT_EQ((double)mapping["Scale"], 4.0); + std::unique_ptr hist (outCube.histogram()); + + std::cout << hist->Average() << std::endl; + std::cout << hist->Sum() << std::endl; + std::cout << hist->ValidPixels() << std::endl; + std::cout << hist->StandardDeviation() << std::endl; + + ASSERT_NEAR(hist->Average(), 1.7375e+06, 10); + ASSERT_NEAR(hist->Sum(), 2.50026e+09, 1e3); + ASSERT_EQ(hist->ValidPixels(), 1439); + ASSERT_NEAR(hist->StandardDeviation(), 9187.96, .0001); } TEST(Pds2Isis, Pds2isisTestProjection) { @@ -205,6 +243,18 @@ TEST(Pds2Isis, Pds2isisTestProjection) { ASSERT_EQ((double)mapping["UpperLeftCornerY"], -3053025.0); ASSERT_EQ((double)mapping["PixelResolution"], 75.0); ASSERT_EQ((double)mapping["Scale"], 1407.4); + + std::unique_ptr hist (outCube.histogram()); + + std::cout << hist->Average() << std::endl; + std::cout << hist->Sum() << std::endl; + std::cout << hist->ValidPixels() << std::endl; + std::cout << hist->StandardDeviation() << std::endl; + + ASSERT_NEAR(hist->Average(), 67.7978515625, .00001); + ASSERT_EQ(hist->Sum(), 69425); + ASSERT_EQ(hist->ValidPixels(), 1024); + ASSERT_NEAR(hist->StandardDeviation(), 26.0079, .0001); } TEST(Pds2Isis, Pds2isisTestSpecialPixels) { @@ -278,7 +328,7 @@ TEST(Pds2Isis, Pds2isisTestBIL) { Pvl appLog; QTemporaryDir prefix; QVector args; - QString cubeFileName = "/home/tgiroux/Desktop/pds2isis_BIL_out.cub"; + QString cubeFileName = prefix.path() + "/pds2isis_BIL_out.cub"; args = { "from=data/pds2isis/BILtestData_cropped.LBL", "to=" + cubeFileName}; @@ -297,13 +347,25 @@ TEST(Pds2Isis, Pds2isisTestBIL) { ASSERT_EQ((int)dimensions["Lines"], 1); ASSERT_EQ((int)dimensions["Samples"], 304); ASSERT_EQ((int)dimensions["Bands"], 1); + + std::unique_ptr hist (outCube.histogram()); + + std::cout << hist->Average() << std::endl; + std::cout << hist->Sum() << std::endl; + std::cout << hist->ValidPixels() << std::endl; + std::cout << hist->StandardDeviation() << std::endl; + + ASSERT_NEAR(hist->Average(), 6.35692e+31, 1e25); + ASSERT_NEAR(hist->Sum(), 1.9325e+34, 1e29); + ASSERT_EQ(hist->ValidPixels(), 304); + ASSERT_NEAR(hist->StandardDeviation(), 1.08618e+33, 1e28); } TEST(Pds2Isis, Pds2isisTestBIP) { Pvl appLog; QTemporaryDir prefix; QVector args; - QString cubeFileName = "/home/tgiroux/Desktop/pds2isis_BIP_out.cub"; + QString cubeFileName = prefix.path() + "/pds2isis_BIP_out.cub"; args = { "from=data/pds2isis/BIPtestData_cropped.LBL", "to=" + cubeFileName}; @@ -322,13 +384,25 @@ TEST(Pds2Isis, Pds2isisTestBIP) { ASSERT_EQ((int)dimensions["Lines"], 1); ASSERT_EQ((int)dimensions["Samples"], 304); ASSERT_EQ((int)dimensions["Bands"], 1); + + std::unique_ptr hist (outCube.histogram()); + + std::cout << hist->Average() << std::endl; + std::cout << hist->Sum() << std::endl; + std::cout << hist->ValidPixels() << std::endl; + std::cout << hist->StandardDeviation() << std::endl; + + ASSERT_NEAR(hist->Average(), 6.35692e+31, 1e25); + ASSERT_NEAR(hist->Sum(), 1.9325e+34, 1e29); + ASSERT_EQ(hist->ValidPixels(), 304); + ASSERT_NEAR(hist->StandardDeviation(), 1.08618e+33, 1e28); } TEST(Pds2Isis, Pds2isisTestNIMSQub) { Pvl appLog; QTemporaryDir prefix; QVector args; - QString cubeFileName = "/home/tgiroux/Desktop/pds2isis_QUB_out.cub"; + QString cubeFileName = prefix.path() + "/pds2isis_QUB_out.cub"; args = { "from=data/pds2isis/30i001ci_cropped.qub", "to=" + cubeFileName}; @@ -347,4 +421,16 @@ TEST(Pds2Isis, Pds2isisTestNIMSQub) { ASSERT_EQ((int)dimensions["Lines"], 46); ASSERT_EQ((int)dimensions["Samples"], 1); ASSERT_EQ((int)dimensions["Bands"], 12); + + std::unique_ptr hist (outCube.histogram()); + + std::cout << hist->Average() << std::endl; + std::cout << hist->Sum() << std::endl; + std::cout << hist->ValidPixels() << std::endl; + std::cout << hist->StandardDeviation() << std::endl; + + ASSERT_NEAR(hist->Average(), 1.64693e+30, 1e25); + ASSERT_NEAR(hist->Sum(), 7.57588e+31, 1e26); + ASSERT_EQ(hist->ValidPixels(), 46); + ASSERT_NEAR(hist->StandardDeviation(), 1.117e+31, 1e26); } diff --git a/isis/tests/data/pds2isis/gaspra_nims_hires_radiance_cropped.fit b/isis/tests/data/pds2isis/gaspra_nims_hires_radiance_cropped.fit index 49ae6384fae80f38a7d28fb60ed7b301a4eb60d5..22c9123d04a765b28ba2e41a315a6df3e5e5b503 100644 GIT binary patch delta 481 zcmZp8$k_0ZaRWCav!Q{(N94dDoL&uXF#caR|dL$h{Gz+pWDj74mM=}CxhXj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?vYD{~9>yCB0?x`(W)$#Dc;OWu;9`1&&2+99p$ht&N^@D#m1jz5qkbK z+i7;w#tEOdTmF0VT_`j@tEPE89zUPPmmm1tb0~b9@27FnG)|iDKWv-FiJCuae-s|g zC%yE_{?jOLwM{tFG(Csc{Jf}f>gVm>YMXHHR_DLz%%kx0`TnRj^^@jtsJ;A=Z@rE} zZPJIG7iFK1efvi!ggZ@7vyU2IzIA;EWg0#|9)-u-QJc4?Hm}K^^dtY=cs4A2Keb7R zZSkJ^^NHVGLm9SjY`m5SiLxiVsByxhak8g=zRlawIB6P>(qu<^>5sqOoJDy1X>G!c zvWx1cc~P357iAaKPxJGwSDp$B-%o8`(;VujHfg?}+PvoNr;U^SteWu1p4z<5fB8ed zokeKgEVc*P{I_rpddA(1kzdpF@>i78C}hXCsh`)g+VS&dZS(kidsdwM2R2?rA^Rmg z^FUarpLCQxKOV*i-;*8nQ9DZWcKq}Cc{EP*s7;#sNz?rN{qmm!X+8Z?9%O0pEUq59JbR)X~-8m9Ejb*BU@ z{vJ8364!k0vvqe$PppH!RO!nun^$jJ72va1UUFb`iv0Z z;2#fJLLRanefN9jg#ZUf|6LOT9K@HuD+D+w9J?U|IM7#b3jq$Sk3TB}IJo+$*MtBE z*MGSp1UUHOAATwXIQaTse<%bv_{JM2g}ia{Ui-VPh*vNm7!VAI`VIO&@u1)Nzh8F` z)NiP?}hxUU%Ouj zaPZvke=Gzz*nHoz5a8gwFExb#2k?6vLV$xWJ^!+h=U-mF`InChK@N^SBjo5aOFw&m iQwVVIgP;FK2ypPLTMr7k^`Q7mu3$hgAQ-sU82As_)6X*i diff --git a/isis/tests/data/pds2isis/gaspra_nims_hires_radiance_cropped.lbl b/isis/tests/data/pds2isis/gaspra_nims_hires_radiance_cropped.lbl index 5d0655b1fd..7ed01020dd 100644 --- a/isis/tests/data/pds2isis/gaspra_nims_hires_radiance_cropped.lbl +++ b/isis/tests/data/pds2isis/gaspra_nims_hires_radiance_cropped.lbl @@ -1,4 +1,4 @@ -PDS_VERSION_ID = PDS3 +pDS_VERSION_ID = PDS3 DD_VERSION_ID = "PDSCAT1R82" LABEL_REVISION_NOTE = "LABEL VERSION 0" @@ -9,7 +9,7 @@ FILE_RECORDS = 10 /* Pointers to Data Objects */ ^HEADER = "gaspra_nims_hires_radiance_cropped.fit" -^SPECTRAL_QUBE = ("gaspra_nims_hires_radiance_cropped.fit", 3) +^SPECTRAL_QUBE = ("gaspra_nims_hires_radiance_cropped.fit",3) /* Identification Data Elements */ DATA_SET_ID = "GO-A-NIMS-4-GASPRACUBE-V1.0" @@ -70,7 +70,7 @@ OBJECT = SPECTRAL_QUBE AXIS_NAME = (SAMPLE, LINE, BAND) ISIS_STRUCTURE_VERSION = "2.1" /* Core Description */ - CORE_ITEMS = (1, 66, 17) + CORE_ITEMS = (100, 3, 3) CORE_NAME = "CALIBRATED SPECTRAL RADIANCE" CORE_ITEM_BYTES = 4 CORE_ITEM_TYPE = IEEE_REAL @@ -117,8 +117,8 @@ OBJECT = EXTENSION_WAVELENGTH_HEADER END_OBJECT = EXTENSION_WAVELENGTH_HEADER OBJECT = EXTENSION_WAVELENGTH_IMAGE - LINE_SAMPLES = 66 - LINES = 1 + LINE_SAMPLES = 100 + LINES = 66 BANDS = 17 SAMPLE_BITS = 32 SAMPLE_TYPE = "IEEE_REAL" @@ -138,8 +138,8 @@ OBJECT = EXTENSION_ERROR_HEADER END_OBJECT = EXTENSION_ERROR_HEADER OBJECT = EXTENSION_ERROR_IMAGE - LINE_SAMPLES = 66 - LINES = 1 + LINE_SAMPLES = 100 + LINES = 66 BANDS = 17 SAMPLE_BITS = 32 SAMPLE_TYPE = "IEEE_REAL" From cc99ab73945f59aa6a306fd4cb14f8b3e6a21054 Mon Sep 17 00:00:00 2001 From: Tim Giroux Date: Fri, 27 Nov 2020 13:23:05 -0700 Subject: [PATCH 4/6] remove accidental prints --- isis/tests/FunctionalTestsPds2isis.cpp | 42 -------------------------- 1 file changed, 42 deletions(-) diff --git a/isis/tests/FunctionalTestsPds2isis.cpp b/isis/tests/FunctionalTestsPds2isis.cpp index 4a65f9f64b..2320d5543c 100644 --- a/isis/tests/FunctionalTestsPds2isis.cpp +++ b/isis/tests/FunctionalTestsPds2isis.cpp @@ -52,12 +52,6 @@ TEST(Pds2Isis, Pds2isisTestDefault) { std::unique_ptr hist (outCube.histogram()); - - std::cout << hist->Average() << std::endl; - std::cout << hist->Sum() << std::endl; - std::cout << hist->ValidPixels() << std::endl; - std::cout << hist->StandardDeviation() << std::endl; - ASSERT_NEAR(hist->Average(), 81.5828125, .00001); ASSERT_EQ(hist->Sum(), 261065); ASSERT_EQ(hist->ValidPixels(), 3200); @@ -146,12 +140,6 @@ TEST(Pds2Isis, Pds2isisTestBandBin) { ASSERT_EQ(bandbin["FilterNumber"][16].toInt(&ok, 10), 17); std::unique_ptr hist (outCube.histogram(0)); - - std::cout << hist->Average() << std::endl; - std::cout << hist->Sum() << std::endl; - std::cout << hist->ValidPixels() << std::endl; - std::cout << hist->StandardDeviation() << std::endl; - ASSERT_NEAR(hist->Average(), 0.205984, 1e-3); ASSERT_NEAR(hist->Sum(), 185.386, 1e-3); ASSERT_EQ(hist->ValidPixels(), 900); @@ -196,12 +184,6 @@ TEST(Pds2Isis, Pds2isisTestOffset) { ASSERT_EQ((double)mapping["Scale"], 4.0); std::unique_ptr hist (outCube.histogram()); - - std::cout << hist->Average() << std::endl; - std::cout << hist->Sum() << std::endl; - std::cout << hist->ValidPixels() << std::endl; - std::cout << hist->StandardDeviation() << std::endl; - ASSERT_NEAR(hist->Average(), 1.7375e+06, 10); ASSERT_NEAR(hist->Sum(), 2.50026e+09, 1e3); ASSERT_EQ(hist->ValidPixels(), 1439); @@ -245,12 +227,6 @@ TEST(Pds2Isis, Pds2isisTestProjection) { ASSERT_EQ((double)mapping["Scale"], 1407.4); std::unique_ptr hist (outCube.histogram()); - - std::cout << hist->Average() << std::endl; - std::cout << hist->Sum() << std::endl; - std::cout << hist->ValidPixels() << std::endl; - std::cout << hist->StandardDeviation() << std::endl; - ASSERT_NEAR(hist->Average(), 67.7978515625, .00001); ASSERT_EQ(hist->Sum(), 69425); ASSERT_EQ(hist->ValidPixels(), 1024); @@ -349,12 +325,6 @@ TEST(Pds2Isis, Pds2isisTestBIL) { ASSERT_EQ((int)dimensions["Bands"], 1); std::unique_ptr hist (outCube.histogram()); - - std::cout << hist->Average() << std::endl; - std::cout << hist->Sum() << std::endl; - std::cout << hist->ValidPixels() << std::endl; - std::cout << hist->StandardDeviation() << std::endl; - ASSERT_NEAR(hist->Average(), 6.35692e+31, 1e25); ASSERT_NEAR(hist->Sum(), 1.9325e+34, 1e29); ASSERT_EQ(hist->ValidPixels(), 304); @@ -386,12 +356,6 @@ TEST(Pds2Isis, Pds2isisTestBIP) { ASSERT_EQ((int)dimensions["Bands"], 1); std::unique_ptr hist (outCube.histogram()); - - std::cout << hist->Average() << std::endl; - std::cout << hist->Sum() << std::endl; - std::cout << hist->ValidPixels() << std::endl; - std::cout << hist->StandardDeviation() << std::endl; - ASSERT_NEAR(hist->Average(), 6.35692e+31, 1e25); ASSERT_NEAR(hist->Sum(), 1.9325e+34, 1e29); ASSERT_EQ(hist->ValidPixels(), 304); @@ -423,12 +387,6 @@ TEST(Pds2Isis, Pds2isisTestNIMSQub) { ASSERT_EQ((int)dimensions["Bands"], 12); std::unique_ptr hist (outCube.histogram()); - - std::cout << hist->Average() << std::endl; - std::cout << hist->Sum() << std::endl; - std::cout << hist->ValidPixels() << std::endl; - std::cout << hist->StandardDeviation() << std::endl; - ASSERT_NEAR(hist->Average(), 1.64693e+30, 1e25); ASSERT_NEAR(hist->Sum(), 7.57588e+31, 1e26); ASSERT_EQ(hist->ValidPixels(), 46); From 29085e3d6bd5ed178cccf420b492cea969b329b7 Mon Sep 17 00:00:00 2001 From: Tim Giroux Date: Mon, 30 Nov 2020 13:21:15 -0700 Subject: [PATCH 5/6] fix build failure --- isis/src/base/apps/pds2isis/pds2isis.cpp | 84 ++++++++++++++++++++++++ isis/src/base/apps/pds2isis/pds2isis.h | 11 ++++ 2 files changed, 95 insertions(+) create mode 100644 isis/src/base/apps/pds2isis/pds2isis.cpp create mode 100644 isis/src/base/apps/pds2isis/pds2isis.h diff --git a/isis/src/base/apps/pds2isis/pds2isis.cpp b/isis/src/base/apps/pds2isis/pds2isis.cpp new file mode 100644 index 0000000000..6e9cc20a1b --- /dev/null +++ b/isis/src/base/apps/pds2isis/pds2isis.cpp @@ -0,0 +1,84 @@ +#include "ProcessImportPds.h" + +#include "UserInterface.h" +#include "FileName.h" + +using namespace std; +namespace Isis { + void pds2isis(UserInterface &ui, Pvl *log) { + ProcessImportPds p; + Pvl label; + QString labelFile = ui.GetFileName("FROM"); + QString imageFile(""); + if(ui.WasEntered("IMAGE")) { + imageFile = ui.GetFileName("IMAGE"); + } + + p.SetPdsFile(labelFile, imageFile, label); + + + CubeAttributeOutput &att = ui.GetOutputAttribute("TO"); + Cube *ocube = p.SetOutputCube(ui.GetFileName("TO"), att); + + // Get user entered special pixel ranges + if(ui.GetBoolean("SETNULLRANGE")) { + p.SetNull(ui.GetDouble("NULLMIN"), ui.GetDouble("NULLMAX")); + } + if(ui.GetBoolean("SETHRSRANGE")) { + p.SetHRS(ui.GetDouble("HRSMIN"), ui.GetDouble("HRSMAX")); + } + if(ui.GetBoolean("SETHISRANGE")) { + p.SetHIS(ui.GetDouble("HISMIN"), ui.GetDouble("HISMAX")); + } + if(ui.GetBoolean("SETLRSRANGE")) { + p.SetLRS(ui.GetDouble("LRSMIN"), ui.GetDouble("LRSMAX")); + } + if(ui.GetBoolean("SETLISRANGE")) { + p.SetLIS(ui.GetDouble("LISMIN"), ui.GetDouble("LISMAX")); + } + + // Export the cube + p.StartProcess(); + + // Get as many of the other labels as we can + Pvl otherLabels; + p.TranslatePdsProjection(otherLabels); + if(p.IsIsis2()) { + p.TranslateIsis2Labels(otherLabels); + } + else { + p.TranslatePdsLabels(otherLabels); + } + + if(otherLabels.hasGroup("Mapping") && + (otherLabels.findGroup("Mapping").keywords() > 0)) { + ocube->putGroup(otherLabels.findGroup("Mapping")); + } + if(otherLabels.hasGroup("Instrument") && + (otherLabels.findGroup("Instrument").keywords() > 0)) { + ocube->putGroup(otherLabels.findGroup("Instrument")); + } + if(otherLabels.hasGroup("BandBin") && + (otherLabels.findGroup("BandBin").keywords() > 0)) { + ocube->putGroup(otherLabels.findGroup("BandBin")); + } + if(otherLabels.hasGroup("Archive") && + (otherLabels.findGroup("Archive").keywords() > 0)) { + ocube->putGroup(otherLabels.findGroup("Archive")); + } + + // Check for and log any change from the default projection offsets and multipliers + if (p.GetProjectionOffsetChange()) { + PvlGroup results = p.GetProjectionOffsetGroup(); + results.setName("Results"); + results[0].addComment("Projection offsets and multipliers have been changed from"); + results[0].addComment("defaults. New values are below."); + log->addGroup(results); + } + + p.EndProcess(); + + return; + } +} + diff --git a/isis/src/base/apps/pds2isis/pds2isis.h b/isis/src/base/apps/pds2isis/pds2isis.h new file mode 100644 index 0000000000..d7f9e94aeb --- /dev/null +++ b/isis/src/base/apps/pds2isis/pds2isis.h @@ -0,0 +1,11 @@ +#ifndef pds2isis_h +#define pds2isis_h + +#include "Pvl.h" +#include "UserInterface.h" + +namespace Isis{ + extern void pds2isis(UserInterface &ui, Pvl *log); +} + +#endif From fd41ea84fac5122ccd5a805afbbb4957994186ff Mon Sep 17 00:00:00 2001 From: Tim Giroux Date: Thu, 3 Dec 2020 09:47:41 -0700 Subject: [PATCH 6/6] remove local path --- isis/tests/FunctionalTestsPds2isis.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/isis/tests/FunctionalTestsPds2isis.cpp b/isis/tests/FunctionalTestsPds2isis.cpp index 2320d5543c..eb90a76962 100644 --- a/isis/tests/FunctionalTestsPds2isis.cpp +++ b/isis/tests/FunctionalTestsPds2isis.cpp @@ -62,8 +62,7 @@ TEST(Pds2Isis, Pds2isisTestDefault) { TEST(Pds2Isis, Pds2isisTestBandBin) { Pvl appLog; QTemporaryDir prefix; - // QString cubeFileName = prefix.path() + "/pds2isis_out.cub"; - QString cubeFileName = "/home/tgiroux/Desktop/pds2isis_bandbin_out.cub"; + QString cubeFileName = prefix.path() + "/pds2isis_out.cub"; QVector args = { "from=data/pds2isis/gaspra_nims_hires_radiance_cropped.lbl", "to=" + cubeFileName }; UserInterface options(APP_XML, args);