Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature updates for tgocassisstitch #5162

Merged
merged 16 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ release.
- Removed the `.py` extention from the _isisdataeval_ tool `isisdata_mockup` for consistency and install it in $ISISROOT/bin; added the `--tojson` and `--hasher` option to _isisdata_mockup_ tool improve utility; updated the tool `README.md` documentation to reflect this change, removed help output and trimmed example results; fixed paths to test data in `make_isisdata_mockup.sh`. [#5163](https://github.com/DOI-USGS/ISIS3/pull/5163)
- Significantly refactored FASTGEOM processing in <i>findfeatures</i> to accommodate stability and functionality. The scope of the algorithm was taken out of the ImageSource class and isolated to support this feature. [#4772](https://github.com/DOI-USGS/ISIS3/issues/4772)
- Report better information regarding the behavior of <i>findfeatures</i>, FASTGEOM algorithms, and creation of the output network. [#4772](https://github.com/DOI-USGS/ISIS3/issues/4772)
- Modified tgocassisstitch to optionally allow either a outputprefix or an
outputsuffix, both, or neither for naming convention purposes. [#5162](https://github.com/DOI-USGS/ISIS3/pull/5162)
- Updated download location for Dawn source files to include updated pck from HAMO Dawn mosaic [#4001](https://github.com/USGS-Astrogeology/ISIS3/issues/4001)
- Pinned cspice version to 67 [#5083](https://github.com/USGS-Astrogeology/ISIS3/issues/5083)
- Changed the `rsync` related commands in the ISIS SPICE Web Service document to `downloadIsisData` command
acpaquette marked this conversation as resolved.
Show resolved Hide resolved

### Added
- Added rclone to run dependencies in meta.yaml [#5183](https://github.com/DOI-USGS/ISIS3/issues/5183)
Expand All @@ -50,6 +55,9 @@ release.
- Added two new examples demonstrating/documenting the use of FASTGEOM algorithm, parameterization using <b>GLOBALS</b> and creation of a regional mosaic using <i>findfeatures</i>. [#4772](https://github.com/DOI-USGS/ISIS3/issues/4772)
- Added new option <b>GEOMSOURCE=BOTH</b> to <i>findfeatures</i> to check both the MATCH and FROM/FROMLIST images for valid control measure geometry to produce better networks and prevent downstream processing errors. Ignore points that end up with no valid measures (but can be retained with use of <b>PreserveIgnoredControl</b> via GLOBALS parameterization). [#4772](https://github.com/DOI-USGS/ISIS3/issues/4772)
- Added new gtests for <i>findfeatures</i> that replaces all the old application tests. These tests are <i>FunctionalTestFindfeaturesFastGeomDefault</i>, <i>FunctionalTestFindfeaturesFastGeomRadialConfig</i>, <i>FunctionalTestFindfeaturesFastGeomGridDefault</i> and <i>FunctionalTestFindfeaturesFastGeomGridConfig</i>. [#4772](https://github.com/DOI-USGS/ISIS3/issues/4772)
- Added an optional cubename parameter to tgocassisstitch which lets the user
override the timestamp style naming convention of the output cube with their
own name; if not specified retains existing behavior [#5125](https://github.com/USGS-Astrogeology/ISIS3/issues/5162)

### Deprecated

Expand Down
22 changes: 19 additions & 3 deletions isis/src/tgo/apps/tgocassisstitch/tgocassisstitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,34 @@ namespace Isis {
throw IException(e, IException::Unknown, msg, _FILEINFO_);
}

// read the optional cubename
FileName frameletCubeFlag(ui.GetCubeName("CUBENAME"));
QString frameletCubeName = frameletCubeFlag.expanded();

// Stitch together the individual frames
FileName outputFileName(ui.GetCubeName("OUTPUTPREFIX"));
QString outputBaseName = outputFileName.expanded();
FileName outputPrefix(ui.GetCubeName("OUTPUTPREFIX"));
FileName outputSuffix(ui.GetCubeName("OUTPUTSUFFIX"));
QString outputPrefBaseName = outputPrefix.expanded();
QString outputSuffBaseName = outputSuffix.expanded();
QStringList frameKeys = frameMap.uniqueKeys();
Progress stitchProgress;
stitchProgress.SetText("Stitching Frames");
stitchProgress.SetMaximumSteps(frameKeys.size());
stitchProgress.CheckStatus();

foreach(QString frameKey, frameKeys) {
try {
QString frameIdentifier = frameKey.split("/").last();
FileName frameFileName(outputBaseName + "-" + frameIdentifier + ".cub");
FileName frameFileName;
if (frameletCubeName != "") {
frameFileName = FileName(outputPrefBaseName + "-" +
frameletCubeName +
outputSuffBaseName + ".cub");
} else {
frameFileName = FileName(outputPrefBaseName + "-" +
frameIdentifier +
outputSuffBaseName + ".cub");
}
stitchFrame( frameMap.values(frameKey), frameFileName );
stitchProgress.CheckStatus();
}
Expand Down
47 changes: 45 additions & 2 deletions isis/src/tgo/apps/tgocassisstitch/tgocassisstitch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@
<change name="Adam Goins" date="2018-02-15">
Modified stitchFrame to store the Archive group for ingested framelets. Fixes #5333.
</change>
<change name="Anton Hibl" date="2023-02-24">
Modified stitchFrame to have logic for suffix or prefix in the output
filename. Fixes #5125.
</change>
<change name="Anton Hibl" date="2023-03-01">
Added an optional argument to tgocassisstitch which allows for an optional
cubename to override the default timestamp-style naming convention and
bahavior for the output cube. Fixes #5125.
</change>
</history>

<category>
Expand All @@ -54,11 +63,28 @@
</filter>
</parameter>

<parameter name="CUBENAME">
<type>cube</type>
<default><item></item></default>
<fileMode>input</fileMode>
<brief>
An optional name for the output cube.
</brief>
<description>
An optional name for the output cube instead of the default timestamp
style naming.
</description>
<filter>
*.cub
</filter>
</parameter>

<parameter name="OUTPUTPREFIX">
<type>cube</type>
<type>cube</type>
<default><item></item></default>
<fileMode>output</fileMode>
<brief>
Output ISIS cube basename.
Output ISIS cube basename prefix.
</brief>
<description>
The stitched cubes will be output as this basename plus the last
Expand All @@ -68,6 +94,23 @@
<filter>
*.cub
</filter>
</parameter>

<parameter name="OUTPUTSUFFIX">
<type>cube</type>
<default><item></item></default>
<fileMode>output</fileMode>
<brief>
output ISIS cube basename suffix.
</brief>
<description>
The stitched cubes will be output as the last component of the serial
number plus this basename. Usually this will be the start time for
the frame.
</description>
<filter>
*.cub
</filter>
</parameter>
</group>
</groups>
Expand Down
11 changes: 8 additions & 3 deletions isis/tests/FunctionalTestsTgocassisstitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ TEST(TgoCassisstitch, TgoCassisstitchMultiframeTest) {
cubeList->append("data/tgoCassis/tgocassisstitch/CAS-MCO-2016-11-22T16.16.16.833-RED-01006-B1_crop.cub");
cubeList->append("data/tgoCassis/tgocassisstitch/CAS-MCO-2016-11-22T16.16.16.833-NIR-02006-B1_crop.cub");
cubeList->append("data/tgoCassis/tgocassisstitch/CAS-MCO-2016-11-22T16.16.16.833-PAN-00006-B1_crop.cub");

QString cubeListFile = prefix.path() + "/cubelist.lis";
cubeList->write(cubeListFile);

QString cubeName = "default";

QVector<QString> args = {"fromlist=" + cubeListFile,
"outputprefix=" + prefix.path() + "/CAS-MCO"};
UserInterface options(APP_XML, args);
Expand Down Expand Up @@ -220,7 +222,10 @@ TEST(TgoCassisstitch, TgoCassisstitchSingleframeTest) {
QString cubeListFile = prefix.path() + "/cubelist.lis";
cubeList->write(cubeListFile);

QString cubeName = "default";

QVector<QString> args = {"fromlist=" + cubeListFile,
"cubename=" + cubeName,
"outputprefix=" + prefix.path() + "/CAS-MCO"};
UserInterface options(APP_XML, args);

Expand All @@ -231,7 +236,7 @@ TEST(TgoCassisstitch, TgoCassisstitchSingleframeTest) {
FAIL() << "Unable to run tgocassisstitch with cube list: " << e.what() << std::endl;
}

Cube cube(prefix.path() + "/CAS-MCO-2016-11-22T16:16:10.833.cub");
Cube cube(prefix.path() + "/CAS-MCO-default.cub");
Pvl *isisLabel = cube.label();

// Dimensions Group
Expand Down Expand Up @@ -401,4 +406,4 @@ TEST(TgoCassisstitch, TgoCassisstitchSingleframeTest) {
EXPECT_EQ(hist->ValidPixels(), 100);
EXPECT_NEAR(hist->StandardDeviation(), 0.063902362199265747, 0.0001);

}
}