Loading isis/src/newhorizons/apps/leisa2isis/leisa2isis.cpp +111 −9 Original line number Diff line number Diff line Loading @@ -24,11 +24,11 @@ void IsisMain() { UserInterface &ui = Application::GetUserInterface(); ProcessImportFits importFits; importFits.setFitsFile(FileName(ui.GetFileName("FROM"))); PvlGroup mainLabel; mainLabel = importFits.fitsLabel(0); // Get the first label and make sure this is a New Horizons LEISA file PvlGroup mainLabel = importFits.fitsLabel(0); if (!mainLabel.hasKeyword("MISSION") || !mainLabel.hasKeyword("INSTRU") || mainLabel["MISSION"][0] != "New Horizons" || mainLabel["INSTRU"][0] != "lei") { QString msg = QObject::tr("Input file [%1] does not appear to be a New Horizons LEISA FITS " Loading @@ -39,7 +39,70 @@ void IsisMain() { throw IException(IException::User, msg, _FILEINFO_); } // This is a seven-extension fits file. Only import the primary image for now. // Check to see if the error image was requested from the FITS file and // that it has the corresponding extension if (ui.WasEntered("ERRORMAP")) { PvlGroup extensionLabel = importFits.fitsLabel(5); try { extensionLabel = importFits.fitsLabel(5); } catch (IException &e) { QString msg = QObject::tr("Input file [%1] does not appear to be a calibrated New Horizons " "LEISA FITS file. There is no errormap " "extension").arg(ui.GetFileName("FROM")); throw IException(e, IException::Unknown, msg, _FILEINFO_); } if (!extensionLabel.hasKeyword("EXTNAME")) { QString msg = QObject::tr("Input file [%1] does not appear to contain a New Horizons LEISA " "calibrated image. FITS label keyword EXTNAME is missing"). arg(ui.GetFileName("FROM")); throw IException(IException::User, msg, _FILEINFO_); } else if (extensionLabel["EXTNAME"][0] != "ERRORMAP") { QString msg = QObject::tr("Input file [%1] does not appear to contain a New Horizons LEISA " "calibrated image. FITS label value for EXTNAME is [%2]"). arg(ui.GetFileName("FROM")).arg(extensionLabel["EXTNAME"][0]); throw IException(IException::User, msg, _FILEINFO_); } } // Check to see if the quality image was requested from the FITS file and // that it has the corresponding extension if (ui.WasEntered("QUALITY")) { PvlGroup extensionLabel = importFits.fitsLabel(6); try { extensionLabel = importFits.fitsLabel(6); } catch (IException &e) { QString msg = QObject::tr("Input file [%1] does not appear to be a calibrated New Horizons " "LEISA FITS file. There is no quality " "extension").arg(ui.GetFileName("FROM")); throw IException(e, IException::Unknown, msg, _FILEINFO_); } if (!extensionLabel.hasKeyword("EXTNAME")) { QString msg = QObject::tr("Input file [%1] does not appear to contain a New Horizons LEISA " "calibrated image. FITS label keyword EXTNAME is missing"). arg(ui.GetFileName("FROM")); throw IException(IException::User, msg, _FILEINFO_); } else if (extensionLabel["EXTNAME"][0] != "QUALITY") { QString msg = QObject::tr("Input file [%1] does not appear to contain a New Horizons LEISA " "calibrated image. FITS label value for EXTNAME is [%2]"). arg(ui.GetFileName("FROM")).arg(extensionLabel["EXTNAME"][0]); throw IException(IException::User, msg, _FILEINFO_); } } // Import the primary image (LEISA raw/calibrated) importFits.SetOrganization(ProcessImport::BIL); importFits.setProcessFileStructure(0); Loading @@ -56,11 +119,8 @@ void IsisMain() { Pvl fitsLabel; fitsLabel.addGroup(importFits.fitsLabel(0)); // add in label processing later // Create an Instrument group // FileName insTransFile(transDir + "leisaInstrument_fit.trn");//need to create this file FileName insTransFile("./leisaInstrument_fit.trn");//need to create this file FileName insTransFile(transDir + "leisaInstrument_fit.trn"); PvlTranslationManager insXlater(fitsLabel, insTransFile.expanded()); insXlater.Auto(outLabel); Loading @@ -86,8 +146,8 @@ void IsisMain() { output->putGroup(outLabel.findGroup("Archive", Pvl::Traverse)); */ // Create a Kernels group // FileName kernelsTransFile(transDir + "leisaKernels_fit.trn"); FileName kernelsTransFile("./leisaKernels_fit.trn"); FileName kernelsTransFile(transDir + "leisaKernels_fit.trn"); // FileName kernelsTransFile("./leisaKernels_fit.trn"); PvlTranslationManager kernelsXlater(fitsLabel, kernelsTransFile.expanded()); kernelsXlater.Auto(outLabel); output->putGroup(outLabel.findGroup("Kernels", Pvl::Traverse)); Loading Loading @@ -126,6 +186,48 @@ void IsisMain() { importFits.StartProcess(); importFits.ClearCubes(); importFits.Finalize(); // Import the ERRORMAP image. It is the 6th image in the FITS file (i.e., 5th extension) if (ui.WasEntered("ERRORMAP")) { PvlGroup extensionLabel = importFits.fitsLabel(5); importFits.SetOrganization(ProcessImport::BSQ); importFits.setProcessFileStructure(5); Cube *output = importFits.SetOutputCube("ERRORMAP"); // Save the input FITS label in the Cube original labels Pvl origLabel; origLabel += extensionLabel; OriginalLabel originals(origLabel); output->write(originals); // Convert the main image data importFits.Progress()->SetText("Importing LEISA errormap image"); importFits.StartProcess(); importFits.ClearCubes(); } // Import the quality image. It is the 7th image in the FITS file (i.e., 6th extension) if (ui.WasEntered("QUALITY")) { PvlGroup extensionLabel = importFits.fitsLabel(6); importFits.SetOrganization(ProcessImport::BSQ); importFits.setProcessFileStructure(6); Cube *output = importFits.SetOutputCube("QUALITY"); // Save the input FITS label in the Cube original labels Pvl origLabel; origLabel += extensionLabel; OriginalLabel originals(origLabel); output->write(originals); // Convert the main image data importFits.Progress()->SetText("Importing LEISA quality image"); importFits.StartProcess(); importFits.ClearCubes(); } } Loading isis/src/newhorizons/apps/leisa2isis/leisa2isis.xml +35 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,41 @@ *.cub </filter> </parameter> <parameter name="ERRORMAP"> <type>cube</type> <fileMode>output</fileMode> <internalDefault>Optional</internalDefault> <brief> Output ISIS cube file for the error image </brief> <description> The output cube file that will containing the New Horizons LEISA error extension data as an cube in ISIS format. The error extension image must be in the fifth FITS extension (i.e., sixth image). </description> <filter> *.cub </filter> </parameter> <parameter name="QUALITY"> <type>cube</type> <fileMode>output</fileMode> <internalDefault>Optional</internalDefault> <brief> Output ISIS cube file for the quality image </brief> <description> The output cube file that will containing the New Horizons LEISA quality extension data as an cube in ISIS format. The quality extension image must be in the sixth FITS extension (i.e., seventh image). </description> <filter> *.cub </filter> </parameter> </group> </groups> Loading isis/src/newhorizons/apps/leisa2isis/tsts/Makefile 0 → 100644 +4 −0 Original line number Diff line number Diff line BLANKS = "%-6s" LENGTH = "%-40s" include $(ISISROOT)/make/isismake.tststree isis/src/newhorizons/apps/leisa2isis/tsts/calib/Makefile 0 → 100644 +23 −0 Original line number Diff line number Diff line APPNAME = leisa2isis include $(ISISROOT)/make/isismake.tsts commands: $(APPNAME) from=$(INPUT)/lsb_0034933739_0x53c_sci_1.fit \ to=$(OUTPUT)/lsb_0034933739_0x53c_sci_1_Truth.cub \ > /dev/null; catlab from=$(OUTPUT)/lsb_0034933739_0x53c_sci_1_Truth.cub > \ $(OUTPUT)/lsb_0034933739_0x53c_sci_1_Truth.pvl; $(APPNAME) from=$(INPUT)/lsb_0034933739_0x53c_sci_1.fit \ to=$(OUTPUT)/lsb_0034933739_0x53c_sci_1_Truth.cub \ error=$(OUTPUT)/lsb_0034933739_0x53c_sci_1_Error.cub \ > /dev/null; catlab from=$(OUTPUT)/lsb_0034933739_0x53c_sci_1_Error.cub > \ $(OUTPUT)/lsb_0034933739_0x53c_sci_1_Error.pvl; $(APPNAME) from=$(INPUT)/lsb_0034933739_0x53c_sci_1.fit \ to=$(OUTPUT)/lsb_0034933739_0x53c_sci_1_Truth.cub \ quality=$(OUTPUT)/lsb_0034933739_0x53c_sci_1_Quality.cub\ > /dev/null; catlab from=$(OUTPUT)/lsb_0034933739_0x53c_sci_1_Quality.cub > \ $(OUTPUT)/lsb_0034933739_0x53c_sci_1_Quality.pvl; isis/src/newhorizons/apps/leisa2isis/tsts/raw/Makefile 0 → 100644 +19 −0 Original line number Diff line number Diff line APPNAME = leisa2isis include $(ISISROOT)/make/isismake.tsts commands: $(APPNAME) from=$(INPUT)/lsb_0030594839_0x53d_eng_1.fit \ to=$(OUTPUT)/lsb_0030594839_0x53d_eng_1_Truth.cub \ > /dev/null; catlab from=$(OUTPUT)/lsb_0030594839_0x53d_eng_1_Truth.cub > \ $(OUTPUT)/lsb_0030594839_0x53d_eng_1_Truth.pvl; $(APPNAME) from=$(INPUT)/lsb_0030594839_0x53d_eng_1.fit \ to=$(OUTPUT)/should_not_exist_1.cub \ error=$(OUTPUT)/should_not_exist_2.cub \ 2>&1 | sed -e 's|\[[^]]*/\(.*\)\]|\[\1\]|g' > $(OUTPUT)/error1.txt || true; $(APPNAME) from=$(INPUT)/lsb_0030594839_0x53d_eng_1.fit \ to=$(OUTPUT)/should_not_exist_3.cub \ quality=$(OUTPUT)/should_not_exist_4.cub \ 2>&1 | sed -e 's|\[[^]]*/\(.*\)\]|\[\1\]|g' > $(OUTPUT)/error2.txt || true; Loading
isis/src/newhorizons/apps/leisa2isis/leisa2isis.cpp +111 −9 Original line number Diff line number Diff line Loading @@ -24,11 +24,11 @@ void IsisMain() { UserInterface &ui = Application::GetUserInterface(); ProcessImportFits importFits; importFits.setFitsFile(FileName(ui.GetFileName("FROM"))); PvlGroup mainLabel; mainLabel = importFits.fitsLabel(0); // Get the first label and make sure this is a New Horizons LEISA file PvlGroup mainLabel = importFits.fitsLabel(0); if (!mainLabel.hasKeyword("MISSION") || !mainLabel.hasKeyword("INSTRU") || mainLabel["MISSION"][0] != "New Horizons" || mainLabel["INSTRU"][0] != "lei") { QString msg = QObject::tr("Input file [%1] does not appear to be a New Horizons LEISA FITS " Loading @@ -39,7 +39,70 @@ void IsisMain() { throw IException(IException::User, msg, _FILEINFO_); } // This is a seven-extension fits file. Only import the primary image for now. // Check to see if the error image was requested from the FITS file and // that it has the corresponding extension if (ui.WasEntered("ERRORMAP")) { PvlGroup extensionLabel = importFits.fitsLabel(5); try { extensionLabel = importFits.fitsLabel(5); } catch (IException &e) { QString msg = QObject::tr("Input file [%1] does not appear to be a calibrated New Horizons " "LEISA FITS file. There is no errormap " "extension").arg(ui.GetFileName("FROM")); throw IException(e, IException::Unknown, msg, _FILEINFO_); } if (!extensionLabel.hasKeyword("EXTNAME")) { QString msg = QObject::tr("Input file [%1] does not appear to contain a New Horizons LEISA " "calibrated image. FITS label keyword EXTNAME is missing"). arg(ui.GetFileName("FROM")); throw IException(IException::User, msg, _FILEINFO_); } else if (extensionLabel["EXTNAME"][0] != "ERRORMAP") { QString msg = QObject::tr("Input file [%1] does not appear to contain a New Horizons LEISA " "calibrated image. FITS label value for EXTNAME is [%2]"). arg(ui.GetFileName("FROM")).arg(extensionLabel["EXTNAME"][0]); throw IException(IException::User, msg, _FILEINFO_); } } // Check to see if the quality image was requested from the FITS file and // that it has the corresponding extension if (ui.WasEntered("QUALITY")) { PvlGroup extensionLabel = importFits.fitsLabel(6); try { extensionLabel = importFits.fitsLabel(6); } catch (IException &e) { QString msg = QObject::tr("Input file [%1] does not appear to be a calibrated New Horizons " "LEISA FITS file. There is no quality " "extension").arg(ui.GetFileName("FROM")); throw IException(e, IException::Unknown, msg, _FILEINFO_); } if (!extensionLabel.hasKeyword("EXTNAME")) { QString msg = QObject::tr("Input file [%1] does not appear to contain a New Horizons LEISA " "calibrated image. FITS label keyword EXTNAME is missing"). arg(ui.GetFileName("FROM")); throw IException(IException::User, msg, _FILEINFO_); } else if (extensionLabel["EXTNAME"][0] != "QUALITY") { QString msg = QObject::tr("Input file [%1] does not appear to contain a New Horizons LEISA " "calibrated image. FITS label value for EXTNAME is [%2]"). arg(ui.GetFileName("FROM")).arg(extensionLabel["EXTNAME"][0]); throw IException(IException::User, msg, _FILEINFO_); } } // Import the primary image (LEISA raw/calibrated) importFits.SetOrganization(ProcessImport::BIL); importFits.setProcessFileStructure(0); Loading @@ -56,11 +119,8 @@ void IsisMain() { Pvl fitsLabel; fitsLabel.addGroup(importFits.fitsLabel(0)); // add in label processing later // Create an Instrument group // FileName insTransFile(transDir + "leisaInstrument_fit.trn");//need to create this file FileName insTransFile("./leisaInstrument_fit.trn");//need to create this file FileName insTransFile(transDir + "leisaInstrument_fit.trn"); PvlTranslationManager insXlater(fitsLabel, insTransFile.expanded()); insXlater.Auto(outLabel); Loading @@ -86,8 +146,8 @@ void IsisMain() { output->putGroup(outLabel.findGroup("Archive", Pvl::Traverse)); */ // Create a Kernels group // FileName kernelsTransFile(transDir + "leisaKernels_fit.trn"); FileName kernelsTransFile("./leisaKernels_fit.trn"); FileName kernelsTransFile(transDir + "leisaKernels_fit.trn"); // FileName kernelsTransFile("./leisaKernels_fit.trn"); PvlTranslationManager kernelsXlater(fitsLabel, kernelsTransFile.expanded()); kernelsXlater.Auto(outLabel); output->putGroup(outLabel.findGroup("Kernels", Pvl::Traverse)); Loading Loading @@ -126,6 +186,48 @@ void IsisMain() { importFits.StartProcess(); importFits.ClearCubes(); importFits.Finalize(); // Import the ERRORMAP image. It is the 6th image in the FITS file (i.e., 5th extension) if (ui.WasEntered("ERRORMAP")) { PvlGroup extensionLabel = importFits.fitsLabel(5); importFits.SetOrganization(ProcessImport::BSQ); importFits.setProcessFileStructure(5); Cube *output = importFits.SetOutputCube("ERRORMAP"); // Save the input FITS label in the Cube original labels Pvl origLabel; origLabel += extensionLabel; OriginalLabel originals(origLabel); output->write(originals); // Convert the main image data importFits.Progress()->SetText("Importing LEISA errormap image"); importFits.StartProcess(); importFits.ClearCubes(); } // Import the quality image. It is the 7th image in the FITS file (i.e., 6th extension) if (ui.WasEntered("QUALITY")) { PvlGroup extensionLabel = importFits.fitsLabel(6); importFits.SetOrganization(ProcessImport::BSQ); importFits.setProcessFileStructure(6); Cube *output = importFits.SetOutputCube("QUALITY"); // Save the input FITS label in the Cube original labels Pvl origLabel; origLabel += extensionLabel; OriginalLabel originals(origLabel); output->write(originals); // Convert the main image data importFits.Progress()->SetText("Importing LEISA quality image"); importFits.StartProcess(); importFits.ClearCubes(); } } Loading
isis/src/newhorizons/apps/leisa2isis/leisa2isis.xml +35 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,41 @@ *.cub </filter> </parameter> <parameter name="ERRORMAP"> <type>cube</type> <fileMode>output</fileMode> <internalDefault>Optional</internalDefault> <brief> Output ISIS cube file for the error image </brief> <description> The output cube file that will containing the New Horizons LEISA error extension data as an cube in ISIS format. The error extension image must be in the fifth FITS extension (i.e., sixth image). </description> <filter> *.cub </filter> </parameter> <parameter name="QUALITY"> <type>cube</type> <fileMode>output</fileMode> <internalDefault>Optional</internalDefault> <brief> Output ISIS cube file for the quality image </brief> <description> The output cube file that will containing the New Horizons LEISA quality extension data as an cube in ISIS format. The quality extension image must be in the sixth FITS extension (i.e., seventh image). </description> <filter> *.cub </filter> </parameter> </group> </groups> Loading
isis/src/newhorizons/apps/leisa2isis/tsts/Makefile 0 → 100644 +4 −0 Original line number Diff line number Diff line BLANKS = "%-6s" LENGTH = "%-40s" include $(ISISROOT)/make/isismake.tststree
isis/src/newhorizons/apps/leisa2isis/tsts/calib/Makefile 0 → 100644 +23 −0 Original line number Diff line number Diff line APPNAME = leisa2isis include $(ISISROOT)/make/isismake.tsts commands: $(APPNAME) from=$(INPUT)/lsb_0034933739_0x53c_sci_1.fit \ to=$(OUTPUT)/lsb_0034933739_0x53c_sci_1_Truth.cub \ > /dev/null; catlab from=$(OUTPUT)/lsb_0034933739_0x53c_sci_1_Truth.cub > \ $(OUTPUT)/lsb_0034933739_0x53c_sci_1_Truth.pvl; $(APPNAME) from=$(INPUT)/lsb_0034933739_0x53c_sci_1.fit \ to=$(OUTPUT)/lsb_0034933739_0x53c_sci_1_Truth.cub \ error=$(OUTPUT)/lsb_0034933739_0x53c_sci_1_Error.cub \ > /dev/null; catlab from=$(OUTPUT)/lsb_0034933739_0x53c_sci_1_Error.cub > \ $(OUTPUT)/lsb_0034933739_0x53c_sci_1_Error.pvl; $(APPNAME) from=$(INPUT)/lsb_0034933739_0x53c_sci_1.fit \ to=$(OUTPUT)/lsb_0034933739_0x53c_sci_1_Truth.cub \ quality=$(OUTPUT)/lsb_0034933739_0x53c_sci_1_Quality.cub\ > /dev/null; catlab from=$(OUTPUT)/lsb_0034933739_0x53c_sci_1_Quality.cub > \ $(OUTPUT)/lsb_0034933739_0x53c_sci_1_Quality.pvl;
isis/src/newhorizons/apps/leisa2isis/tsts/raw/Makefile 0 → 100644 +19 −0 Original line number Diff line number Diff line APPNAME = leisa2isis include $(ISISROOT)/make/isismake.tsts commands: $(APPNAME) from=$(INPUT)/lsb_0030594839_0x53d_eng_1.fit \ to=$(OUTPUT)/lsb_0030594839_0x53d_eng_1_Truth.cub \ > /dev/null; catlab from=$(OUTPUT)/lsb_0030594839_0x53d_eng_1_Truth.cub > \ $(OUTPUT)/lsb_0030594839_0x53d_eng_1_Truth.pvl; $(APPNAME) from=$(INPUT)/lsb_0030594839_0x53d_eng_1.fit \ to=$(OUTPUT)/should_not_exist_1.cub \ error=$(OUTPUT)/should_not_exist_2.cub \ 2>&1 | sed -e 's|\[[^]]*/\(.*\)\]|\[\1\]|g' > $(OUTPUT)/error1.txt || true; $(APPNAME) from=$(INPUT)/lsb_0030594839_0x53d_eng_1.fit \ to=$(OUTPUT)/should_not_exist_3.cub \ quality=$(OUTPUT)/should_not_exist_4.cub \ 2>&1 | sed -e 's|\[[^]]*/\(.*\)\]|\[\1\]|g' > $(OUTPUT)/error2.txt || true;