Commit 92dc6c58 authored by Kristin Berry's avatar Kristin Berry
Browse files

Fixed demprep's padding for special pixels. Fixes  #1010

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@5907 41f8697f-d340-4b68-9986-7bafba869bb8
parent 1a5d9b2a
Loading
Loading
Loading
Loading
+28 −2
Original line number Diff line number Diff line
@@ -322,9 +322,21 @@ void DoWrap(Buffer &in) {

  // Write top pad?
  if (topPad == 1 && in.Line() == 1) {
    double average = inputLineStats.Average();
    double average = inputLineStats.Average(); //may be Isis::NULL8
    for(int outputIndex = 0; outputIndex < outputSize; outputIndex++) {
      int inputIndex = outputIndex - leftPad;
      if (average == Isis::NULL8) {
        if(inputIndex < 0) {
          outMan[outputIndex] = in[inputIndex + inputSize];
        }
        else if(inputIndex < inputSize) {
          outMan[outputIndex] = in[inputIndex];
        }
        else {
          outMan[outputIndex] = in[inputIndex - inputSize];
        }
      }
      else {
        if(inputIndex < 0) {
          outMan[outputIndex] = 2.0 * average - in[inputIndex + inputSize];
        }
@@ -335,6 +347,7 @@ void DoWrap(Buffer &in) {
          outMan[outputIndex] = 2.0 * average - in[inputIndex - inputSize];
        }
      }
    }
    outMan.SetLine(1);

    outCubeStats.AddData(&outMan[0], outMan.size());
@@ -361,9 +374,21 @@ void DoWrap(Buffer &in) {

  // Write bottom pad?
  if (bottomPad == 1 && in.Line() == inl) {
    double average = inputLineStats.Average();
    double average = inputLineStats.Average(); //may be Isis::NULL8
    for (int outputIndex = 0; outputIndex < outputSize; outputIndex++) {
    int inputIndex = outputIndex - leftPad;
      if (average == Isis::NULL8) {
        if(inputIndex < 0) {
          outMan[outputIndex] = in[inputIndex + inputSize];
        }
        else if(inputIndex < inputSize) {
          outMan[outputIndex] = in[inputIndex];
        }
        else {
          outMan[outputIndex] = in[inputIndex - inputSize];
        }
      }
      else {
        if(inputIndex < 0) {
          outMan[outputIndex] = 2.0 * average - in[inputIndex + inputSize];
        }
@@ -374,6 +399,7 @@ void DoWrap(Buffer &in) {
          outMan[outputIndex] = 2.0 * average - in[inputIndex - inputSize];
        }
      }
    }
    outMan.SetLine(inl + topPad + bottomPad);
    outCubeStats.AddData(&outMan[0], outMan.size());
    ocube->write(outMan);
+3 −0
Original line number Diff line number Diff line
@@ -57,6 +57,9 @@
    <change name="Debbie A. Cook" date="2012-12-10">
      Changed to use TProjection instead of Projection.  References #775
    </change>
    <change name="Kristin Berry" date="2014-05-30">
      Fixed padding for special pixels. References #1010
    </change>
  </history>

  <category>
+11 −0
Original line number Diff line number Diff line
APPNAME = demprep

labels.txt.IGNORELINES = Bytes StartByte ByteOrder TileSamples TileLines

include $(ISISROOT)/make/isismake.tsts

commands:
	$(APPNAME) from=$(INPUT)/vest64_dtm_specialpixels.cub \
	to=$(OUTPUT)/vest64_dtm_specialpixels.cub > /dev/null;
	catlab from=$(OUTPUT)/vest64_dtm_specialpixels.cub    \
	to=$(OUTPUT)/labels.txt > /dev/null;