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

Ciss2isis fix #5470

Merged
merged 2 commits into from
Jul 16, 2024
Merged
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
11 changes: 10 additions & 1 deletion isis/src/cassini/apps/ciss2isis/ciss2isis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ namespace Isis{

//SET PROGRESS TEXT, VALID MAXIMUM PIXEL VALUE, AND CREATE STRETCH IF NEEDED
if(dataConversionType != "Table") { //Conversion Type is 12Bit or 8LSB, only save off overclocked pixels
validMax = 255;
if(dataConversionType == "12Bit") {
p.Progress()->SetText("Image was 12 bit. No conversion needed. \nSaving line prefix data...");
}
Expand All @@ -85,6 +86,7 @@ namespace Isis{
}
}
else { //if ConversionType == Table, Use LUT to create stretch pairs for conversion
validMax = 4095;
CreateStretchPairs();
// Pvl outputLabels;
Pvl *outputLabel = ocube->label();
Expand All @@ -96,6 +98,14 @@ namespace Isis{
p.Progress()->SetText("Image was converted using 12-to-8 bit table. \nConverting prefix pixels back to 12 bit and saving line prefix data...");
}

Pvl inputLabel(in.expanded());
if (inputLabel.hasKeyword("VALID_MAXIMUM")) {
PvlKeyword labelValidMax = inputLabel.findKeyword("VALID_MAXIMUM");
if (labelValidMax[1] != "UNK") {
validMax = toInt(labelValidMax[1]);
}
}

p.StartProcess();

// Write line prefix data to table in output cube
Expand Down Expand Up @@ -294,7 +304,6 @@ namespace Isis{

// initialize global variables
dataConversionType = (QString) inst.findKeyword("DataConversionType");
validMax = inputLabel.findKeyword("ValidMaximum")[1].toInt();
sumMode = inst.findKeyword("SummingMode");
compressionType = (QString) inst.findKeyword("CompressionType");
IString fsw((QString) inst.findKeyword("FlightSoftwareVersionId"));
Expand Down