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 @@
</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>
......
#include "Isis.h"
#include <QDir>
#include <QStringList>
#include "Application.h"
#include "ApolloPanImage.h"
#include "FileList.h"
......@@ -15,28 +18,11 @@ 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");
QStringList nameFilter("*_000*.pvl");
QDir pvlDirectory(FileName(ui.GetFileName("FROM")).expanded());
// 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"));
}
}
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"));
image.writeToPvl(ui.GetFileName("OUTPUTDIRECTORY"));
}
......@@ -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>
......
#include "Isis.h"
#include <QDir>
#include <QStringList>
#include "Application.h"
#include "ApolloPanImage.h"
#include "FileList.h"
......@@ -15,42 +18,13 @@ 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"));
}
int tileCount = QStringList(pvlDirectory.entryList(nameFilter)).count();
cout << tileCount << endl;
image.readFromPvl(ui.GetFileName("FROM"), tileCount);
// Decode the tiles
image.decodeTimingMarks();
// Match the tiles
......@@ -59,7 +33,6 @@ void IsisMain() {
// 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"));
image.writeToPvl(ui.GetString("OUTPUTDIRECTORY"));
}
......@@ -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>
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment