diff --git a/isis/src/chandrayaan1/apps/chan1m32isis/chan1m32isis.cpp b/isis/src/chandrayaan1/apps/chan1m32isis/chan1m32isis.cpp new file mode 100644 index 0000000000..4d51d3d48b --- /dev/null +++ b/isis/src/chandrayaan1/apps/chan1m32isis/chan1m32isis.cpp @@ -0,0 +1,481 @@ +#include "chan1m32isis.h" + +#include + +#include +#include + +#include "Application.h" +#include "BoxcarCachingAlgorithm.h" +#include "Brick.h" +#include "Cube.h" +#include "CubeAttribute.h" +#include "FileName.h" +#include "IException.h" +#include "ImportPdsTable.h" +#include "iTime.h" +#include "NaifStatus.h" +#include "OriginalLabel.h" +#include "PixelType.h" +#include "ProcessByLine.h" +#include "ProcessBySample.h" +#include "ProcessImportPds.h" +#include "Progress.h" +#include "Pvl.h" +#include "Table.h" +#include "UserInterface.h" + +using namespace std; + +namespace Isis { + + void writeCube(Buffer &in); + void writeCubeWithDroppedLines(Buffer &in); + void importImage(QString outputParamName, ProcessImportPds::PdsFileType fileType); + void importImage(QString outputParamName, ProcessImportPds::PdsFileType fileType, UserInterface &ui); + void translateChandrayaan1M3Labels(Pvl &pdsLabel, Cube *ocube, Table &utcTable, + ProcessImportPds::PdsFileType fileType); + void flip(Buffer &in); + void flipUtcTable(Table &utcTable); + Cube *g_oCube; + Brick *g_oBuff; + int g_totalLinesAdded; + double g_expectedLineRate; + Table *g_utcTable; + PvlGroup g_results("Results"); + + Pvl chan1m32isis(UserInterface &ui) { + Pvl log; + importImage("TO", (ProcessImportPds::PdsFileType)(ProcessImportPds::Rdn|ProcessImportPds::L0), ui); + log.addGroup(g_results); + importImage("LOC", ProcessImportPds::Loc, ui); + importImage("OBS", ProcessImportPds::Obs, ui); + return log; + } + + void importImage(QString outputParamName, ProcessImportPds::PdsFileType fileType) { + UserInterface &ui = Application::GetUserInterface(); + importImage(outputParamName, fileType, ui); + } + + void importImage(QString outputParamName, ProcessImportPds::PdsFileType fileType, UserInterface &ui) { + if (!ui.WasEntered(outputParamName)) { + return; + } + + g_oCube = NULL; + g_oBuff = NULL; + g_totalLinesAdded = 0; + g_utcTable = NULL; + double calcOutputLines = 0; + + ProcessImportPds importPds; + importPds.Progress()->SetText((QString)"Writing " + outputParamName + " file"); + + FileName in = ui.GetFileName("FROM"); + + Pvl pdsLabel(in.expanded()); + if (fileType == (ProcessImportPds::L0 | ProcessImportPds::Rdn)) { + // Is this a L0 or L1B product? + if ((QString) pdsLabel["PRODUCT_TYPE"] == "RAW_IMAGE") { + fileType = ProcessImportPds::L0; + } + else { + fileType = ProcessImportPds::Rdn; + } + } + + // Convert the pds file to a cube + try { + importPds.SetPdsFile(in.expanded(), "", pdsLabel, fileType); + } + catch(IException &e) { + QString msg = "Input file [" + in.expanded() + + "] does not appear to be a Chandrayaan 1 M3 detached PDS label"; + throw IException(e, IException::User, msg, _FILEINFO_); + } + + bool samplesNeedFlipped = false; + bool linesNeedFlipped = false; + if (fileType != ProcessImportPds::L0) { + // M3 PDS L1B images may be flipped/mirrored in sample and/or line to visually appear with + // north nearly up. The ISIS camera model does not take this into account, so this post + // acquisition processing needs to be removed. There are four possible flip/mirror mode + // combinations. + // 1. Descending yaw / Forward orbit limb - No changes in sample or line + // 2. Descending yaw / Reverse orbit limb - Samples are reversed, first sample on west side + // of image + // 3. Ascending yaw / Forward orbit limb - Lines/times are reversed so northernmost image + // line first, Samples are reversed, first sample on + // west side of image + // 4. Ascending yaw / Reverse orbit limb - Lines/times are reversed so northernmost image + // line first, + QString yawDirection = (QString) pdsLabel["CH1:SPACECRAFT_YAW_DIRECTION"]; + QString limbDirection = (QString) pdsLabel["CH1:ORBIT_LIMB_DIRECTION"]; + samplesNeedFlipped = ( ((yawDirection == "REVERSE") && (limbDirection == "DESCENDING")) || + ((yawDirection == "FORWARD") && (limbDirection == "ASCENDING")) ); + linesNeedFlipped = (limbDirection == "ASCENDING"); + } + + // The following 2 commented lines can be used for testing purposes, No flipping will be done with + // these lines uncommented i.e. north is always up, lons always pos east to the right. + // samplesNeedFlipped = false; + // linesNeedFlipped = false; + + { + // Calculate the number of output lines that should be present from the start and end times + // in the UTC table. + int outputLines; + if (fileType == ProcessImportPds::Rdn || fileType == ProcessImportPds::Loc || + fileType == ProcessImportPds::Obs) { + g_utcTable = &(importPds.ImportTable("UTC_FILE")); + + if (g_utcTable->Records() >= 1) { + + QString instMode = (QString) pdsLabel["INSTRUMENT_MODE_ID"]; + // Initialize to the value for a GLOBAL mode observation + g_expectedLineRate = 0.10176; + if (instMode == "TARGET") { + g_expectedLineRate = 0.05088; + } + + // The UTC line time table has been flipped in the same manner as the image lines, thus fabs + // Search the time table for gaps to come up with an output cube number of lines + // The times in the table are documented as the time at the center of the exposure/frame, so + // consecutive records in the time table should differ by the exposure rate, if not then + // there is a potential gap. + // This was calculated in the previous version of this code, but there is a minor difference + // between the calculation and the following brute force method. + outputLines = 0; + for (int rec = 0; rec < g_utcTable->Records() - 1; rec++) { + outputLines++; // One for this line + + iTime thisEt((QString)(*g_utcTable)[rec]["UtcTime"]); + iTime nextEt((QString)(*g_utcTable)[rec+1]["UtcTime"]); + double delta = fabs(nextEt - thisEt); // Time table may be assending or decenting times + + while (delta > g_expectedLineRate * 1.9) { + outputLines++; // Big enough gap to need more line(s) + delta -= g_expectedLineRate; + } + } + outputLines++; // One more for the last line + + iTime firstEt((QString)(*g_utcTable)[0]["UtcTime"]); + iTime lastEt((QString)(*g_utcTable)[g_utcTable->Records()-1]["UtcTime"]); + calcOutputLines = fabs((lastEt + g_expectedLineRate / 2.0) - + (firstEt - g_expectedLineRate / 2.0)) / g_expectedLineRate; + } + else { + QString msg = "Input file [" + in.expanded() + + "] does not appear to have any records in the UTC_FILE table"; + throw IException(IException::User, msg, _FILEINFO_); + } + } + else { + outputLines = importPds.Lines(); + calcOutputLines = outputLines; + } + + // Since the output cube possibly has more lines then the input PDS image, due to dropped + // lines, we have to write the output cube instead of letting ProcessImportPds do it for us. + g_oCube = new Cube(); + if (fileType == ProcessImportPds::L0) { + g_oCube->setPixelType(importPds.PixelType()); + } + g_oCube->setDimensions(importPds.Samples(), outputLines, importPds.Bands()); + g_oCube->create(ui.GetFileName(outputParamName)); + g_oCube->addCachingAlgorithm(new BoxcarCachingAlgorithm()); + + g_oBuff = new Isis::Brick(importPds.Samples(), outputLines, importPds.Bands(), + importPds.Samples(), 1, 1, importPds.PixelType(), true); + g_oBuff->setpos(0); + + if (fileType == ProcessImportPds::L0) { + importPds.StartProcess(writeCube); + } + else { + importPds.StartProcess(writeCubeWithDroppedLines); + g_results += PvlKeyword("LinesFlipped", toString(linesNeedFlipped)); + g_results += PvlKeyword("SamplesFlipped", toString(samplesNeedFlipped)); + g_results += PvlKeyword("LinesAdded", toString(g_totalLinesAdded)); + g_results += PvlKeyword("OutputLines", toString(outputLines)); + g_results += PvlKeyword("CalculatedOutputLines", toString(calcOutputLines)); + } + + delete g_oBuff; + + // If the image lines need flipped then so does the UTC table, if it exists. + // This does not need to be done before the main processing because the flipping of + // the image is done after the main processing. + if (fileType != ProcessImportPds::L0) { + if (linesNeedFlipped) { + flipUtcTable(*g_utcTable); + } + } + + translateChandrayaan1M3Labels(pdsLabel, g_oCube, *g_utcTable, fileType); + + if (fileType != ProcessImportPds::L0) g_oCube->write(*g_utcTable); + + importPds.WriteHistory(*g_oCube); + importPds.Finalize(); + + g_oCube->close(); + delete g_oCube; + + } + + CubeAttributeInput inAttribute; + if (linesNeedFlipped) { + ProcessBySample flipLines; + flipLines.Progress()->SetText("Flipping Lines"); + Cube *cube = flipLines.SetInputCube(ui.GetFileName(outputParamName), inAttribute); + cube->reopen("rw"); + flipLines.ProcessCubeInPlace(flip, false); + } + + if (samplesNeedFlipped) { + ProcessByLine flipSamples; + flipSamples.Progress()->SetText("Flipping Samples"); + Cube *cube = flipSamples.SetInputCube(ui.GetFileName(outputParamName), inAttribute); + cube->reopen("rw"); + flipSamples.ProcessCubeInPlace(flip, false); + } + } + + + // Processing function for writing all input PDS lines to the output cube. + // No dropped lines are inserted. + void writeCube(Buffer &in) { + + for (int i = 0; i < in.size(); i++) { + (*g_oBuff)[i] = in[i]; + } + + g_oCube->write(*g_oBuff); + (*g_oBuff)++; + } + + + // Processing function for writing all input PDS lines to the output cube with dropped lines + // inserted where the time table shows gaps. + void writeCubeWithDroppedLines(Buffer &in) { + + // Always write the current line to the output cube first + for (int i = 0; i < in.size(); i++) { + (*g_oBuff)[i] = in[i]; + } + + g_oCube->write(*g_oBuff); + (*g_oBuff)++; + + // Now check the UTC_TIME table and see if there is a gap (missing lines) after the TIME record + // for the current line. If there are, add as many lines as are necessary to fill the gap. + // Since the PDS files are in BIL order we are writeing to the ISIS cube in that order, so we + // do not need to write NULL lines to fill a gap until we have written the last band of line N, + // and we don't have to check for gaps after the last lines of the PDS file. + + if (in.Band() == g_oCube->bandCount() && in.Line() < g_utcTable->Records()) { + + QString tt = (QString)(*g_utcTable)[in.Line() - 1]["UtcTime"]; + QString ttt = (QString)(*g_utcTable)[in.Line()]["UtcTime"]; + + iTime thisEt((QString)(*g_utcTable)[in.Line() - 1]["UtcTime"]); + iTime nextEt((QString)(*g_utcTable)[in.Line()]["UtcTime"]); + + double delta = fabs(nextEt - thisEt); + + double linesToAdd = (delta / g_expectedLineRate) - 1.0; + + if (linesToAdd > 0.9) { + + // Create a NULL line + for (int i = 0; i < in.size(); i++) { + (*g_oBuff)[i] = Null; + } + + while (linesToAdd > 0.9) { + + for (int band = 0; band < g_oCube->bandCount(); band++) { + g_oCube->write(*g_oBuff); + (*g_oBuff)++; + } + linesToAdd--; + g_totalLinesAdded++; + } + } + } + } + + + // Transfere the needed PDS labels to the ISIS Cube and update them where necessary + void translateChandrayaan1M3Labels(Pvl& pdsLabel, Cube *ocube, Table& utcTable, + ProcessImportPds::PdsFileType fileType) { + Pvl outLabel; + + // Translate the archive group + FileName transFile("$ISISROOT/appdata/translations/Chandrayaan1M3Archive.trn"); + PvlToPvlTranslationManager archiveXlator(pdsLabel, transFile.expanded()); + archiveXlator.Auto(outLabel); + ocube->putGroup(outLabel.findGroup("Archive", Pvl::Traverse)); + + // Translate the instrument group + transFile = "$ISISROOT/appdata/translations/Chandrayaan1M3Instrument.trn"; + PvlToPvlTranslationManager instrumentXlator(pdsLabel, transFile.expanded()); + instrumentXlator.Auto(outLabel); + + PvlGroup &inst = outLabel.findGroup("Instrument", Pvl::Traverse); + + // The start and stop times for M3 in the PDS file look to have been truncated. + // Update them with the times from the UTC table if we have one. + if (fileType != ProcessImportPds::L0) { + + // The original START/STOPTIME keywords and the UTC table did not have accurate enough times to + // allow spiceinit to work on ck and spk kernels generated by ckwriter and spkwriter after + // jigsaw, so use the clock counts to update these keywords. + NaifStatus::CheckErrors(); + + QString lsk = "$base/kernels/lsk/naif????.tls"; + FileName lskName(lsk); + lskName = lskName.highestVersion(); + furnsh_c(lskName.expanded().toLatin1().data()); + + QString sclk = "$chandrayaan1/kernels/sclk/aig_ch1_sclk_complete_biased_m1p???.tsc"; + FileName sclkName(sclk); + sclkName = sclkName.highestVersion(); + furnsh_c(sclkName.expanded().toLatin1().data()); + + SpiceInt sclkCode = -86; + + // Remmoved when we found out the lable counts are not as correct as we need. We use the time + // tables instead (see below) + //QString startTime = inst["SpacecraftClockStartCount"]; + //double et; + //scs2e_c(sclkCode, startTime.toAscii().data(), &et); + //iTime startEt(et); + //inst.findKeyword("StartTime").setValue(startEt.UTC()); + + //QString stopTime = inst["SpacecraftClockStopCount"]; + //scs2e_c(sclkCode, stopTime.toAscii().data(), &et); + //iTime stopEt(et); + //inst.findKeyword("StopTime").setValue(stopEt.UTC()); + + // Replace code above with this + // The start and stop times in the PDS labels do not match the UTC table times. + // Assume the UTC table times are better, so change the labels to match the table + // The start and stop clock counts need to match the start/stop time, so convert the times + // to new clock counts. + iTime firstEt((QString)(*g_utcTable)[0]["UtcTime"]); + iTime lastEt((QString)(*g_utcTable)[utcTable.Records()-1]["UtcTime"]); + + // The table is in assending order + // The table contains the middle of the exposure. include times to cover the beginning of + // line 1 and the end of line NL + if (firstEt < lastEt) { + firstEt = firstEt - (g_expectedLineRate / 2.0); + lastEt = lastEt + (g_expectedLineRate / 2.0); + } + else { + firstEt = lastEt - (g_expectedLineRate / 2.0); + lastEt = firstEt + (g_expectedLineRate / 2.0); + } + + inst.findKeyword("StartTime").setValue(firstEt.UTC()); + SpiceChar startClockString[100]; + sce2s_c (sclkCode, firstEt.Et(), 100, startClockString); + QString startClock(startClockString); + inst.findKeyword("SpacecraftClockStartCount").setValue(startClock); + + inst.findKeyword("StopTime").setValue(lastEt.UTC()); + SpiceChar stopClockString[100]; + sce2s_c (sclkCode, lastEt.Et(), 100, stopClockString); + QString stopClock(stopClockString); + inst.findKeyword("SpacecraftClockStopCount").setValue(stopClock); + } + + ocube->putGroup(inst); + + if (fileType == ProcessImportPds::L0 || fileType == ProcessImportPds::Rdn) { + // Setup the band bin group + QString bandFile = "$chandrayaan1/bandBin/bandBin.pvl"; + Pvl bandBinTemplate(bandFile); + PvlObject modeObject = bandBinTemplate.findObject(pdsLabel["INSTRUMENT_MODE_ID"]); + PvlGroup bandGroup = modeObject.findGroup("BandBin"); + // Add OriginalBand + int numBands; + if ((QString)pdsLabel["INSTRUMENT_MODE_ID"] == "TARGET") { + numBands = 256; + } + else { + numBands = 85; + } + PvlKeyword originalBand("OriginalBand"); + for (int i = 1; i <= numBands; i++) { + originalBand.addValue(toString(i)); + } + bandGroup += originalBand; + ocube->putGroup(bandGroup); + + if (fileType == ProcessImportPds::Rdn) { + // Setup the radiometric calibration group for the image cube + PvlGroup calib("RadiometricCalibration"); + PvlKeyword solar = pdsLabel["SOLAR_DISTANCE"]; + calib += PvlKeyword("Units", "W/m2/um/sr"); + calib += PvlKeyword("SolarDistance", toString((double)solar), solar.unit()); + calib += PvlKeyword("DetectorTemperature", toString((double)pdsLabel["DETECTOR_TEMPERATURE"])); + calib += PvlKeyword("SpectralCalibrationFileName", + (QString)pdsLabel["CH1:SPECTRAL_CALIBRATION_FILE_NAME"]); + calib += PvlKeyword("RadGainFactorFileName", + (QString)pdsLabel["CH1:RAD_GAIN_FACTOR_FILE_NAME"]); + calib += PvlKeyword("GlobalBandpassFileName", + (QString)pdsLabel["CH1:SPECTRAL_CALIBRATION_FILE_NAME"]); + ocube->putGroup(calib); + } + } + + // Setup the band bin group + else if (fileType == ProcessImportPds::Loc) { + PvlGroup bandBin("BandBin"); + PvlKeyword bandNames = pdsLabel.findObject("LOC_IMAGE", PvlObject::Traverse)["BAND_NAME"]; + bandNames.setName("Name"); + bandBin += bandNames; + PvlKeyword bandUnits("Units", "(Degrees, Degrees, Meters)"); + bandBin += bandUnits; + ocube->putGroup(bandBin); + } + else if (fileType == ProcessImportPds::Obs) { + PvlGroup bandBin("BandBin"); + PvlKeyword bandNames = pdsLabel.findObject("OBS_IMAGE", PvlObject::Traverse)["BAND_NAME"]; + bandNames.setName("Name"); + bandBin += bandNames; + ocube->putGroup(bandBin); + } + + // Setup the kernel group + PvlGroup kern("Kernels"); + kern += PvlKeyword("NaifFrameCode", "-86520"); + ocube->putGroup(kern); + + OriginalLabel origLabel(pdsLabel); + ocube->write(origLabel); + } + + + void flip(Buffer &in) { + for(int i = 0; i < in.size() / 2; i++) { + swap(in[i], in[in.size() - i - 1]); + } + } + + + void flipUtcTable(Table &utcTable) { + int nrecs = utcTable.Records(); + for (int i = 0; i < nrecs / 2; i++) { + TableRecord rec1 = utcTable[i]; + TableRecord rec2 = utcTable[nrecs - i - 1]; + utcTable.Update(rec1, nrecs - i - 1); + utcTable.Update(rec2, i); + } + } +} diff --git a/isis/src/chandrayaan1/apps/chan1m32isis/chan1m32isis.h b/isis/src/chandrayaan1/apps/chan1m32isis/chan1m32isis.h new file mode 100644 index 0000000000..d3b9d92956 --- /dev/null +++ b/isis/src/chandrayaan1/apps/chan1m32isis/chan1m32isis.h @@ -0,0 +1,11 @@ +#ifndef chan1m32isis_h +#define chan1m32isis_h + +#include "UserInterface.h" +#include "Pvl.h" + +namespace Isis { + extern Pvl chan1m32isis(UserInterface &ui); +} + +#endif diff --git a/isis/src/chandrayaan1/apps/chan1m32isis/main.cpp b/isis/src/chandrayaan1/apps/chan1m32isis/main.cpp index 4295599be5..707aff3856 100644 --- a/isis/src/chandrayaan1/apps/chan1m32isis/main.cpp +++ b/isis/src/chandrayaan1/apps/chan1m32isis/main.cpp @@ -1,480 +1,13 @@ #include "Isis.h" +#include "chan1m32isis.h" +#include "Application.h" -#include - -#include -#include - -#include "BoxcarCachingAlgorithm.h" -#include "Brick.h" -#include "Cube.h" -#include "CubeAttribute.h" -#include "FileName.h" -#include "IException.h" -#include "ImportPdsTable.h" -#include "iTime.h" -#include "NaifStatus.h" -#include "OriginalLabel.h" -#include "PixelType.h" -#include "ProcessByLine.h" -#include "ProcessBySample.h" -#include "ProcessImportPds.h" -#include "Progress.h" -#include "Pvl.h" -#include "Table.h" -#include "UserInterface.h" - -using namespace std; using namespace Isis; -void writeCube(Buffer &in); -void writeCubeWithDroppedLines(Buffer &in); - -void importImage(QString outputParamName, ProcessImportPds::PdsFileType fileType); -void translateChandrayaan1M3Labels(Pvl &pdsLabel, Cube *ocube, Table &utcTable, - ProcessImportPds::PdsFileType fileType); -void flip(Buffer &in); -void flipUtcTable(Table &utcTable); - - -Cube *g_oCube; -Brick *g_oBuff; -int g_totalLinesAdded; -double g_expectedLineRate; -Table *g_utcTable; -PvlGroup g_results("Results"); - void IsisMain() { - g_results.clear(); - importImage("TO", (ProcessImportPds::PdsFileType)(ProcessImportPds::Rdn|ProcessImportPds::L0)); - Application::Log(g_results); - importImage("LOC", ProcessImportPds::Loc); - importImage("OBS", ProcessImportPds::Obs); -} - - -void importImage(QString outputParamName, ProcessImportPds::PdsFileType fileType) { - - // We should be processing a PDS file UserInterface &ui = Application::GetUserInterface(); - if (!ui.WasEntered(outputParamName)) { - return; - } - - g_oCube = NULL; - g_oBuff = NULL; - g_totalLinesAdded = 0; - g_utcTable = NULL; - double calcOutputLines = 0; - - ProcessImportPds importPds; - importPds.Progress()->SetText((QString)"Writing " + outputParamName + " file"); - - FileName in = ui.GetFileName("FROM"); - - Pvl pdsLabel(in.expanded()); - if (fileType == (ProcessImportPds::L0 | ProcessImportPds::Rdn)) { - // Is this a L0 or L1B product? - if ((QString) pdsLabel["PRODUCT_TYPE"] == "RAW_IMAGE") { - fileType = ProcessImportPds::L0; - } - else { - fileType = ProcessImportPds::Rdn; - } - } - - // Convert the pds file to a cube - try { - importPds.SetPdsFile(in.expanded(), "", pdsLabel, fileType); - } - catch(IException &e) { - QString msg = "Input file [" + in.expanded() + - "] does not appear to be a Chandrayaan 1 M3 detached PDS label"; - throw IException(e, IException::User, msg, _FILEINFO_); - } - - bool samplesNeedFlipped = false; - bool linesNeedFlipped = false; - if (fileType != ProcessImportPds::L0) { - // M3 PDS L1B images may be flipped/mirrored in sample and/or line to visually appear with - // north nearly up. The ISIS camera model does not take this into account, so this post - // acquisition processing needs to be removed. There are four possible flip/mirror mode - // combinations. - // 1. Descending yaw / Forward orbit limb - No changes in sample or line - // 2. Descending yaw / Reverse orbit limb - Samples are reversed, first sample on west side - // of image - // 3. Ascending yaw / Forward orbit limb - Lines/times are reversed so northernmost image - // line first, Samples are reversed, first sample on - // west side of image - // 4. Ascending yaw / Reverse orbit limb - Lines/times are reversed so northernmost image - // line first, - QString yawDirection = (QString) pdsLabel["CH1:SPACECRAFT_YAW_DIRECTION"]; - QString limbDirection = (QString) pdsLabel["CH1:ORBIT_LIMB_DIRECTION"]; - samplesNeedFlipped = ( ((yawDirection == "REVERSE") && (limbDirection == "DESCENDING")) || - ((yawDirection == "FORWARD") && (limbDirection == "ASCENDING")) ); - linesNeedFlipped = (limbDirection == "ASCENDING"); - } - - // The following 2 commented lines can be used for testing purposes, No flipping will be done with - // these lines uncommented i.e. north is always up, lons always pos east to the right. - // samplesNeedFlipped = false; - // linesNeedFlipped = false; - - { - // Calculate the number of output lines that should be present from the start and end times - // in the UTC table. - int outputLines; - if (fileType == ProcessImportPds::Rdn || fileType == ProcessImportPds::Loc || - fileType == ProcessImportPds::Obs) { - g_utcTable = &(importPds.ImportTable("UTC_FILE")); - - if (g_utcTable->Records() >= 1) { - - QString instMode = (QString) pdsLabel["INSTRUMENT_MODE_ID"]; - // Initialize to the value for a GLOBAL mode observation - g_expectedLineRate = 0.10176; - if (instMode == "TARGET") { - g_expectedLineRate = 0.05088; - } - - // The UTC line time table has been flipped in the same manner as the image lines, thus fabs - // Search the time table for gaps to come up with an output cube number of lines - // The times in the table are documented as the time at the center of the exposure/frame, so - // consecutive records in the time table should differ by the exposure rate, if not then - // there is a potential gap. - // This was calculated in the previous version of this code, but there is a minor difference - // between the calculation and the following brute force method. - outputLines = 0; - for (int rec = 0; rec < g_utcTable->Records() - 1; rec++) { - outputLines++; // One for this line - - iTime thisEt((QString)(*g_utcTable)[rec]["UtcTime"]); - iTime nextEt((QString)(*g_utcTable)[rec+1]["UtcTime"]); - double delta = fabs(nextEt - thisEt); // Time table may be assending or decenting times - - while (delta > g_expectedLineRate * 1.9) { - outputLines++; // Big enough gap to need more line(s) - delta -= g_expectedLineRate; - } - } - outputLines++; // One more for the last line - - iTime firstEt((QString)(*g_utcTable)[0]["UtcTime"]); - iTime lastEt((QString)(*g_utcTable)[g_utcTable->Records()-1]["UtcTime"]); - calcOutputLines = fabs((lastEt + g_expectedLineRate / 2.0) - - (firstEt - g_expectedLineRate / 2.0)) / g_expectedLineRate; - } - else { - QString msg = "Input file [" + in.expanded() + - "] does not appear to have any records in the UTC_FILE table"; - throw IException(IException::User, msg, _FILEINFO_); - } - } - else { - outputLines = importPds.Lines(); - calcOutputLines = outputLines; - } - - // Since the output cube possibly has more lines then the input PDS image, due to dropped - // lines, we have to write the output cube instead of letting ProcessImportPds do it for us. - g_oCube = new Cube(); - if (fileType == ProcessImportPds::L0) { - g_oCube->setPixelType(importPds.PixelType()); - } - g_oCube->setDimensions(importPds.Samples(), outputLines, importPds.Bands()); - g_oCube->create(ui.GetFileName(outputParamName)); - g_oCube->addCachingAlgorithm(new BoxcarCachingAlgorithm()); - - g_oBuff = new Isis::Brick(importPds.Samples(), outputLines, importPds.Bands(), - importPds.Samples(), 1, 1, importPds.PixelType(), true); - g_oBuff->setpos(0); - - if (fileType == ProcessImportPds::L0) { - importPds.StartProcess(writeCube); - } - else { - importPds.StartProcess(writeCubeWithDroppedLines); - g_results += PvlKeyword("LinesFlipped", toString(linesNeedFlipped)); - g_results += PvlKeyword("SamplesFlipped", toString(samplesNeedFlipped)); - g_results += PvlKeyword("LinesAdded", toString(g_totalLinesAdded)); - g_results += PvlKeyword("OutputLines", toString(outputLines)); - g_results += PvlKeyword("CalculatedOutputLines", toString(calcOutputLines)); - } - - delete g_oBuff; - - // If the image lines need flipped then so does the UTC table, if it exists. - // This does not need to be done before the main processing because the flipping of - // the image is done after the main processing. - if (fileType != ProcessImportPds::L0) { - if (linesNeedFlipped) { - flipUtcTable(*g_utcTable); - } - } - - translateChandrayaan1M3Labels(pdsLabel, g_oCube, *g_utcTable, fileType); - - if (fileType != ProcessImportPds::L0) g_oCube->write(*g_utcTable); - - importPds.WriteHistory(*g_oCube); - importPds.Finalize(); - - g_oCube->close(); - delete g_oCube; - - } - - CubeAttributeInput inAttribute; - if (linesNeedFlipped) { - ProcessBySample flipLines; - flipLines.Progress()->SetText("Flipping Lines"); - Cube *cube = flipLines.SetInputCube(ui.GetFileName(outputParamName), inAttribute); - cube->reopen("rw"); - flipLines.ProcessCubeInPlace(flip, false); - } - - if (samplesNeedFlipped) { - ProcessByLine flipSamples; - flipSamples.Progress()->SetText("Flipping Samples"); - Cube *cube = flipSamples.SetInputCube(ui.GetFileName(outputParamName), inAttribute); - cube->reopen("rw"); - flipSamples.ProcessCubeInPlace(flip, false); - } -} - - -// Processing function for writing all input PDS lines to the output cube. -// No dropped lines are inserted. -void writeCube(Buffer &in) { - - for (int i = 0; i < in.size(); i++) { - (*g_oBuff)[i] = in[i]; - } - - g_oCube->write(*g_oBuff); - (*g_oBuff)++; -} - - -// Processing function for writing all input PDS lines to the output cube with dropped lines -// inserted where the time table shows gaps. -void writeCubeWithDroppedLines(Buffer &in) { - - // Always write the current line to the output cube first - for (int i = 0; i < in.size(); i++) { - (*g_oBuff)[i] = in[i]; - } - - g_oCube->write(*g_oBuff); - (*g_oBuff)++; - - // Now check the UTC_TIME table and see if there is a gap (missing lines) after the TIME record - // for the current line. If there are, add as many lines as are necessary to fill the gap. - // Since the PDS files are in BIL order we are writeing to the ISIS cube in that order, so we - // do not need to write NULL lines to fill a gap until we have written the last band of line N, - // and we don't have to check for gaps after the last lines of the PDS file. - - if (in.Band() == g_oCube->bandCount() && in.Line() < g_utcTable->Records()) { - - QString tt = (QString)(*g_utcTable)[in.Line() - 1]["UtcTime"]; - QString ttt = (QString)(*g_utcTable)[in.Line()]["UtcTime"]; - - iTime thisEt((QString)(*g_utcTable)[in.Line() - 1]["UtcTime"]); - iTime nextEt((QString)(*g_utcTable)[in.Line()]["UtcTime"]); - - double delta = fabs(nextEt - thisEt); - - double linesToAdd = (delta / g_expectedLineRate) - 1.0; - - if (linesToAdd > 0.9) { - - // Create a NULL line - for (int i = 0; i < in.size(); i++) { - (*g_oBuff)[i] = Null; - } - - while (linesToAdd > 0.9) { - - for (int band = 0; band < g_oCube->bandCount(); band++) { - g_oCube->write(*g_oBuff); - (*g_oBuff)++; - } - linesToAdd--; - g_totalLinesAdded++; - } - } - } -} - - -// Transfere the needed PDS labels to the ISIS Cube and update them where necessary -void translateChandrayaan1M3Labels(Pvl& pdsLabel, Cube *ocube, Table& utcTable, - ProcessImportPds::PdsFileType fileType) { - Pvl outLabel; - - // Translate the archive group - FileName transFile("$ISISROOT/appdata/translations/Chandrayaan1M3Archive.trn"); - PvlToPvlTranslationManager archiveXlator(pdsLabel, transFile.expanded()); - archiveXlator.Auto(outLabel); - ocube->putGroup(outLabel.findGroup("Archive", Pvl::Traverse)); - - // Translate the instrument group - transFile = "$ISISROOT/appdata/translations/Chandrayaan1M3Instrument.trn"; - PvlToPvlTranslationManager instrumentXlator(pdsLabel, transFile.expanded()); - instrumentXlator.Auto(outLabel); - - PvlGroup &inst = outLabel.findGroup("Instrument", Pvl::Traverse); - - // The start and stop times for M3 in the PDS file look to have been truncated. - // Update them with the times from the UTC table if we have one. - if (fileType != ProcessImportPds::L0) { - - // The original START/STOPTIME keywords and the UTC table did not have accurate enough times to - // allow spiceinit to work on ck and spk kernels generated by ckwriter and spkwriter after - // jigsaw, so use the clock counts to update these keywords. - NaifStatus::CheckErrors(); - - QString lsk = "$base/kernels/lsk/naif????.tls"; - FileName lskName(lsk); - lskName = lskName.highestVersion(); - furnsh_c(lskName.expanded().toLatin1().data()); - - QString sclk = "$chandrayaan1/kernels/sclk/aig_ch1_sclk_complete_biased_m1p???.tsc"; - FileName sclkName(sclk); - sclkName = sclkName.highestVersion(); - furnsh_c(sclkName.expanded().toLatin1().data()); - - SpiceInt sclkCode = -86; - - // Remmoved when we found out the lable counts are not as correct as we need. We use the time - // tables instead (see below) - //QString startTime = inst["SpacecraftClockStartCount"]; - //double et; - //scs2e_c(sclkCode, startTime.toAscii().data(), &et); - //iTime startEt(et); - //inst.findKeyword("StartTime").setValue(startEt.UTC()); - - //QString stopTime = inst["SpacecraftClockStopCount"]; - //scs2e_c(sclkCode, stopTime.toAscii().data(), &et); - //iTime stopEt(et); - //inst.findKeyword("StopTime").setValue(stopEt.UTC()); - - // Replace code above with this - // The start and stop times in the PDS labels do not match the UTC table times. - // Assume the UTC table times are better, so change the labels to match the table - // The start and stop clock counts need to match the start/stop time, so convert the times - // to new clock counts. - iTime firstEt((QString)(*g_utcTable)[0]["UtcTime"]); - iTime lastEt((QString)(*g_utcTable)[utcTable.Records()-1]["UtcTime"]); - - // The table is in assending order - // The table contains the middle of the exposure. include times to cover the beginning of - // line 1 and the end of line NL - if (firstEt < lastEt) { - firstEt = firstEt - (g_expectedLineRate / 2.0); - lastEt = lastEt + (g_expectedLineRate / 2.0); - } - else { - firstEt = lastEt - (g_expectedLineRate / 2.0); - lastEt = firstEt + (g_expectedLineRate / 2.0); - } - - inst.findKeyword("StartTime").setValue(firstEt.UTC()); - SpiceChar startClockString[100]; - sce2s_c (sclkCode, firstEt.Et(), 100, startClockString); - QString startClock(startClockString); - inst.findKeyword("SpacecraftClockStartCount").setValue(startClock); - - inst.findKeyword("StopTime").setValue(lastEt.UTC()); - SpiceChar stopClockString[100]; - sce2s_c (sclkCode, lastEt.Et(), 100, stopClockString); - QString stopClock(stopClockString); - inst.findKeyword("SpacecraftClockStopCount").setValue(stopClock); - } - - ocube->putGroup(inst); - - if (fileType == ProcessImportPds::L0 || fileType == ProcessImportPds::Rdn) { - // Setup the band bin group - QString bandFile = "$chandrayaan1/bandBin/bandBin.pvl"; - Pvl bandBinTemplate(bandFile); - PvlObject modeObject = bandBinTemplate.findObject(pdsLabel["INSTRUMENT_MODE_ID"]); - PvlGroup bandGroup = modeObject.findGroup("BandBin"); - // Add OriginalBand - int numBands; - if ((QString)pdsLabel["INSTRUMENT_MODE_ID"] == "TARGET") { - numBands = 256; - } - else { - numBands = 85; - } - PvlKeyword originalBand("OriginalBand"); - for (int i = 1; i <= numBands; i++) { - originalBand.addValue(toString(i)); - } - bandGroup += originalBand; - ocube->putGroup(bandGroup); - - if (fileType == ProcessImportPds::Rdn) { - // Setup the radiometric calibration group for the image cube - PvlGroup calib("RadiometricCalibration"); - PvlKeyword solar = pdsLabel["SOLAR_DISTANCE"]; - calib += PvlKeyword("Units", "W/m2/um/sr"); - calib += PvlKeyword("SolarDistance", toString((double)solar), solar.unit()); - calib += PvlKeyword("DetectorTemperature", toString((double)pdsLabel["DETECTOR_TEMPERATURE"])); - calib += PvlKeyword("SpectralCalibrationFileName", - (QString)pdsLabel["CH1:SPECTRAL_CALIBRATION_FILE_NAME"]); - calib += PvlKeyword("RadGainFactorFileName", - (QString)pdsLabel["CH1:RAD_GAIN_FACTOR_FILE_NAME"]); - calib += PvlKeyword("GlobalBandpassFileName", - (QString)pdsLabel["CH1:SPECTRAL_CALIBRATION_FILE_NAME"]); - ocube->putGroup(calib); - } - } - - // Setup the band bin group - else if (fileType == ProcessImportPds::Loc) { - PvlGroup bandBin("BandBin"); - PvlKeyword bandNames = pdsLabel.findObject("LOC_IMAGE", PvlObject::Traverse)["BAND_NAME"]; - bandNames.setName("Name"); - bandBin += bandNames; - PvlKeyword bandUnits("Units", "(Degrees, Degrees, Meters)"); - bandBin += bandUnits; - ocube->putGroup(bandBin); - } - else if (fileType == ProcessImportPds::Obs) { - PvlGroup bandBin("BandBin"); - PvlKeyword bandNames = pdsLabel.findObject("OBS_IMAGE", PvlObject::Traverse)["BAND_NAME"]; - bandNames.setName("Name"); - bandBin += bandNames; - ocube->putGroup(bandBin); - } - - // Setup the kernel group - PvlGroup kern("Kernels"); - kern += PvlKeyword("NaifFrameCode", "-86520"); - ocube->putGroup(kern); - - OriginalLabel origLabel(pdsLabel); - ocube->write(origLabel); -} - - -void flip(Buffer &in) { - for(int i = 0; i < in.size() / 2; i++) { - swap(in[i], in[in.size() - i - 1]); + Pvl results = chan1m32isis(ui); + for (int resultIndex = 0; resultIndex < results.groups(); resultIndex++) { + Application::Log(results.group(resultIndex)); } } - - -void flipUtcTable(Table &utcTable) { - int nrecs = utcTable.Records(); - for (int i = 0; i < nrecs / 2; i++) { - TableRecord rec1 = utcTable[i]; - TableRecord rec2 = utcTable[nrecs - i - 1]; - utcTable.Update(rec1, nrecs - i - 1); - utcTable.Update(rec2, i); - } -} - - diff --git a/isis/tests/FunctionalTestsChan1m32isis.cpp b/isis/tests/FunctionalTestsChan1m32isis.cpp new file mode 100644 index 0000000000..3856714bf3 --- /dev/null +++ b/isis/tests/FunctionalTestsChan1m32isis.cpp @@ -0,0 +1,405 @@ +#include +#include + +#include "chan1m32isis.h" +#include "Fixtures.h" +#include "Pvl.h" +#include "PvlGroup.h" +#include "TestUtilities.h" +#include "Histogram.h" + +#include "gmock/gmock.h" +#include "gtest/gtest.h" + +using namespace Isis; +using ::testing::HasSubstr; + +static QString APP_XML = FileName("$ISISROOT/bin/xml/chan1m32isis.xml").expanded(); + +TEST(Chan1m32Isis, Chan1m32IsisTestFowardAscending) { + QTemporaryDir prefix; + QString cubeFileName = prefix.path() + "/chan1m32isisTEMP.cub"; + QString locDest = prefix.path() + "loc.IMG"; + QString obsDest = prefix.path() + "obs.IMG"; + QFile::copy("data/chan1m32isis/forwardAscending/M3T20090630T083407_V03_LOC_cropped.IMG", locDest); + QFile::copy("data/chan1m32isis/forwardAscending/M3T20090630T083407_V03_OBS_cropped.IMG", obsDest); + + QVector args = {"from=data/chan1m32isis/forwardAscending/M3T20090630T083407_V03_L1B_cropped.LBL", + "loc=" + locDest, + "obs=" + obsDest, + "to=" + cubeFileName }; + + UserInterface options(APP_XML, args); + try { + chan1m32isis(options); + } + catch (IException &e) { + FAIL() << "Unable to ingest Chandrayaan image: " << e.toString().toStdString().c_str() << std::endl; + } + Cube cube(cubeFileName); + Pvl *isisLabel = cube.label(); + + // Dimensions Group + ASSERT_EQ(cube.sampleCount(), 608); + ASSERT_EQ(cube.lineCount(), 5); + ASSERT_EQ(cube.bandCount(), 3); + + // Pixels Group + ASSERT_EQ(PixelTypeName(cube.pixelType()), "Real"); + ASSERT_EQ(ByteOrderName(cube.byteOrder()), "Lsb"); + ASSERT_DOUBLE_EQ(cube.base(), 0.0); + ASSERT_DOUBLE_EQ(cube.multiplier(), 1.0); + + // Instrument Group + PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); + ASSERT_EQ(inst["SpacecraftName"][0].toStdString(), "CHANDRAYAAN-1"); + ASSERT_EQ(inst["InstrumentId"][0].toStdString(), "M3" ); + ASSERT_EQ(inst["TargetName"][0].toStdString(), "MOON" ); + ASSERT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "12/1759056.764" ); + ASSERT_DOUBLE_EQ(double(inst["LineExposureDuration"]), 50.88); + ASSERT_EQ(inst["StartTime"][0].toStdString(), "2009-06-30T08:34:35.424411" ); + ASSERT_EQ(inst["StopTime"][0].toStdString(), "2009-06-30T08:34:35.678811" ); + ASSERT_EQ(inst["SpacecraftYawDirection"][0].toStdString(), "FORWARD" ); + ASSERT_EQ(inst["OrbitLimbDirection"][0].toStdString(), "ASCENDING" ); + + // Archive Group + PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); + ASSERT_EQ(archive["ProductId"][0].toStdString(), "M3T20090630T083407_V03_RDN" ); + ASSERT_EQ(archive["SourceProductId"][0].toStdString(), "M3T20090630T083407_V01_L0.IMG" ); + ASSERT_EQ(archive["ProductType"][0].toStdString(), "CALIBRATED_IMAGE" ); + + // BandBin Group + // Check size, first, 2 middle, and last values? Enough? + PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); + ASSERT_EQ(bandbin["Center"].size(), 256); + ASSERT_EQ(bandbin["Width"].size(), 256); + ASSERT_EQ(bandbin["FilterNumber"].size(), 256); + ASSERT_EQ(bandbin["OriginalBand"].size(), 256); + + ASSERT_DOUBLE_EQ(bandbin["Center"][0].toDouble(), 446.02); + ASSERT_DOUBLE_EQ(bandbin["Center"][64].toDouble(), 1084.8); + ASSERT_DOUBLE_EQ(bandbin["Center"][128].toDouble(), 1723.5899999999999); + ASSERT_DOUBLE_EQ(bandbin["Center"][255].toDouble(), 2991.17); + + ASSERT_DOUBLE_EQ(bandbin["Width"][0].toDouble(), 12.31); + ASSERT_DOUBLE_EQ(bandbin["Width"][64].toDouble(), 12.29); + ASSERT_DOUBLE_EQ(bandbin["Width"][128].toDouble(), 12.61); + ASSERT_DOUBLE_EQ(bandbin["Width"][255].toDouble(), 12.18); + + + ASSERT_DOUBLE_EQ(bandbin["FilterNumber"][0].toDouble(), 5); + ASSERT_DOUBLE_EQ(bandbin["FilterNumber"][64].toDouble(), 69); + ASSERT_DOUBLE_EQ(bandbin["FilterNumber"][128].toDouble(), 133); + ASSERT_DOUBLE_EQ(bandbin["FilterNumber"][255].toDouble(), 260); + + ASSERT_DOUBLE_EQ(bandbin["OriginalBand"][0].toDouble(), 1); + ASSERT_DOUBLE_EQ(bandbin["OriginalBand"][64].toDouble(), 65); + ASSERT_DOUBLE_EQ(bandbin["OriginalBand"][128].toDouble(), 129); + ASSERT_DOUBLE_EQ(bandbin["OriginalBand"][255].toDouble(), 256); + + // Kernels Group + PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); + ASSERT_EQ(int(kernel["NaifFrameCode"]), -86520); + + std::unique_ptr hist (cube.histogram()); + + ASSERT_DOUBLE_EQ(hist->Average(), 15.58169779027077); + ASSERT_DOUBLE_EQ(hist->Sum(), 47368.361282423139); + ASSERT_EQ(hist->ValidPixels(), 3040); + ASSERT_DOUBLE_EQ(hist->StandardDeviation(), 2.2696592481066249); +} + + +TEST(Chan1m32Isis, Chan1m32IsisTestFowardDescending) { + QTemporaryDir prefix; + QString cubeFileName = prefix.path() + "/chan1m32isisTEMP.cub"; + QString locDest = prefix.path() + "obs.IMG"; + QString obsDest = prefix.path() + "loc.IMG"; + QFile::copy("data/chan1m32isis/forwardDescending/M3G20081129T171431_V03_LOC_cropped.IMG", locDest); + QFile::copy("data/chan1m32isis/forwardDescending/M3G20081129T171431_V03_OBS_cropped.IMG", obsDest); + + QVector args = {"from=data/chan1m32isis/forwardDescending/M3G20081129T171431_V03_L1B_cropped.LBL", + "loc=" + locDest, + "obs=" + obsDest, + "to=" + cubeFileName }; + + UserInterface options(APP_XML, args); + try { + chan1m32isis(options); + } + catch (IException &e) { + FAIL() << "Unable to ingest Chandrayaan image: " << e.toString().toStdString().c_str() << std::endl; + } + Cube cube(cubeFileName); + Pvl *isisLabel = cube.label(); + + // Instrument Group + PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); + ASSERT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "2/1531046.542" ); + ASSERT_EQ(inst["SpacecraftClockStopCount"][0].toStdString(), "2/1531047.050" ); + ASSERT_EQ(inst["StartTime"][0].toStdString(), "2008-11-29T17:14:29.729807" ); + ASSERT_EQ(inst["StopTime"][0].toStdString(), "2008-11-29T17:14:30.238607" ); + ASSERT_EQ(inst["SpacecraftYawDirection"][0].toStdString(), "FORWARD" ); + ASSERT_EQ(inst["OrbitLimbDirection"][0].toStdString(), "DESCENDING" ); + + // Archive Group + PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); + ASSERT_EQ(archive["ProductId"][0].toStdString(), "M3G20081129T171431_V03_RDN" ); + ASSERT_EQ(archive["SourceProductId"][0].toStdString(), "M3G20081129T171431_V01_L0.IMG" ); + ASSERT_EQ(archive["ProductType"][0].toStdString(), "CALIBRATED_IMAGE" ); + + // Kernels Group + PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); + ASSERT_EQ(int(kernel["NaifFrameCode"]), -86520); + + std::unique_ptr hist (cube.histogram()); + + ASSERT_DOUBLE_EQ(hist->Average(), 28.730294761277342); + ASSERT_DOUBLE_EQ(hist->Sum(), 43670.048037141562); + ASSERT_EQ(hist->ValidPixels(), 1520); + ASSERT_DOUBLE_EQ(hist->StandardDeviation(), 18.613867183571024); +} + +TEST(Chan1m32Isis, Chan1m32IsisTestReverseDescending) { + QTemporaryDir prefix; + QString cubeFileName = prefix.path() + "/chan1m32isisTEMP.cub"; + + QString locDest = prefix.path() + "loc.IMG"; + QString obsDest = prefix.path() + "obs.IMG"; + QFile::copy("data/chan1m32isis/reverseDescending/M3G20090106T113423_V03_LOC_cropped.IMG", locDest); + QFile::copy("data/chan1m32isis/reverseDescending/M3G20090106T113423_V03_OBS_cropped.IMG", obsDest); + + QVector args = {"from=data/chan1m32isis/reverseDescending/M3G20090106T113423_V03_L1B_cropped.LBL", + "loc=" + locDest, + "obs=" + obsDest, + "to=" + cubeFileName }; + + UserInterface options(APP_XML, args); + try { + chan1m32isis(options); + } + catch (IException &e) { + FAIL() << "Unable to ingest Chandrayaan image: " << e.toString().toStdString().c_str() << std::endl; + } + Cube cube(cubeFileName); + Pvl *isisLabel = cube.label(); + + // Instrument Group + PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); + ASSERT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "4/1165041.748" ); + ASSERT_EQ(inst["SpacecraftClockStopCount"][0].toStdString(), "4/1165042.256" ); + ASSERT_EQ(inst["StartTime"][0].toStdString(), "2009-01-06T11:34:24.380656" ); + ASSERT_EQ(inst["StopTime"][0].toStdString(), "2009-01-06T11:34:24.889456" ); + ASSERT_EQ(inst["SpacecraftYawDirection"][0].toStdString(), "REVERSE" ); + ASSERT_EQ(inst["OrbitLimbDirection"][0].toStdString(), "DESCENDING" ); + + // Archive Group + PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); + ASSERT_EQ(archive["ProductId"][0].toStdString(), "M3G20090106T113423_V03_RDN" ); + ASSERT_EQ(archive["SourceProductId"][0].toStdString(), "M3G20090106T113423_V01_L0.IMG" ); + ASSERT_EQ(archive["ProductType"][0].toStdString(), "CALIBRATED_IMAGE" ); + + // Kernels Group + PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); + ASSERT_EQ(int(kernel["NaifFrameCode"]), -86520); + + std::unique_ptr hist (cube.histogram()); + + ASSERT_NEAR(hist->Average(), 25.7498, .0001); + ASSERT_NEAR(hist->Sum(), 39139.74936, .00001); + ASSERT_EQ(hist->ValidPixels(), 1520); + ASSERT_NEAR(hist->StandardDeviation(), 5.64341, .00001); +} + + + +TEST(Chan1m32Isis, Chan1m32IsisTestReverseAscending) { + QTemporaryDir prefix; + QString cubeFileName = prefix.path() + "/chan1m32isisTEMP.cub"; + + QString locDest = prefix.path() + "loc.IMG"; + QString obsDest = prefix.path() + "obs.IMG"; + QFile::copy("data/chan1m32isis/reverseAscending/M3G20090423T191900_V03_LOC_cropped.IMG", locDest); + QFile::copy("data/chan1m32isis/reverseAscending/M3G20090423T191900_V03_OBS_cropped.IMG", obsDest); + + QVector args = {"from=data/chan1m32isis/reverseAscending/M3G20090423T191900_V03_L1B_cropped.LBL", + "loc=" + locDest, + "obs=" + obsDest, + "to=" + cubeFileName }; + + UserInterface options(APP_XML, args); + try { + chan1m32isis(options); + } + catch (IException &e) { + FAIL() << "Unable to ingest Chandrayaan image: " << e.toString().toStdString().c_str() << std::endl; + } + Cube cube(cubeFileName); + Pvl *isisLabel = cube.label(); + + // Instrument Group + PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); + ASSERT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "9/1365765.385" ); + ASSERT_EQ(inst["SpacecraftClockStopCount"][0].toStdString(), "9/1365765.893" ); + ASSERT_EQ(inst["StartTime"][0].toStdString(), "2009-04-23T19:19:44.679982" ); + ASSERT_EQ(inst["StopTime"][0].toStdString(), "2009-04-23T19:19:45.188782" ); + ASSERT_EQ(inst["SpacecraftYawDirection"][0].toStdString(), "REVERSE" ); + ASSERT_EQ(inst["OrbitLimbDirection"][0].toStdString(), "ASCENDING" ); + + // Archive Group + PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); + ASSERT_EQ(archive["ProductId"][0].toStdString(), "M3G20090423T191900_V03_RDN" ); + ASSERT_EQ(archive["SourceProductId"][0].toStdString(), "M3G20090423T191900_V01_L0.IMG" ); + ASSERT_EQ(archive["ProductType"][0].toStdString(), "CALIBRATED_IMAGE" ); + + // Kernels Group + PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); + ASSERT_EQ(int(kernel["NaifFrameCode"]), -86520); + + std::unique_ptr hist (cube.histogram()); + + ASSERT_NEAR(hist->Average(), 12.4351, .0001); + ASSERT_NEAR(hist->Sum(), 18901.42668, .00001); + ASSERT_EQ(hist->ValidPixels(), 1520); + ASSERT_NEAR(hist->StandardDeviation(), 2.14976, .00001); +} + + +TEST(Chan1m32Isis, Chan1m32IsisTestLinerateNotConstant) { + QTemporaryDir prefix; + QString cubeFileName = prefix.path() + "/chan1m32isisTEMP.cub"; + QVector args = {"from=data/chan1m32isis/linerateNotConstant/M3G20081118T223204_V03_L1B_cropped.LBL", + "to=" + cubeFileName }; + + UserInterface options(APP_XML, args); + try { + chan1m32isis(options); + } + catch (IException &e) { + FAIL() << "Unable to ingest Chandrayaan image: " << e.toString().toStdString().c_str() << std::endl; + } + Cube cube(cubeFileName); + Pvl *isisLabel = cube.label(); + + // Instrument Group + PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); + ASSERT_EQ(inst["SpacecraftYawDirection"][0].toStdString(), "FORWARD" ); + ASSERT_EQ(inst["OrbitLimbDirection"][0].toStdString(), "DESCENDING" ); + + // Archive Group + PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); + ASSERT_EQ(archive["ProductId"][0].toStdString(), "M3G20081118T223204_V03_RDN" ); + ASSERT_EQ(archive["SourceProductId"][0].toStdString(), "M3G20081118T223204_V01_L0.IMG" ); + ASSERT_EQ(archive["ProductType"][0].toStdString(), "CALIBRATED_IMAGE" ); + // Kernels Group + PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); + ASSERT_EQ(int(kernel["NaifFrameCode"]), -86520); + + std::unique_ptr hist (cube.histogram()); + + ASSERT_NEAR(hist->Average(), 757.2527, .0001); + ASSERT_NEAR(hist->Sum(), 1151024.22573, .00001); + ASSERT_EQ(hist->ValidPixels(), 1520); + ASSERT_NEAR(hist->StandardDeviation(), 152.55850, .00001); +} + + + +TEST(Chan1m32Isis, Chan1m32IsisTestL0) { + QTemporaryDir prefix; + QString cubeFileName = prefix.path() + "/chan1m32isisTEMP.cub"; + QVector args = {"from=data/chan1m32isis/l0/M3G20090106T113423_V01_L0_cropped.LBL", + "to=" + cubeFileName }; + + UserInterface options(APP_XML, args); + try { + chan1m32isis(options); + } + catch (IException &e) { + FAIL() << "Unable to ingest Chandrayaan image: " << e.toString().toStdString().c_str() << std::endl; + } + Cube cube(cubeFileName); + Pvl *isisLabel = cube.label(); + + // Dimensions Group + PvlGroup &dimensions = isisLabel->findGroup("Dimensions", Pvl::Traverse); + ASSERT_EQ(int(dimensions["Samples"]), 320); + ASSERT_EQ(int(dimensions["Lines"]), 5); + ASSERT_EQ(int(dimensions["Bands"]), 3); + + // Pixels Group + PvlGroup &pixels = isisLabel->findGroup("Pixels", Pvl::Traverse); + ASSERT_EQ(pixels["Type"][0].toStdString(), "SignedWord"); + ASSERT_EQ(pixels["ByteOrder"][0].toStdString(), "Lsb"); + ASSERT_EQ(double(pixels["Base"]), 0.0); + ASSERT_EQ(double(pixels["Multiplier"]), 1.0); + + // Instrument Group + PvlGroup &inst = isisLabel->findGroup("Instrument", Pvl::Traverse); + ASSERT_EQ(inst["SpacecraftName"][0].toStdString(), "CHANDRAYAAN-1"); + ASSERT_EQ(inst["InstrumentId"][0].toStdString(), "M3" ); + ASSERT_EQ(inst["TargetName"][0].toStdString(), "MOON" ); + ASSERT_EQ(inst["SpacecraftClockStartCount"][0].toStdString(), "4/1165041.799" ); + ASSERT_EQ(inst["SpacecraftClockStopCount"][0].toStdString(), "4/1165065" ); + ASSERT_DOUBLE_EQ(double(inst["LineExposureDuration"]), 101.76); + ASSERT_DOUBLE_EQ(double(inst["SpatialSumming"]), 2); + ASSERT_EQ(inst["StartTime"][0].toStdString(), "2009-01-06T11:34:23" ); + ASSERT_EQ(inst["StopTime"][0].toStdString(), "2009-01-06T11:34:47" ); + ASSERT_EQ(inst["SpacecraftYawDirection"][0].toStdString(), "UNKNOWN" ); + ASSERT_EQ(inst["OrbitLimbDirection"][0].toStdString(), "UNKNOWN" ); + + // Archive Group + PvlGroup &archive = isisLabel->findGroup("Archive", Pvl::Traverse); + ASSERT_EQ(archive["ProductId"][0].toStdString(), "M3G20090106T113423_V01_L0" ); + ASSERT_EQ(archive["ProductType"][0].toStdString(), "RAW_IMAGE" ); + + // BandBin Group + // Check size, first, 2 middle, and last values? Enough? + PvlGroup &bandbin = isisLabel->findGroup("BandBin", Pvl::Traverse); + ASSERT_EQ(bandbin["Center"].size(), 85); + ASSERT_EQ(bandbin["FilterNumber"].size(), 85); + ASSERT_EQ(bandbin["OriginalBand"].size(), 85); + + ASSERT_DOUBLE_EQ(bandbin["Center"][0].toDouble(), 460.990); + ASSERT_DOUBLE_EQ(bandbin["Center"][21].toDouble(), 1009.95); + ASSERT_DOUBLE_EQ(bandbin["Center"][42].toDouble(), 1429.15); + ASSERT_DOUBLE_EQ(bandbin["Center"][84].toDouble(), 2976.20); + + ASSERT_DOUBLE_EQ(bandbin["FilterNumber"][0].toDouble(), 5); + ASSERT_DOUBLE_EQ(bandbin["FilterNumber"][21].toDouble(), 57); + ASSERT_DOUBLE_EQ(bandbin["FilterNumber"][42].toDouble(), 99); + ASSERT_DOUBLE_EQ(bandbin["FilterNumber"][84].toDouble(), 253); + + ASSERT_DOUBLE_EQ(bandbin["OriginalBand"][0].toDouble(), 1); + ASSERT_DOUBLE_EQ(bandbin["OriginalBand"][21].toDouble(), 22); + ASSERT_DOUBLE_EQ(bandbin["OriginalBand"][42].toDouble(), 43); + ASSERT_DOUBLE_EQ(bandbin["OriginalBand"][84].toDouble(), 85); + + // Kernels Group + PvlGroup &kernel = isisLabel->findGroup("Kernels", Pvl::Traverse); + ASSERT_EQ(int(kernel["NaifFrameCode"]), -86520); + + std::unique_ptr hist (cube.histogram()); + + ASSERT_NEAR(hist->Average(), 776.031, .001); + ASSERT_EQ(hist->Sum(), 1241649); + ASSERT_EQ(hist->ValidPixels(), 1600); + ASSERT_NEAR(hist->StandardDeviation(), 449.337, .001); +} + + +TEST(Chan1m32Isis, Chan1m32IsisTestBadFile) { + QTemporaryDir prefix; + QString cubeFileName = prefix.path() + "/chan1m32isisTEMP.cub"; + QVector args = {"from=data/kaguyatc2isis/TC1S2B0_01_05186N225E0040_mini.lbl", + "to=" + cubeFileName }; + + UserInterface options(APP_XML, args); + try{ + chan1m32isis(options); + FAIL() << "Should throw an exception" << std::endl; + } + catch (IException &e){ + EXPECT_THAT(e.what(), HasSubstr("PVL Keyword [PRODUCT_TYPE] does not exist in [Object = Root] in file")); + } +} diff --git a/isis/tests/data/chan1m32isis/forwardAscending/M3T20090630T083407_V03_L1B_cropped.LBL b/isis/tests/data/chan1m32isis/forwardAscending/M3T20090630T083407_V03_L1B_cropped.LBL new file mode 100644 index 0000000000..59c2369d64 --- /dev/null +++ b/isis/tests/data/chan1m32isis/forwardAscending/M3T20090630T083407_V03_L1B_cropped.LBL @@ -0,0 +1,178 @@ +PDS_VERSION_ID = PDS3 +LABEL_REVISION_NOTE = "2009-01-26, S. Lundeen, 2010-12-07, S. Lundeen, 2011-09-20, S. Lundeen" +DATA_SET_ID = CH1-ORB-L-M3-4-L1B-RADIANCE-V3.0 +PRODUCT_ID = M3T20090630T083407_V03_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 = 2009-05-10T18:01:10 +START_TIME = 2009-06-30T08:34:07 +STOP_TIME = 2009-06-30T08:34:36 +SPACECRAFT_CLOCK_START_COUNT = 12/1759028.348 +SPACECRAFT_CLOCK_STOP_COUNT = 12/1759056.993 +ORBIT_NUMBER = 2804 +PRODUCT_VERSION_TYPE = ACTUAL +PRODUCT_VERSION_ID = "3.0" +SOURCE_PRODUCT_ID = M3T20090630T083407_V01_L0.IMG +PRODUCER_INSTITUTION_NAME = "JET PROPULSION LABORATORY" +SOFTWARE_NAME = m3t_l1b_v07.exe +SOFTWARE_VERSION_ID = "07" +DESCRIPTION = "M3 Level 1B data product which contains pixel located, radiometrically-calibrated data." +SOLAR_DISTANCE = 1.01711556761 +INSTRUMENT_MODE_ID = TARGET +DETECTOR_TEMPERATURE = 161.99 +CH1:SWATH_WIDTH = 608 +CH1:SWATH_LENGTH = 564 +CH1:SPACECRAFT_YAW_DIRECTION = FORWARD +CH1:ORBIT_LIMB_DIRECTION = ASCENDING +SPACECRAFT_ORIENTATION = (N/A, N/A, N/A) +CH1:INITIAL_SC_ORIENTATION = (0.233580805487, 2.281265294933, 4.003902254047) +CH1:SC_ORIENTATION_EPOCH_TDB_TIME = 299617824.351 +CH1:SC_ORIENTATION_RATE = (N/A, N/A, N/A) +CH1:SC_ROTATION_AXIS_VECTOR = (0.049715054267, -0.997329135941, 0.053507083471) +CH1:SC_ROTATION_RATE = 0.046843426581 +^DESCRIPTION = L1B_NAV_DESC.ASC +CH1:SPECTRAL_CALIBRATION_FILE_NAME = M3T20070912_RDN_SPC.TAB +CH1:RAD_GAIN_FACTOR_FILE_NAME = M3T20070912_RDN_GAIN.TAB +Object = RDN_FILE + ^RDN_IMAGE = M3T20090630T083407_V03_RDN_cropped.IMG + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 7296 + FILE_RECORDS = 5 + Object = RDN_IMAGE + LINES = 5 + LINE_SAMPLES = 608 + SAMPLE_TYPE = PC_REAL + SAMPLE_BITS = 32 + UNIT = "W/(m^2 um sr)" + BANDS = 3 + BAND_STORAGE_TYPE = LINE_INTERLEAVED + LINE_DISPLAY_DIRECTION = DOWN + SAMPLE_DISPLAY_DIRECTION = RIGHT + End_Object +End_Object +Object = RDN_HDR_FILE + ^RDN_ENVI_HEADER = M3T20090630T083407_V03_RDN.HDR + RECORD_TYPE = VARIABLE_LENGTH + FILE_RECORDS = 803 + Object = RDN_ENVI_HEADER + INTERCHANGE_FORMAT = ASCII + BYTES = 25037 + HEADER_TYPE = ENVI + DESCRIPTION = "Header file for compatibility with the commercial software package ENVI." + End_Object +End_Object +Object = LOC_FILE + ^LOC_IMAGE = M3T20090630T083407_V03_LOC_cropped.IMG + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 14592 + FILE_RECORDS = 5 + Object = LOC_IMAGE + LINES = 5 + LINE_SAMPLES = 608 + SAMPLE_TYPE = PC_REAL + SAMPLE_BITS = 64 + BANDS = 3 + BAND_STORAGE_TYPE = LINE_INTERLEAVED + BAND_NAME = (Longitude, Latitude, Radius) + LINE_DISPLAY_DIRECTION = DOWN + SAMPLE_DISPLAY_DIRECTION = RIGHT + End_Object +End_Object +Object = LOC_HDR_FILE + ^LOC_ENVI_HEADER = M3T20090630T083407_V03_LOC.HDR + RECORD_TYPE = VARIABLE_LENGTH + FILE_RECORDS = 16 + Object = LOC_ENVI_HEADER + INTERCHANGE_FORMAT = ASCII + BYTES = 371 + HEADER_TYPE = ENVI + DESCRIPTION = "Header file for compatibility with the commercial software package ENVI." + End_Object +End_Object +Object = OBS_FILE + ^OBS_IMAGE = M3T20090630T083407_V03_OBS_cropped.IMG + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 24320 + FILE_RECORDS = 5 + Object = OBS_IMAGE + LINES = 5 + LINE_SAMPLES = 608 + SAMPLE_TYPE = PC_REAL + SAMPLE_BITS = 32 + BANDS = 10 + 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 +End_Object +Object = OBS_HDR_FILE + ^OBS_ENVI_HEADER = M3T20090630T083407_V03_OBS.HDR + RECORD_TYPE = VARIABLE_LENGTH + FILE_RECORDS = 21 + Object = OBS_ENVI_HEADER + INTERCHANGE_FORMAT = ASCII + BYTES = 706 + HEADER_TYPE = ENVI + DESCRIPTION = "Header file for compatibility with the commercial software package ENVI." + End_Object +End_Object +Object = UTC_FILE + ^UTC_TIME_TABLE = M3T20090630T083407_V03_TIM_cropped.TAB + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 57 + FILE_RECORDS = 5 + Object = UTC_TIME_TABLE + NAME = "UTC OBSERVATION TIMING DATA" + INTERCHANGE_FORMAT = ASCII + ROWS = 5 + 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 + 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 + 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 + 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 + End_Object +End_Object +End \ No newline at end of file diff --git a/isis/tests/data/chan1m32isis/forwardAscending/M3T20090630T083407_V03_LOC_cropped.IMG b/isis/tests/data/chan1m32isis/forwardAscending/M3T20090630T083407_V03_LOC_cropped.IMG new file mode 100644 index 0000000000..40eb1e62b9 Binary files /dev/null and b/isis/tests/data/chan1m32isis/forwardAscending/M3T20090630T083407_V03_LOC_cropped.IMG differ diff --git a/isis/tests/data/chan1m32isis/forwardAscending/M3T20090630T083407_V03_OBS_cropped.IMG b/isis/tests/data/chan1m32isis/forwardAscending/M3T20090630T083407_V03_OBS_cropped.IMG new file mode 100644 index 0000000000..018afdfd8e Binary files /dev/null and b/isis/tests/data/chan1m32isis/forwardAscending/M3T20090630T083407_V03_OBS_cropped.IMG differ diff --git a/isis/tests/data/chan1m32isis/forwardAscending/M3T20090630T083407_V03_RDN_cropped.IMG b/isis/tests/data/chan1m32isis/forwardAscending/M3T20090630T083407_V03_RDN_cropped.IMG new file mode 100644 index 0000000000..da7f6dfd51 Binary files /dev/null and b/isis/tests/data/chan1m32isis/forwardAscending/M3T20090630T083407_V03_RDN_cropped.IMG differ diff --git a/isis/tests/data/chan1m32isis/forwardAscending/M3T20090630T083407_V03_TIM_cropped.TAB b/isis/tests/data/chan1m32isis/forwardAscending/M3T20090630T083407_V03_TIM_cropped.TAB new file mode 100644 index 0000000000..0932173a4e --- /dev/null +++ b/isis/tests/data/chan1m32isis/forwardAscending/M3T20090630T083407_V03_TIM_cropped.TAB @@ -0,0 +1,5 @@ + 1 2009-06-30T08:34:35.653371 2009 180.357357101487 + 2 2009-06-30T08:34:35.602491 2009 180.357356512598 + 3 2009-06-30T08:34:35.551611 2009 180.357355923710 + 4 2009-06-30T08:34:35.500731 2009 180.357355334822 + 5 2009-06-30T08:34:35.449851 2009 180.357354745933 diff --git a/isis/tests/data/chan1m32isis/forwardDescending/M3G20081129T171431_V03_L1B_cropped.LBL b/isis/tests/data/chan1m32isis/forwardDescending/M3G20081129T171431_V03_L1B_cropped.LBL new file mode 100644 index 0000000000..bf82b44d2f --- /dev/null +++ b/isis/tests/data/chan1m32isis/forwardDescending/M3G20081129T171431_V03_L1B_cropped.LBL @@ -0,0 +1,179 @@ +PDS_VERSION_ID = PDS3 +LABEL_REVISION_NOTE = "2009-01-26, S. Lundeen, 2011-01-07, S. Lundeen, 2011-09-13, S. Lundeen" +DATA_SET_ID = CH1-ORB-L-M3-4-L1B-RADIANCE-V3.0 +PRODUCT_ID = M3G20081129T171431_V03_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 = 2011-08-31T08:37:51 +START_TIME = 2008-11-29T17:14:31 +STOP_TIME = 2008-11-29T17:14:57 +SPACECRAFT_CLOCK_START_COUNT = 2/1531046.592 +SPACECRAFT_CLOCK_STOP_COUNT = 2/1531072.338 +ORBIT_NUMBER = 255 +PRODUCT_VERSION_TYPE = ACTUAL +PRODUCT_VERSION_ID = "3.0" +SOURCE_PRODUCT_ID = M3G20081129T171431_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." +SOLAR_DISTANCE = 0.983748796177 +INSTRUMENT_MODE_ID = GLOBAL +DETECTOR_TEMPERATURE = 166.33 +CH1:SWATH_WIDTH = 304 +CH1:SWATH_LENGTH = 251 +CH1:SPACECRAFT_YAW_DIRECTION = FORWARD +CH1:ORBIT_LIMB_DIRECTION = DESCENDING +SPACECRAFT_ORIENTATION = (0.2723441, 0.27166598, 1.1200135) +CH1:INITIAL_SC_ORIENTATION = (N/A, N/A, N/A) +CH1:SC_ORIENTATION_EPOCH_TDB_TIME = N/A +CH1:SC_ORIENTATION_RATE = (N/A, N/A, N/A) +CH1:SC_ROTATION_AXIS_VECTOR = (N/A, N/A, N/A) +CH1:SC_ROTATION_RATE = N/A +^DESCRIPTION = L1B_NAV_DESC.ASC +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 +Object = RDN_FILE + ^RDN_IMAGE = M3G20081129T171431_V03_RDN_cropped.IMG + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 3648 + FILE_RECORDS = 5 + Object = RDN_IMAGE + LINES = 5 + LINE_SAMPLES = 304 + SAMPLE_TYPE = PC_REAL + SAMPLE_BITS = 32 + UNIT = "W/(m^2 um sr)" + BANDS = 3 + BAND_STORAGE_TYPE = LINE_INTERLEAVED + LINE_DISPLAY_DIRECTION = DOWN + SAMPLE_DISPLAY_DIRECTION = RIGHT + End_Object +End_Object +Object = RDN_HDR_FILE + ^RDN_ENVI_HEADER = M3G20081129T171431_V03_RDN.HDR + RECORD_TYPE = VARIABLE_LENGTH + FILE_RECORDS = 1146 + Object = RDN_ENVI_HEADER + INTERCHANGE_FORMAT = ASCII + BYTES = 35648 + HEADER_TYPE = ENVI + DESCRIPTION = "Header file for compatibility with the commercial software package ENVI." + End_Object +End_Object +Object = LOC_FILE + ^LOC_IMAGE = M3G20081129T171431_V03_LOC_cropped.IMG + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 7296 + FILE_RECORDS = 5 + Object = LOC_IMAGE + LINES = 5 + LINE_SAMPLES = 304 + SAMPLE_TYPE = PC_REAL + SAMPLE_BITS = 64 + BANDS = 3 + BAND_STORAGE_TYPE = LINE_INTERLEAVED + BAND_NAME = (Longitude, Latitude, Radius) + LINE_DISPLAY_DIRECTION = DOWN + SAMPLE_DISPLAY_DIRECTION = RIGHT + End_Object +End_Object +Object = LOC_HDR_FILE + ^LOC_ENVI_HEADER = M3G20081129T171431_V03_LOC.HDR + RECORD_TYPE = VARIABLE_LENGTH + FILE_RECORDS = 16 + Object = LOC_ENVI_HEADER + INTERCHANGE_FORMAT = ASCII + BYTES = 371 + HEADER_TYPE = ENVI + DESCRIPTION = "Header file for compatibility with the commercial software package ENVI." + End_Object +End_Object +Object = OBS_FILE + ^OBS_IMAGE = M3G20081129T171431_V03_OBS_cropped.IMG + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 12160 + FILE_RECORDS = 5 + Object = OBS_IMAGE + LINES = 5 + LINE_SAMPLES = 304 + SAMPLE_TYPE = PC_REAL + SAMPLE_BITS = 32 + BANDS = 10 + 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 +End_Object +Object = OBS_HDR_FILE + ^OBS_ENVI_HEADER = M3G20081129T171431_V03_OBS.HDR + RECORD_TYPE = VARIABLE_LENGTH + FILE_RECORDS = 21 + Object = OBS_ENVI_HEADER + INTERCHANGE_FORMAT = ASCII + BYTES = 706 + HEADER_TYPE = ENVI + DESCRIPTION = "Header file for compatibility with the commercial software package ENVI." + End_Object +End_Object +Object = UTC_FILE + ^UTC_TIME_TABLE = M3G20081129T171431_V03_TIM_cropped.TAB + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 57 + FILE_RECORDS = 5 + Object = UTC_TIME_TABLE + NAME = "UTC OBSERVATION TIMING DATA" + INTERCHANGE_FORMAT = ASCII + ROWS = 5 + 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 + 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 + 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 + 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 + End_Object +End_Object +End \ No newline at end of file diff --git a/isis/tests/data/chan1m32isis/forwardDescending/M3G20081129T171431_V03_LOC_cropped.IMG b/isis/tests/data/chan1m32isis/forwardDescending/M3G20081129T171431_V03_LOC_cropped.IMG new file mode 100644 index 0000000000..00811482b8 Binary files /dev/null and b/isis/tests/data/chan1m32isis/forwardDescending/M3G20081129T171431_V03_LOC_cropped.IMG differ diff --git a/isis/tests/data/chan1m32isis/forwardDescending/M3G20081129T171431_V03_OBS_cropped.IMG b/isis/tests/data/chan1m32isis/forwardDescending/M3G20081129T171431_V03_OBS_cropped.IMG new file mode 100644 index 0000000000..b474149952 Binary files /dev/null and b/isis/tests/data/chan1m32isis/forwardDescending/M3G20081129T171431_V03_OBS_cropped.IMG differ diff --git a/isis/tests/data/chan1m32isis/forwardDescending/M3G20081129T171431_V03_RDN_cropped.IMG b/isis/tests/data/chan1m32isis/forwardDescending/M3G20081129T171431_V03_RDN_cropped.IMG new file mode 100644 index 0000000000..bed155ea5e Binary files /dev/null and b/isis/tests/data/chan1m32isis/forwardDescending/M3G20081129T171431_V03_RDN_cropped.IMG differ diff --git a/isis/tests/data/chan1m32isis/forwardDescending/M3G20081129T171431_V03_TIM_cropped.TAB b/isis/tests/data/chan1m32isis/forwardDescending/M3G20081129T171431_V03_TIM_cropped.TAB new file mode 100644 index 0000000000..d6db8c1c1b --- /dev/null +++ b/isis/tests/data/chan1m32isis/forwardDescending/M3G20081129T171431_V03_TIM_cropped.TAB @@ -0,0 +1,5 @@ + 1 2008-11-29T17:14:29.780687 2008 333.718400229561 + 2 2008-11-29T17:14:29.882447 2008 333.718401407338 + 3 2008-11-29T17:14:29.984207 2008 333.718402585115 + 4 2008-11-29T17:14:30.085967 2008 333.718403762892 + 5 2008-11-29T17:14:30.187727 2008 333.718404940670 diff --git a/isis/tests/data/chan1m32isis/l0/M3G20090106T113423_V01_L0_cropped.IMG b/isis/tests/data/chan1m32isis/l0/M3G20090106T113423_V01_L0_cropped.IMG new file mode 100644 index 0000000000..97a064d7cb Binary files /dev/null and b/isis/tests/data/chan1m32isis/l0/M3G20090106T113423_V01_L0_cropped.IMG differ diff --git a/isis/tests/data/chan1m32isis/l0/M3G20090106T113423_V01_L0_cropped.LBL b/isis/tests/data/chan1m32isis/l0/M3G20090106T113423_V01_L0_cropped.LBL new file mode 100644 index 0000000000..d60ff26ced --- /dev/null +++ b/isis/tests/data/chan1m32isis/l0/M3G20090106T113423_V01_L0_cropped.LBL @@ -0,0 +1,69 @@ +PDS_VERSION_ID = PDS3 +LABEL_REVISION_NOTE = "2010-02-09, S. Lundeen" +DATA_SET_ID = CH1-ORB-L-M3-2-L0-RAW-V1.0 +PRODUCT_ID = M3G20090106T113423_V01_L0 +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 = RAW_IMAGE +PRODUCT_CREATION_TIME = 2009-06-10T05:03:42 +START_TIME = 2009-01-06T11:34:23 +STOP_TIME = 2009-01-06T11:34:47 +SPACECRAFT_CLOCK_START_COUNT = 4/1165041.799 +SPACECRAFT_CLOCK_STOP_COUNT = 4/1165065 +ORBIT_NUMBER = 710 +PRODUCT_VERSION_TYPE = PRELIMINARY +PRODUCER_INSTITUTION_NAME = "JET PROPULSION LABORATORY" +SOFTWARE_NAME = m3_igds_l0_v18.pl +SOFTWARE_VERSION_ID = "18" +DESCRIPTION = "M3 Level 0 data product which consists of raw science data, reassembled into time-sequenced data in units of digital numbers." +INSTRUMENT_MODE_ID = GLOBAL +DETECTOR_TEMPERATURE = 161.26 +CH1:SWATH_WIDTH = 320 +CH1:SWATH_LENGTH = 229 +Object = L0_FILE + ^L0_LINE_PREFIX_TABLE = M3G20090106T113423_V01_L0.IMG + ^L0_IMAGE = M3G20090106T113423_V01_L0_cropped.IMG + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 1920 + FILE_RECORDS = 5 + Object = L0_LINE_PREFIX_TABLE + INTERCHANGE_FORMAT = BINARY + ROWS = 229 + COLUMNS = 9 + ROW_BYTES = 1280 + ROW_SUFFIX_BYTES = 55040 + ^STRUCTURE = LN_PRFX_HDR.FMT + End_Object + Object = L0_IMAGE + LINES = 5 + LINE_SAMPLES = 320 + LINE_PREFIX_BYTES = 1280 + SAMPLE_TYPE = LSB_INTEGER + SAMPLE_BITS = 16 + UNIT = DN + BANDS = 3 + BAND_STORAGE_TYPE = LINE_INTERLEAVED + LINE_DISPLAY_DIRECTION = DOWN + SAMPLE_DISPLAY_DIRECTION = RIGHT + End_Object +End_Object +Object = L0_HDR_FILE + ^L0_ENVI_HEADER = M3G20090106T113423_V01_L0.HDR + RECORD_TYPE = VARIABLE_LENGTH + FILE_RECORDS = 11 + Object = L0_ENVI_HEADER + INTERCHANGE_FORMAT = ASCII + BYTES = 304 + HEADER_TYPE = ENVI + DESCRIPTION = "Header file for compatibility with the commercial software package ENVI." + End_Object +End_Object +End \ No newline at end of file diff --git a/isis/tests/data/chan1m32isis/linerateNotConstant/M3G20081118T223204_V03_L1B_cropped.LBL b/isis/tests/data/chan1m32isis/linerateNotConstant/M3G20081118T223204_V03_L1B_cropped.LBL new file mode 100644 index 0000000000..5f34fda66f --- /dev/null +++ b/isis/tests/data/chan1m32isis/linerateNotConstant/M3G20081118T223204_V03_L1B_cropped.LBL @@ -0,0 +1,179 @@ +PDS_VERSION_ID = PDS3 +LABEL_REVISION_NOTE = "2009-01-26, S. Lundeen, 2011-01-07, S. Lundeen, 2011-09-13, S. Lundeen" +DATA_SET_ID = CH1-ORB-L-M3-4-L1B-RADIANCE-V3.0 +PRODUCT_ID = M3G20081118T223204_V03_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 = 2011-08-31T08:37:51 +START_TIME = 2008-11-18T22:32:04 +STOP_TIME = 2008-11-18T22:34:04 +SPACECRAFT_CLOCK_START_COUNT = 2/599698.948 +SPACECRAFT_CLOCK_STOP_COUNT = 2/599818.922 +ORBIT_NUMBER = 141 +PRODUCT_VERSION_TYPE = ACTUAL +PRODUCT_VERSION_ID = "3.0" +SOURCE_PRODUCT_ID = M3G20081118T223204_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." +SOLAR_DISTANCE = 0.988782667461 +INSTRUMENT_MODE_ID = GLOBAL +DETECTOR_TEMPERATURE = 173.47 +CH1:SWATH_WIDTH = 304 +CH1:SWATH_LENGTH = 1180 +CH1:SPACECRAFT_YAW_DIRECTION = FORWARD +CH1:ORBIT_LIMB_DIRECTION = DESCENDING +SPACECRAFT_ORIENTATION = (0.77044346, -0.22931498, 0.50471716) +CH1:INITIAL_SC_ORIENTATION = (N/A, N/A, N/A) +CH1:SC_ORIENTATION_EPOCH_TDB_TIME = N/A +CH1:SC_ORIENTATION_RATE = (N/A, N/A, N/A) +CH1:SC_ROTATION_AXIS_VECTOR = (N/A, N/A, N/A) +CH1:SC_ROTATION_RATE = N/A +^DESCRIPTION = L1B_NAV_DESC.ASC +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 +Object = RDN_FILE + ^RDN_IMAGE = M3G20081118T223204_V03_RDN_cropped.IMG + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 3648 + FILE_RECORDS = 5 + Object = RDN_IMAGE + LINES = 5 + LINE_SAMPLES = 304 + SAMPLE_TYPE = PC_REAL + SAMPLE_BITS = 32 + UNIT = "W/(m^2 um sr)" + BANDS = 3 + BAND_STORAGE_TYPE = LINE_INTERLEAVED + LINE_DISPLAY_DIRECTION = DOWN + SAMPLE_DISPLAY_DIRECTION = RIGHT + End_Object +End_Object +Object = RDN_HDR_FILE + ^RDN_ENVI_HEADER = M3G20081118T223204_V03_RDN.HDR + RECORD_TYPE = VARIABLE_LENGTH + FILE_RECORDS = 1146 + Object = RDN_ENVI_HEADER + INTERCHANGE_FORMAT = ASCII + BYTES = 35657 + HEADER_TYPE = ENVI + DESCRIPTION = "Header file for compatibility with the commercial software package ENVI." + End_Object +End_Object +Object = LOC_FILE + ^LOC_IMAGE = M3G20081118T223204_V03_LOC_cropped.IMG + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 7296 + FILE_RECORDS = 5 + Object = LOC_IMAGE + LINES = 5 + LINE_SAMPLES = 304 + SAMPLE_TYPE = PC_REAL + SAMPLE_BITS = 64 + BANDS = 3 + BAND_STORAGE_TYPE = LINE_INTERLEAVED + BAND_NAME = (Longitude, Latitude, Radius) + LINE_DISPLAY_DIRECTION = DOWN + SAMPLE_DISPLAY_DIRECTION = RIGHT + End_Object +End_Object +Object = LOC_HDR_FILE + ^LOC_ENVI_HEADER = M3G20081118T223204_V03_LOC.HDR + RECORD_TYPE = VARIABLE_LENGTH + FILE_RECORDS = 16 + 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 +End_Object +Object = OBS_FILE + ^OBS_IMAGE = M3G20081118T223204_V03_OBS_cropped.IMG + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 12160 + FILE_RECORDS = 5 + Object = OBS_IMAGE + LINES = 5 + LINE_SAMPLES = 304 + SAMPLE_TYPE = PC_REAL + SAMPLE_BITS = 32 + BANDS = 10 + 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 +End_Object +Object = OBS_HDR_FILE + ^OBS_ENVI_HEADER = M3G20081118T223204_V03_OBS.HDR + RECORD_TYPE = VARIABLE_LENGTH + FILE_RECORDS = 21 + 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 +End_Object +Object = UTC_FILE + ^UTC_TIME_TABLE = M3G20081118T223204_V03_TIM_cropped.TAB + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 57 + FILE_RECORDS = 5 + Object = UTC_TIME_TABLE + NAME = "UTC OBSERVATION TIMING DATA" + INTERCHANGE_FORMAT = ASCII + ROWS = 5 + 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 + 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 + 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 + 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 + End_Object +End_Object +End \ No newline at end of file diff --git a/isis/tests/data/chan1m32isis/linerateNotConstant/M3G20081118T223204_V03_RDN_cropped.IMG b/isis/tests/data/chan1m32isis/linerateNotConstant/M3G20081118T223204_V03_RDN_cropped.IMG new file mode 100644 index 0000000000..92d0bc58ae Binary files /dev/null and b/isis/tests/data/chan1m32isis/linerateNotConstant/M3G20081118T223204_V03_RDN_cropped.IMG differ diff --git a/isis/tests/data/chan1m32isis/linerateNotConstant/M3G20081118T223204_V03_TIM_cropped.TAB b/isis/tests/data/chan1m32isis/linerateNotConstant/M3G20081118T223204_V03_TIM_cropped.TAB new file mode 100644 index 0000000000..d86a12a7b9 --- /dev/null +++ b/isis/tests/data/chan1m32isis/linerateNotConstant/M3G20081118T223204_V03_TIM_cropped.TAB @@ -0,0 +1,5 @@ + 1 2008-11-18T22:32:03.461991 2008 322.938928945601 + 2 2008-11-18T22:32:03.563749 2008 322.938930123362 + 3 2008-11-18T22:32:03.665508 2008 322.938931301123 + 4 2008-11-18T22:32:03.767267 2008 322.938932478885 + 5 2008-11-18T22:32:03.869025 2008 322.938933656646 diff --git a/isis/tests/data/chan1m32isis/reverseAscending/M3G20090423T191900_V03_L1B_cropped.LBL b/isis/tests/data/chan1m32isis/reverseAscending/M3G20090423T191900_V03_L1B_cropped.LBL new file mode 100644 index 0000000000..db57ff4fc5 --- /dev/null +++ b/isis/tests/data/chan1m32isis/reverseAscending/M3G20090423T191900_V03_L1B_cropped.LBL @@ -0,0 +1,179 @@ +PDS_VERSION_ID = PDS3 +LABEL_REVISION_NOTE = "2009-01-26, S. Lundeen, 2010-12-07, S. Lundeen, 2011-09-13, S. Lundeen" +DATA_SET_ID = CH1-ORB-L-M3-4-L1B-RADIANCE-V3.0 +PRODUCT_ID = M3G20090423T191900_V03_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 = 2011-09-01T02:15:01 +START_TIME = 2009-04-23T19:19:00 +STOP_TIME = 2009-04-23T19:19:43 +SPACECRAFT_CLOCK_START_COUNT = 9/1365722.595 +SPACECRAFT_CLOCK_STOP_COUNT = 9/1365765.843 +ORBIT_NUMBER = 2013 +PRODUCT_VERSION_TYPE = ACTUAL +PRODUCT_VERSION_ID = "3.0" +SOURCE_PRODUCT_ID = M3G20090423T191900_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." +SOLAR_DISTANCE = 1.003288249239 +INSTRUMENT_MODE_ID = GLOBAL +DETECTOR_TEMPERATURE = 151.21 +CH1:SWATH_WIDTH = 304 +CH1:SWATH_LENGTH = 426 +CH1:SPACECRAFT_YAW_DIRECTION = REVERSE +CH1:ORBIT_LIMB_DIRECTION = ASCENDING +SPACECRAFT_ORIENTATION = (0.203593734991, 0.687904954046, 181.026875788702) +CH1:INITIAL_SC_ORIENTATION = (N/A, N/A, N/A) +CH1:SC_ORIENTATION_EPOCH_TDB_TIME = N/A +CH1:SC_ORIENTATION_RATE = (N/A, N/A, N/A) +CH1:SC_ROTATION_AXIS_VECTOR = (N/A, N/A, N/A) +CH1:SC_ROTATION_RATE = N/A +^DESCRIPTION = L1B_NAV_DESC.ASC +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 +Object = RDN_FILE + ^RDN_IMAGE = M3G20090423T191900_V03_RDN_cropped.IMG + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 3648 + FILE_RECORDS = 5 + Object = RDN_IMAGE + LINES = 5 + LINE_SAMPLES = 304 + SAMPLE_TYPE = PC_REAL + SAMPLE_BITS = 32 + UNIT = "W/(m^2 um sr)" + BANDS = 3 + BAND_STORAGE_TYPE = LINE_INTERLEAVED + LINE_DISPLAY_DIRECTION = DOWN + SAMPLE_DISPLAY_DIRECTION = RIGHT + End_Object +End_Object +Object = RDN_HDR_FILE + ^RDN_ENVI_HEADER = M3G20090423T191900_V03_RDN.HDR + RECORD_TYPE = VARIABLE_LENGTH + FILE_RECORDS = 1146 + Object = RDN_ENVI_HEADER + INTERCHANGE_FORMAT = ASCII + BYTES = 35657 + HEADER_TYPE = ENVI + DESCRIPTION = "Header file for compatibility with the commercial software package ENVI." + End_Object +End_Object +Object = LOC_FILE + ^LOC_IMAGE = M3G20090423T191900_V03_LOC_cropped.IMG + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 7296 + FILE_RECORDS = 5 + Object = LOC_IMAGE + LINES = 5 + LINE_SAMPLES = 304 + SAMPLE_TYPE = PC_REAL + SAMPLE_BITS = 64 + BANDS = 3 + BAND_STORAGE_TYPE = LINE_INTERLEAVED + BAND_NAME = (Longitude, Latitude, Radius) + LINE_DISPLAY_DIRECTION = DOWN + SAMPLE_DISPLAY_DIRECTION = RIGHT + End_Object +End_Object +Object = LOC_HDR_FILE + ^LOC_ENVI_HEADER = M3G20090423T191900_V03_LOC.HDR + RECORD_TYPE = VARIABLE_LENGTH + FILE_RECORDS = 16 + Object = LOC_ENVI_HEADER + INTERCHANGE_FORMAT = ASCII + BYTES = 371 + HEADER_TYPE = ENVI + DESCRIPTION = "Header file for compatibility with the commercial software package ENVI." + End_Object +End_Object +Object = OBS_FILE + ^OBS_IMAGE = M3G20090423T191900_V03_OBS_cropped.IMG + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 12160 + FILE_RECORDS = 5 + Object = OBS_IMAGE + LINES = 5 + LINE_SAMPLES = 304 + SAMPLE_TYPE = PC_REAL + SAMPLE_BITS = 32 + BANDS = 10 + 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 +End_Object +Object = OBS_HDR_FILE + ^OBS_ENVI_HEADER = M3G20090423T191900_V03_OBS.HDR + RECORD_TYPE = VARIABLE_LENGTH + FILE_RECORDS = 21 + Object = OBS_ENVI_HEADER + INTERCHANGE_FORMAT = ASCII + BYTES = 706 + HEADER_TYPE = ENVI + DESCRIPTION = "Header file for compatibility with the commercial software package ENVI." + End_Object +End_Object +Object = UTC_FILE + ^UTC_TIME_TABLE = M3G20090423T191900_V03_TIM_cropped.TAB + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 57 + FILE_RECORDS = 5 + Object = UTC_TIME_TABLE + NAME = "UTC OBSERVATION TIMING DATA" + INTERCHANGE_FORMAT = ASCII + ROWS = 5 + 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 + 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 + 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 + 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 + End_Object +End_Object +End \ No newline at end of file diff --git a/isis/tests/data/chan1m32isis/reverseAscending/M3G20090423T191900_V03_LOC_cropped.IMG b/isis/tests/data/chan1m32isis/reverseAscending/M3G20090423T191900_V03_LOC_cropped.IMG new file mode 100644 index 0000000000..fa4825fa03 Binary files /dev/null and b/isis/tests/data/chan1m32isis/reverseAscending/M3G20090423T191900_V03_LOC_cropped.IMG differ diff --git a/isis/tests/data/chan1m32isis/reverseAscending/M3G20090423T191900_V03_OBS_cropped.IMG b/isis/tests/data/chan1m32isis/reverseAscending/M3G20090423T191900_V03_OBS_cropped.IMG new file mode 100644 index 0000000000..bd389bca4f Binary files /dev/null and b/isis/tests/data/chan1m32isis/reverseAscending/M3G20090423T191900_V03_OBS_cropped.IMG differ diff --git a/isis/tests/data/chan1m32isis/reverseAscending/M3G20090423T191900_V03_RDN_cropped.IMG b/isis/tests/data/chan1m32isis/reverseAscending/M3G20090423T191900_V03_RDN_cropped.IMG new file mode 100644 index 0000000000..022c2e1677 Binary files /dev/null and b/isis/tests/data/chan1m32isis/reverseAscending/M3G20090423T191900_V03_RDN_cropped.IMG differ diff --git a/isis/tests/data/chan1m32isis/reverseAscending/M3G20090423T191900_V03_TIM_cropped.TAB b/isis/tests/data/chan1m32isis/reverseAscending/M3G20090423T191900_V03_TIM_cropped.TAB new file mode 100644 index 0000000000..7fb5677b5d --- /dev/null +++ b/isis/tests/data/chan1m32isis/reverseAscending/M3G20090423T191900_V03_TIM_cropped.TAB @@ -0,0 +1,5 @@ + 1 2009-04-23T19:19:45.137902 2009 112.805383559362 + 2 2009-04-23T19:19:45.036142 2009 112.805382381587 + 3 2009-04-23T19:19:44.934382 2009 112.805381203811 + 4 2009-04-23T19:19:44.832622 2009 112.805380026034 + 5 2009-04-23T19:19:44.730862 2009 112.805378848258 diff --git a/isis/tests/data/chan1m32isis/reverseDescending/M3G20090106T113423_V03_L1B_cropped.LBL b/isis/tests/data/chan1m32isis/reverseDescending/M3G20090106T113423_V03_L1B_cropped.LBL new file mode 100644 index 0000000000..79f109f5de --- /dev/null +++ b/isis/tests/data/chan1m32isis/reverseDescending/M3G20090106T113423_V03_L1B_cropped.LBL @@ -0,0 +1,179 @@ +PDS_VERSION_ID = PDS3 +LABEL_REVISION_NOTE = "2009-01-26, S. Lundeen, 2011-01-07, S. Lundeen, 2011-09-13, S. Lundeen" +DATA_SET_ID = CH1-ORB-L-M3-4-L1B-RADIANCE-V3.0 +PRODUCT_ID = M3G20090106T113423_V03_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 = 2011-08-31T08:37:51 +START_TIME = 2009-01-06T11:34:23 +STOP_TIME = 2009-01-06T11:34:47 +SPACECRAFT_CLOCK_START_COUNT = 4/1165041.799 +SPACECRAFT_CLOCK_STOP_COUNT = 4/1165065 +ORBIT_NUMBER = 710 +PRODUCT_VERSION_TYPE = ACTUAL +PRODUCT_VERSION_ID = "3.0" +SOURCE_PRODUCT_ID = M3G20090106T113423_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." +SOLAR_DISTANCE = 0.984326066205 +INSTRUMENT_MODE_ID = GLOBAL +DETECTOR_TEMPERATURE = 162.07 +CH1:SWATH_WIDTH = 304 +CH1:SWATH_LENGTH = 229 +CH1:SPACECRAFT_YAW_DIRECTION = REVERSE +CH1:ORBIT_LIMB_DIRECTION = DESCENDING +SPACECRAFT_ORIENTATION = (0.36229017, 0.53293259, 180.74351) +CH1:INITIAL_SC_ORIENTATION = (N/A, N/A, N/A) +CH1:SC_ORIENTATION_EPOCH_TDB_TIME = N/A +CH1:SC_ORIENTATION_RATE = (N/A, N/A, N/A) +CH1:SC_ROTATION_AXIS_VECTOR = (N/A, N/A, N/A) +CH1:SC_ROTATION_RATE = N/A +^DESCRIPTION = L1B_NAV_DESC.ASC +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 +Object = RDN_FILE + ^RDN_IMAGE = M3G20090106T113423_V03_RDN_cropped.IMG + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 3648 + FILE_RECORDS = 5 + Object = RDN_IMAGE + LINES = 5 + LINE_SAMPLES = 304 + SAMPLE_TYPE = PC_REAL + SAMPLE_BITS = 32 + UNIT = "W/(m^2 um sr)" + BANDS = 3 + BAND_STORAGE_TYPE = LINE_INTERLEAVED + LINE_DISPLAY_DIRECTION = DOWN + SAMPLE_DISPLAY_DIRECTION = RIGHT + End_Object +End_Object +Object = RDN_HDR_FILE + ^RDN_ENVI_HEADER = M3G20090106T113423_V03_RDN.HDR + RECORD_TYPE = VARIABLE_LENGTH + FILE_RECORDS = 1146 + Object = RDN_ENVI_HEADER + INTERCHANGE_FORMAT = ASCII + BYTES = 35648 + HEADER_TYPE = ENVI + DESCRIPTION = "Header file for compatibility with the commercial software package ENVI." + End_Object +End_Object +Object = LOC_FILE + ^LOC_IMAGE = M3G20090106T113423_V03_LOC_cropped.IMG + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 7296 + FILE_RECORDS = 5 + Object = LOC_IMAGE + LINES = 5 + LINE_SAMPLES = 304 + SAMPLE_TYPE = PC_REAL + SAMPLE_BITS = 64 + BANDS = 3 + BAND_STORAGE_TYPE = LINE_INTERLEAVED + BAND_NAME = (Longitude, Latitude, Radius) + LINE_DISPLAY_DIRECTION = DOWN + SAMPLE_DISPLAY_DIRECTION = RIGHT + End_Object +End_Object +Object = LOC_HDR_FILE + ^LOC_ENVI_HEADER = M3G20090106T113423_V03_LOC.HDR + RECORD_TYPE = VARIABLE_LENGTH + FILE_RECORDS = 16 + Object = LOC_ENVI_HEADER + INTERCHANGE_FORMAT = ASCII + BYTES = 371 + HEADER_TYPE = ENVI + DESCRIPTION = "Header file for compatibility with the commercial software package ENVI." + End_Object +End_Object +Object = OBS_FILE + ^OBS_IMAGE = M3G20090106T113423_V03_OBS_cropped.IMG + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 12160 + FILE_RECORDS = 5 + Object = OBS_IMAGE + LINES = 5 + LINE_SAMPLES = 304 + SAMPLE_TYPE = PC_REAL + SAMPLE_BITS = 32 + BANDS = 10 + 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 +End_Object +Object = OBS_HDR_FILE + ^OBS_ENVI_HEADER = M3G20090106T113423_V03_OBS.HDR + RECORD_TYPE = VARIABLE_LENGTH + FILE_RECORDS = 21 + Object = OBS_ENVI_HEADER + INTERCHANGE_FORMAT = ASCII + BYTES = 706 + HEADER_TYPE = ENVI + DESCRIPTION = "Header file for compatibility with the commercial software package ENVI." + End_Object +End_Object +Object = UTC_FILE + ^UTC_TIME_TABLE = M3G20090106T113423_V03_TIM_cropped.TAB + RECORD_TYPE = FIXED_LENGTH + RECORD_BYTES = 57 + FILE_RECORDS = 5 + Object = UTC_TIME_TABLE + NAME = "UTC OBSERVATION TIMING DATA" + INTERCHANGE_FORMAT = ASCII + ROWS = 5 + 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 + 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 + 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 + 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 + End_Object +End_Object +End \ No newline at end of file diff --git a/isis/tests/data/chan1m32isis/reverseDescending/M3G20090106T113423_V03_LOC_cropped.IMG b/isis/tests/data/chan1m32isis/reverseDescending/M3G20090106T113423_V03_LOC_cropped.IMG new file mode 100644 index 0000000000..2656ee1908 Binary files /dev/null and b/isis/tests/data/chan1m32isis/reverseDescending/M3G20090106T113423_V03_LOC_cropped.IMG differ diff --git a/isis/tests/data/chan1m32isis/reverseDescending/M3G20090106T113423_V03_OBS_cropped.IMG b/isis/tests/data/chan1m32isis/reverseDescending/M3G20090106T113423_V03_OBS_cropped.IMG new file mode 100644 index 0000000000..d8f6ecec8f Binary files /dev/null and b/isis/tests/data/chan1m32isis/reverseDescending/M3G20090106T113423_V03_OBS_cropped.IMG differ diff --git a/isis/tests/data/chan1m32isis/reverseDescending/M3G20090106T113423_V03_RDN_cropped.IMG b/isis/tests/data/chan1m32isis/reverseDescending/M3G20090106T113423_V03_RDN_cropped.IMG new file mode 100644 index 0000000000..e7ac547efa Binary files /dev/null and b/isis/tests/data/chan1m32isis/reverseDescending/M3G20090106T113423_V03_RDN_cropped.IMG differ diff --git a/isis/tests/data/chan1m32isis/reverseDescending/M3G20090106T113423_V03_TIM_cropped.TAB b/isis/tests/data/chan1m32isis/reverseDescending/M3G20090106T113423_V03_TIM_cropped.TAB new file mode 100644 index 0000000000..4c7b1cf778 --- /dev/null +++ b/isis/tests/data/chan1m32isis/reverseDescending/M3G20090106T113423_V03_TIM_cropped.TAB @@ -0,0 +1,5 @@ + 1 2009-01-06T11:34:24.431536 2009 5.482227218696 + 2 2009-01-06T11:34:24.533296 2009 5.482228396473 + 3 2009-01-06T11:34:24.635056 2009 5.482229574250 + 4 2009-01-06T11:34:24.736816 2009 5.482230752026 + 5 2009-01-06T11:34:24.838576 2009 5.482231929803