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

gllssi2isis Original Label Fix #3226

Merged
merged 13 commits into from
Apr 16, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion isis/src/base/objs/ProcessImport/ProcessImport.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ namespace Isis {
* was made to accomodate Rosetta VIRTIS-m calibrated data files and
* has no impact on other supported BIP files.
* Fixes #5398.
* @history 208-07-19 Tyler Wilson - Added support for 4-byte UnsignedInteger special pixel
* @history 2018-07-19 Tyler Wilson - Added support for 4-byte UnsignedInteger special pixel
* values.
*
*/
Expand Down
50 changes: 27 additions & 23 deletions isis/src/galileo/apps/gllssi2isis/gllssi2isis.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@

<description>
Converts a PDS formatted Galileo solid state imager (SSI) image EDR
into an Isis Cube. The required instrument labels will be propagated
into the instrument group. The user must choose an input image label,
output cube name, and frame mode, or summing mode. Galileo SSI images have
a summing mode of FULL (800 x 800 pixels) or SUMMED (400 x 400 pixels).
into an Isis Cube. The required instrument labels will be propagated
into the instrument group. The user must choose an input image label,
output cube name, and frame mode, or summing mode. Galileo SSI images have
a summing mode of FULL (800 x 800 pixels) or SUMMED (400 x 400 pixels).
<p>
<strong> Note: </strong> For the I24 encounter (found in volume go_0022),
many Galileo SSI images of Io were originally "garbled". These images
were reconstructed and released with the filename ####s where ####r is the
name of the original garbled file and #### is the last four digits of the
SPACECRAFT_CLOCK_START_COUNT. These images will have Most of the original
images were 400 x 400 (i.e. SUMMED). However, the reconstructed files are
800 x 800 and must be imported as FULL to get the entire image. If the
user imports a reconstructed image with FRAMEMODE = AUTO, it will be
<strong> Note: </strong> For the I24 encounter (found in volume go_0022),
many Galileo SSI images of Io were originally "garbled". These images
were reconstructed and released with the filename ####s where ####r is the
name of the original garbled file and #### is the last four digits of the
SPACECRAFT_CLOCK_START_COUNT. These images will have Most of the original
images were 400 x 400 (i.e. SUMMED). However, the reconstructed files are
800 x 800 and must be imported as FULL to get the entire image. If the
user imports a reconstructed image with FRAMEMODE = AUTO, it will be
treated as a FULL image, even if the original was SUMMED.
</p>
</description>
Expand All @@ -33,15 +33,15 @@
Converted to Isis 3.0
</change>
<change name="Steven Koechle" date="2007-10-30">
Added Summing Keyword. Moved most hardcoded translations into a
translation table. Modified tests to check the lables. Removed ImageID
Added Summing Keyword. Moved most hardcoded translations into a
translation table. Modified tests to check the lables. Removed ImageID
keyword.
</change>
<change name="Steven Lambright" date="2007-12-31">
Removed the hard coded Instrument Mode ID keyword translation.
</change>
<change name="Steven Lambright" date="2007-01-08">
Added summing options. Output summed images will now only be a quarter of
Added summing options. Output summed images will now only be a quarter of
the size for calibration (the upper-left data in the input is preserved).
</change>
<change name="Christopher Austin" date="2008-03-18">
Expand All @@ -52,7 +52,7 @@
</change>
<change name="Jeannie Walldren" date="2009-06-08">
Added valid DATA_SET_ID value for reconstructed images (i.e. value
contains "SSI-4-REDR-V1.0"). Modified code to set as FULL summing
contains "SSI-4-REDR-V1.0"). Modified code to set as FULL summing
mode if FRAMEMODE=AUTO and the image is reconstructed.
</change>
<change name="Tyler Wilson" date="2015-10-02">
Expand All @@ -64,6 +64,10 @@
Changed documentation to have the correct link to the Planetary Science Data
Dictionary Document. Fixes #3867
</change>
<change name="Adam Paquette", date="2019-04-16">
Fixed original label not being written to cubes ingested using the summed
option. Fixes #3207
</change>


</history>
Expand Down Expand Up @@ -129,7 +133,7 @@
<parameter name="FRAMEMODE">
<type>string</type>
<brief>Summing mode of the input image</brief>
<description>Summing mode of the input image. The user
<description>Summing mode of the input image. The user
may specify the summing mode or choose to allow the program to
determine this.
</description>
Expand All @@ -138,15 +142,15 @@
<option value="AUTO">
<brief>Automatically Detect</brief>
<description>
This will attempt to automatically detect the summing mode of the
input image based on the DATA_SET_ID and/or FRAME_DURATION keyword
This will attempt to automatically detect the summing mode of the
input image based on the DATA_SET_ID and/or FRAME_DURATION keyword
values from the input image labels.
</description>
</option>
<option value="SUMMED">
<brief>The image is summed</brief>
<description>
This will treat the input image as if it has a summing mode of 2
This will treat the input image as if it has a summing mode of 2
in both the sample and line direction.
</description>
</option>
Expand Down Expand Up @@ -182,8 +186,8 @@
Example GUI
</brief>
<description>
Screenshot of GUI with parameters filled in to perform the
gllssi2isis application. Input label and output cubes are always
Screenshot of GUI with parameters filled in to perform the
gllssi2isis application. Input label and output cubes are always
required. The FRAMEMODE radio button AUTO is chosen as default.
</description>
<thumbnail width="200" height="177" caption="Gllssi2isis GUI using defaults." src="assets/thumbs/gllssi2isisGuiAutoThumb.jpg"/>
Expand Down Expand Up @@ -214,7 +218,7 @@
<thumbnail width="187" height="200" caption="Output cube imported with defaults" src="assets/thumbs/gllssi2isisOutputAutoThumb.jpg" />
<parameterName>
TO
</parameterName>
</parameterName>
</image>
</outputImages>
</example>
Expand Down
54 changes: 17 additions & 37 deletions isis/src/galileo/apps/gllssi2isis/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "IException.h"
#include "iTime.h"
#include "ProcessImportPds.h"
#include "OriginalLabel.h"
#include "UserInterface.h"

#include <cstdio>
Expand All @@ -14,9 +15,6 @@
#include <QFile>





using namespace std;
using namespace Isis;
bool summed;
Expand All @@ -28,25 +26,19 @@ void translateLabels(Pvl &pdsLabel, Cube *ocube);
void fixPvl(QString fileName);

void IsisMain() {

//initialize globals
summed = false;
summedOutput = NULL;
// Grab the file to import
ProcessImportPds p;
UserInterface &ui = Application::GetUserInterface();
FileName inFile = ui.GetFileName("FROM");
FileName out = ui.GetFileName("TO");


FileName outFile = ui.GetFileName("TO");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this used anywhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will make a change to use it


// Apply a fix to the gallileo pds labels so they can be read
fixPvl(inFile.toString());




// Make sure it is a Galileo SSI image

Pvl lab(inFile.expanded());

//Checks if in file is rdr
Expand Down Expand Up @@ -102,35 +94,34 @@ void IsisMain() {
Pvl pdsLabel;
p.SetPdsFile(inFile.expanded(), "", pdsLabel);

//Set up the output file
Cube *ocube;

// If summed handle the image similarly to pds2isis
// with an extra translation step
if (!summed) {
ocube = p.SetOutputCube("TO");
Cube *ocube = p.SetOutputCube("TO");
p.StartProcess();
translateLabels(pdsLabel, ocube);
p.EndProcess();
}
else {
// Otherwise the dimensions of the cube need to be cut in half before
// processsing. Since we didn't set the output cube we need to take care
// of writting the original label ourselves
summedOutput = new Cube();
summedOutput->setDimensions(p.Samples() / 2, p.Lines() / 2, p.Bands());
summedOutput->setPixelType(p.PixelType());
summedOutput->create(ui.GetFileName("TO"));
p.StartProcess(translateData);
ocube = summedOutput;
}
summedOutput->create(outFile.expanded());

translateLabels(pdsLabel, ocube);
p.EndProcess();
p.StartProcess(translateData);
translateLabels(pdsLabel, summedOutput);

if (summed) {
OriginalLabel ol(Pvl(inFile.expanded()));
summedOutput->write(ol);
summedOutput->close();
delete summedOutput;
}

return;
}



/**
* This fixes a problem with some of the Pvl files where a comment
* was left open. If the file has this error, the comment is closed
Expand All @@ -141,9 +132,6 @@ void IsisMain() {
* being checked
*
*/



void fixPvl(QString fileName){

QFile pvlFile;
Expand Down Expand Up @@ -174,15 +162,7 @@ void fixPvl(QString fileName){

}









void translateData(Buffer &inData) {
void translateData(Isis::Buffer &inData) {
summedOutput->write(inData);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be replaced with ocube to get rid of summedOutput altogether?

}

Expand Down