Skip to content
Snippets Groups Projects
Commit 292abd36 authored by Makayla Shepherd's avatar Makayla Shepherd
Browse files

Changed apps to better fit a pipeline script

parent 2275d2eb
No related branches found
No related tags found
No related merge requests found
...@@ -80,15 +80,14 @@ ...@@ -80,15 +80,14 @@
</internalDefault> </internalDefault>
</parameter> </parameter>
<parameter name="PREFIX"> <parameter name="OUTPUTDIRECTORY">
<type>filename</type> <type>filename</type>
<fileMode>output</fileMode> <fileMode>output</fileMode>
<brief> <brief>
The output file prefix that will be appended with AS15-P-####_000#.pvl. The output file directory.
</brief> </brief>
<description> <description>
The prefix for the output pvl files that will be appended with AS15-P-####_000#.pvl. The output directory where the PVLs will be written.
This can include a path to a directory, but must end with /.
</description> </description>
</parameter> </parameter>
</group> </group>
......
#include "Isis.h" #include "Isis.h"
#include <QDir>
#include <QStringList>
#include "Application.h" #include "Application.h"
#include "ApolloPanImage.h" #include "ApolloPanImage.h"
#include "FileList.h" #include "FileList.h"
...@@ -15,28 +18,11 @@ void IsisMain() { ...@@ -15,28 +18,11 @@ void IsisMain() {
// Construct the image object // Construct the image object
ApolloPanImage image; ApolloPanImage image;
// Create the tiles from the input Pvl files QStringList nameFilter("*_000*.pvl");
if (ui.WasEntered("LASTTILE")) { QDir pvlDirectory(FileName(ui.GetFileName("FROM")).expanded());
int lastTile = ui.GetInteger("LASTTILE");
// Create the tiles from the input Pvl files int tileCount = QStringList(pvlDirectory.entryList(nameFilter)).count();
if (ui.WasEntered("PVLLIST")) { image.readFromPvl(ui.GetFileName("FROM"), tileCount);
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"));
}
}
// Compute timing mark times // Compute timing mark times
image.readTimeCode(); image.readTimeCode();
...@@ -48,5 +34,5 @@ void IsisMain() { ...@@ -48,5 +34,5 @@ void IsisMain() {
image.computeStartStop(); image.computeStartStop();
// Output new Pvl files // Output new Pvl files
image.writeToPvl(ui.GetFileName("PREFIX")); image.writeToPvl(ui.GetFileName("OUTPUTDIRECTORY"));
} }
...@@ -24,51 +24,22 @@ ...@@ -24,51 +24,22 @@
<parameter name="FROM"> <parameter name="FROM">
<type>filename</type> <type>filename</type>
<brief> <brief>
The input pvl prefix from apolloPanTransform The input pvl prefix from apolloPanTransform. Do NOT include a / at the end of the path!
</brief> </brief>
<description> <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> </description>
<default>
<item>invalid</item>
</default>
</parameter> </parameter>
<parameter name="LASTTILE"> <parameter name="OUTPUTDIRECTORY">
<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">
<type>filename</type> <type>filename</type>
<fileMode>output</fileMode> <fileMode>output</fileMode>
<brief> <brief>
The output file prefix The output file directory.
</brief> </brief>
<description> <description>
The prefix for the output pvl files The output directory where the PVLs will be written.
</description> </description>
</parameter> </parameter>
</group> </group>
......
#include "Isis.h" #include "Isis.h"
#include <QDir>
#include <QStringList>
#include "Application.h" #include "Application.h"
#include "ApolloPanImage.h" #include "ApolloPanImage.h"
#include "FileList.h" #include "FileList.h"
...@@ -15,42 +18,13 @@ void IsisMain() { ...@@ -15,42 +18,13 @@ void IsisMain() {
// Construct the image object // Construct the image object
ApolloPanImage image; ApolloPanImage image;
// Process for images with less than 8 tiles QStringList nameFilter("*_000*.pvl");
if (ui.WasEntered("LASTTILE")) { QDir pvlDirectory(FileName(ui.GetFileName("FROM")).expanded());
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();
}
// Standard 8 tile image process int tileCount = QStringList(pvlDirectory.entryList(nameFilter)).count();
else { cout << tileCount << endl;
// Create the tiles from the input Pvl files image.readFromPvl(ui.GetFileName("FROM"), tileCount);
if (ui.WasEntered("PVLLIST")) {
FileList pvlList(ui.GetFileName("PVLLIST"));
image.readFromPvl(pvlList);
}
else {
image.readFromPvl(ui.GetFileName("FROM"));
}
// Decode the tiles
image.decodeTimingMarks(); image.decodeTimingMarks();
// Match the tiles // Match the tiles
...@@ -59,7 +33,6 @@ void IsisMain() { ...@@ -59,7 +33,6 @@ void IsisMain() {
// Number the fiducial and timing marks // Number the fiducial and timing marks
image.numberFiducialMarks(); image.numberFiducialMarks();
image.numberTimingMarks(); image.numberTimingMarks();
}
// Compute affines // Compute affines
image.computeAffines(ui.GetFileName("CALIBRATED")); image.computeAffines(ui.GetFileName("CALIBRATED"));
...@@ -71,5 +44,5 @@ void IsisMain() { ...@@ -71,5 +44,5 @@ void IsisMain() {
image.checkTimeCode(); image.checkTimeCode();
// Output new Pvl files // Output new Pvl files
image.writeToPvl(ui.GetFileName("PREFIX")); image.writeToPvl(ui.GetString("OUTPUTDIRECTORY"));
} }
...@@ -26,77 +26,35 @@ ...@@ -26,77 +26,35 @@
<parameter name="FROM"> <parameter name="FROM">
<type>filename</type> <type>filename</type>
<brief> <brief>
The input pvl prefix from apolloPanDetect The input pvl directory from apolloPanDetect. Do NOT include a / at the end of the path!
</brief> </brief>
<description> <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> </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>
<parameter name="CALIBRATED"> <parameter name="CALIBRATED">
<type>filename</type> <type>filename</type>
<brief> <brief>
The input csv containing calibrated fiducial mark coordiantes. The input csv containing calibrated fiducial mark coordinates.
</brief> </brief>
<description> <description>
The input csv containing calibrated fiducial mark coordiantes. The input csv containing calibrated fiducial mark coordinates.
</description> </description>
<default> <default>
<item>/archive/missions/apollo_pan/AS15/CriticalData/PanData/SupportData/CalibratedFiducials/CalibratedFiducials.csv</item> <item>/archive/missions/apollo_pan/AS15/CriticalData/PanData/SupportData/CalibratedFiducials/CalibratedFiducials.csv</item>
</default> </default>
</parameter> </parameter>
<parameter name="PREFIX"> <parameter name="OUTPUTDIRECTORY">
<type>filename</type> <type>filename</type>
<fileMode>output</fileMode> <fileMode>output</fileMode>
<brief> <brief>
The output file prefix The directory where the output PVLs will be written.
</brief> </brief>
<description> <description>
The prefix for the output pvl files The directory where the output PVLs will be written.
</description> </description>
</parameter> </parameter>
</group> </group>
......
...@@ -184,12 +184,12 @@ namespace Isis { ...@@ -184,12 +184,12 @@ namespace Isis {
/** /**
* Write the image information out to Pvl files. * 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. * Files we be output as filePrefix + AS15-P-####_000#.pvl.
*/ */
void ApolloPanImage::writeToPvl(QString filePrefix) { void ApolloPanImage::writeToPvl(QString filePrefix) {
for (size_t i = 0; i < m_tiles.size(); i++) { 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"; + "_000" + QString::number(i + 1) + ".pvl";
Pvl tilePvl; Pvl tilePvl;
tilePvl += m_tiles[i].toPvl(); tilePvl += m_tiles[i].toPvl();
...@@ -201,14 +201,15 @@ namespace Isis { ...@@ -201,14 +201,15 @@ namespace Isis {
/** /**
* Read the tile information from a Pvl file. * 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. * @param lastTile The last tile in the image. Defaults to 8.
*/ */
void ApolloPanImage::readFromPvl(QString filePrefix, int lastTile) { void ApolloPanImage::readFromPvl(QString filePrefix, int lastTile) {
m_imageNumber = filePrefix.right(4); m_imageNumber = filePrefix.right(4);
m_tiles.clear(); m_tiles.clear();
for (int i = 1; i < lastTile + 1; i++) { for (int i = 1; i <= lastTile; i++) {
QString tileFile = filePrefix + "_000" + QString::number(i) +".pvl"; QString tileFile = filePrefix + "/AS15-P-" + m_imageNumber
+ "_000" + QString::number(i) +".pvl";
ApolloPanTile tile(m_imageNumber, i); ApolloPanTile tile(m_imageNumber, i);
m_tiles.push_back(tile); m_tiles.push_back(tile);
m_tiles.back().fromPvl(tileFile); m_tiles.back().fromPvl(tileFile);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment