Unverified Commit dce1406b authored by acpaquette's avatar acpaquette Committed by GitHub
Browse files

Ciss2isis fix (#5470)

* Set default DN max values

* Fixed method signature
parent 8c891a13
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -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...");
      }
@@ -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();
@@ -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
@@ -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"));