diff --git a/isis/src/apollo/apps/apollopandetect/apollopandetect.xml b/isis/src/apollo/apps/apollopandetect/apollopandetect.xml index e5e1cfbf67de850f2f3ae3634110b0bc92a2cb66..e324775fe1681c3173e27a7ce550b4e239b96535 100644 --- a/isis/src/apollo/apps/apollopandetect/apollopandetect.xml +++ b/isis/src/apollo/apps/apollopandetect/apollopandetect.xml @@ -80,15 +80,14 @@ </internalDefault> </parameter> - <parameter name="PREFIX"> + <parameter name="OUTPUTDIRECTORY"> <type>filename</type> <fileMode>output</fileMode> <brief> - The output file prefix that will be appended with AS15-P-####_000#.pvl. + The output file directory. </brief> <description> - The prefix for the output pvl files that will be appended with AS15-P-####_000#.pvl. - This can include a path to a directory, but must end with /. + The output directory where the PVLs will be written. </description> </parameter> </group> diff --git a/isis/src/apollo/apps/apollopantime/apollopantime.cpp b/isis/src/apollo/apps/apollopantime/apollopantime.cpp index 0879ffb10d7a13db09d6fa3946bc4fc127afeebd..189877816af217d7b728f1c9af052782f6d820db 100644 --- a/isis/src/apollo/apps/apollopantime/apollopantime.cpp +++ b/isis/src/apollo/apps/apollopantime/apollopantime.cpp @@ -1,5 +1,8 @@ #include "Isis.h" +#include <QDir> +#include <QStringList> + #include "Application.h" #include "ApolloPanImage.h" #include "FileList.h" @@ -14,29 +17,12 @@ void IsisMain() { // Construct the image object ApolloPanImage image; - - // Create the tiles from the input Pvl files - if (ui.WasEntered("LASTTILE")) { - int lastTile = ui.GetInteger("LASTTILE"); - - // Create the tiles from the input Pvl files - if (ui.WasEntered("PVLLIST")) { - FileList pvlList(ui.GetFileName("PVLLIST")); - image.readFromPvl(pvlList, lastTile); - } - else { - image.readFromPvl(ui.GetFileName("FROM"), lastTile); - } - } - else { - if (ui.WasEntered("PVLLIST")) { - FileList pvlList(ui.GetFileName("PVLLIST")); - image.readFromPvl(pvlList); - } - else { - image.readFromPvl(ui.GetFileName("FROM")); - } - } + + QStringList nameFilter("*_000*.pvl"); + QDir pvlDirectory(FileName(ui.GetFileName("FROM")).expanded()); + + int tileCount = QStringList(pvlDirectory.entryList(nameFilter)).count(); + image.readFromPvl(ui.GetFileName("FROM"), tileCount); // Compute timing mark times image.readTimeCode(); @@ -48,5 +34,5 @@ void IsisMain() { image.computeStartStop(); // Output new Pvl files - image.writeToPvl(ui.GetFileName("PREFIX")); -} \ No newline at end of file + image.writeToPvl(ui.GetFileName("OUTPUTDIRECTORY")); +} diff --git a/isis/src/apollo/apps/apollopantime/apollopantime.xml b/isis/src/apollo/apps/apollopantime/apollopantime.xml index fe1abb81835d824b79113de55a740387b63a7804..b939bdf31008c572cc5fc0393f15d08b68b53baf 100644 --- a/isis/src/apollo/apps/apollopantime/apollopantime.xml +++ b/isis/src/apollo/apps/apollopantime/apollopantime.xml @@ -24,51 +24,22 @@ <parameter name="FROM"> <type>filename</type> <brief> - The input pvl prefix from apolloPanTransform + The input pvl prefix from apolloPanTransform. Do NOT include a / at the end of the path! </brief> <description> - The input pvl prefix from apolloPanTransform + The input pvl prefix from apolloPanTransform. Do NOT include a / at the end of the path! + Example: Example: /archive/missions/apollo_pan/AS15/REVS04-16/REV16/AS15-P-9372 </description> - <default> - <item>invalid</item> - </default> </parameter> - <parameter name="LASTTILE"> - <type>integer</type> - <brief> - The last tile in the image. This is for images with less than 8 tiles. - </brief> - <description> - The last tile in the image. This is for images with less than 8 tiles. - </description> - <internalDefault> - 8 - </internalDefault> - </parameter> - - <parameter name="PVLLIST"> - <type>filename</type> - <fileMode>input</fileMode> - <brief> - The list of input pvl files - </brief> - <description> - The list of input pvl files. These must be ordered from tile 1 to 8. - </description> - <internalDefault> - Use standard transform detection pvl files. - </internalDefault> - </parameter> - - <parameter name="PREFIX"> + <parameter name="OUTPUTDIRECTORY"> <type>filename</type> <fileMode>output</fileMode> <brief> - The output file prefix + The output file directory. </brief> <description> - The prefix for the output pvl files + The output directory where the PVLs will be written. </description> </parameter> </group> diff --git a/isis/src/apollo/apps/apollopantransform/apollopantransform.cpp b/isis/src/apollo/apps/apollopantransform/apollopantransform.cpp index 60b6d6df3bd31909bb307aa1fd08f8210c906a35..80f8de1b1d16f53fb98265ae315c6f0caeab23cd 100644 --- a/isis/src/apollo/apps/apollopantransform/apollopantransform.cpp +++ b/isis/src/apollo/apps/apollopantransform/apollopantransform.cpp @@ -1,5 +1,8 @@ #include "Isis.h" +#include <QDir> +#include <QStringList> + #include "Application.h" #include "ApolloPanImage.h" #include "FileList.h" @@ -15,51 +18,21 @@ void IsisMain() { // Construct the image object ApolloPanImage image; - // Process for images with less than 8 tiles - if (ui.WasEntered("LASTTILE")) { - int lastTile = ui.GetInteger("LASTTILE"); - - // Create the tiles from the input Pvl files - if (ui.WasEntered("PVLLIST")) { - FileList pvlList(ui.GetFileName("PVLLIST")); - image.readFromPvl(pvlList, lastTile); - } - else { - image.readFromPvl(ui.GetFileName("FROM"), lastTile); - } - - // Decode the tiles - image.decodeTimingMarks(); - - // Match the tiles - image.matchTiles(); - - // Number the fiducial and timing marks - image.numberFiducialMarks(ui.GetInteger("FIRSTFIDINDEX")); - image.numberTimingMarks(); - } + QStringList nameFilter("*_000*.pvl"); + QDir pvlDirectory(FileName(ui.GetFileName("FROM")).expanded()); - // Standard 8 tile image process - else { - // Create the tiles from the input Pvl files - if (ui.WasEntered("PVLLIST")) { - FileList pvlList(ui.GetFileName("PVLLIST")); - image.readFromPvl(pvlList); - } - else { - image.readFromPvl(ui.GetFileName("FROM")); - } - - // Decode the tiles - image.decodeTimingMarks(); + int tileCount = QStringList(pvlDirectory.entryList(nameFilter)).count(); + cout << tileCount << endl; + image.readFromPvl(ui.GetFileName("FROM"), tileCount); + + image.decodeTimingMarks(); - // Match the tiles - image.matchTiles(); + // Match the tiles + image.matchTiles(); - // Number the fiducial and timing marks - image.numberFiducialMarks(); - image.numberTimingMarks(); - } + // Number the fiducial and timing marks + image.numberFiducialMarks(); + image.numberTimingMarks(); // Compute affines image.computeAffines(ui.GetFileName("CALIBRATED")); @@ -71,5 +44,5 @@ void IsisMain() { image.checkTimeCode(); // Output new Pvl files - image.writeToPvl(ui.GetFileName("PREFIX")); -} \ No newline at end of file + image.writeToPvl(ui.GetString("OUTPUTDIRECTORY")); +} diff --git a/isis/src/apollo/apps/apollopantransform/apollopantransform.xml b/isis/src/apollo/apps/apollopantransform/apollopantransform.xml index 14946b7f6855c4bb4906ae5103c2ae45bb49fc0a..33c7720179c2673b88b385ebc1f2f42700897b83 100644 --- a/isis/src/apollo/apps/apollopantransform/apollopantransform.xml +++ b/isis/src/apollo/apps/apollopantransform/apollopantransform.xml @@ -26,77 +26,35 @@ <parameter name="FROM"> <type>filename</type> <brief> - The input pvl prefix from apolloPanDetect + The input pvl directory from apolloPanDetect. Do NOT include a / at the end of the path! </brief> <description> - The input pvl prefix from apolloPanDetect + The input pvl directory from apolloPanDetect. Do NOT include a / at the end of the path! + Example: /archive/missions/apollo_pan/AS15/REVS04-16/REV16/AS15-P-9372 </description> - <default> - <item>invalid</item> - </default> - </parameter> - - <parameter name="LASTTILE"> - <type>integer</type> - <brief> - The last tile in the image. This is for images with less than 8 tiles. - </brief> - <description> - The last tile in the image. This is for images with less than 8 tiles. - </description> - <internalDefault> - 8 - </internalDefault> - </parameter> - - <parameter name="FIRSTFIDINDEX"> - <type>integer</type> - <brief> - The index of the first fiducial mark on the image. - </brief> - <description> - The index of the first fiducial mark on the image. - </description> - <internalDefault> - 0 - </internalDefault> - </parameter> - - <parameter name="PVLLIST"> - <type>filename</type> - <fileMode>input</fileMode> - <brief> - The list of input pvl files - </brief> - <description> - The list of input pvl files. These must be ordered from tile 1 to 8. - </description> - <internalDefault> - Use standard raw detection pvl files. - </internalDefault> </parameter> <parameter name="CALIBRATED"> <type>filename</type> <brief> - The input csv containing calibrated fiducial mark coordiantes. + The input csv containing calibrated fiducial mark coordinates. </brief> <description> - The input csv containing calibrated fiducial mark coordiantes. + The input csv containing calibrated fiducial mark coordinates. </description> <default> <item>/archive/missions/apollo_pan/AS15/CriticalData/PanData/SupportData/CalibratedFiducials/CalibratedFiducials.csv</item> </default> </parameter> - <parameter name="PREFIX"> + <parameter name="OUTPUTDIRECTORY"> <type>filename</type> <fileMode>output</fileMode> <brief> - The output file prefix + The directory where the output PVLs will be written. </brief> <description> - The prefix for the output pvl files + The directory where the output PVLs will be written. </description> </parameter> </group> diff --git a/isis/src/apollo/objs/ApolloPanImage/ApolloPanImage.cpp b/isis/src/apollo/objs/ApolloPanImage/ApolloPanImage.cpp index 99b3c1092eb63a2e370275c391b851364f2ff5b5..68a10e7f3af5d270453af2569ce92c0c86f09a20 100644 --- a/isis/src/apollo/objs/ApolloPanImage/ApolloPanImage.cpp +++ b/isis/src/apollo/objs/ApolloPanImage/ApolloPanImage.cpp @@ -184,12 +184,12 @@ namespace Isis { /** * Write the image information out to Pvl files. * - * @param filePrefix The prefix for the output files. + * @param filePrefix The directory where the pvls will be written to * Files we be output as filePrefix + AS15-P-####_000#.pvl. */ void ApolloPanImage::writeToPvl(QString filePrefix) { for (size_t i = 0; i < m_tiles.size(); i++) { - QString filename = filePrefix + "AS15-P-" + m_imageNumber + QString filename = filePrefix + "/AS15-P-" + m_imageNumber + "_000" + QString::number(i + 1) + ".pvl"; Pvl tilePvl; tilePvl += m_tiles[i].toPvl(); @@ -201,14 +201,15 @@ namespace Isis { /** * Read the tile information from a Pvl file. * - * @param filePrefix The file prefix "AS15-P-####" + * @param filePrefix The file prefix "/archive/missions/apollo_pan/AS15/REVS###/REV##/AS15-P-####" * @param lastTile The last tile in the image. Defaults to 8. */ void ApolloPanImage::readFromPvl(QString filePrefix, int lastTile) { m_imageNumber = filePrefix.right(4); m_tiles.clear(); - for (int i = 1; i < lastTile + 1; i++) { - QString tileFile = filePrefix + "_000" + QString::number(i) +".pvl"; + for (int i = 1; i <= lastTile; i++) { + QString tileFile = filePrefix + "/AS15-P-" + m_imageNumber + + "_000" + QString::number(i) +".pvl"; ApolloPanTile tile(m_imageNumber, i); m_tiles.push_back(tile); m_tiles.back().fromPvl(tileFile);