Commit a4c3f538 authored by Jesse Mapel's avatar Jesse Mapel
Browse files

Added dark current nulling to rosvirtis2isis. Fixes #5421.

parent 2ffd04a1
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@

#include "FileName.h"
#include "ImportPdsTable.h"
#include "LineManager.h"
#include "ProcessImportPds.h"
#include "Table.h"
#include "UserInterface.h"
@@ -382,6 +383,23 @@ void IsisMain ()
  }
  outcube->putGroup(kerns);

  // NULL the dark current scans in level 2 images
  if (procLevel == 2) {
    const PvlKeyword &frameKey = outcube->group("Instrument").findKeyword("FrameParameter");
    int darkRate = toInt(frameKey[3]) + 1;
    LineManager darkLineManager(*outcube);

    for (int band = 1; band <= outcube->bandCount(); band++) {
      for (int line = 1; line <= outcube->lineCount(); line+=darkRate) {
        darkLineManager.SetLine(line,band);
        for (int sample = 0; sample < darkLineManager.size(); sample++) {
          darkLineManager[sample] = Isis::Null;
        }
        outcube->write(darkLineManager);
      }
    }
  }

  p.EndProcess ();
}

+12 −9
Original line number Diff line number Diff line
@@ -55,6 +55,9 @@
    <change name="Kris Becker and Kaj Williams" date="2017-08-24">
       Fix issues with the translation of housekeeping data. Fixes #5131.
    </change>
    <change name="Jesse Mapel" date="2018-05-14">
       Nulled dark current scans in level 2 data. Fixes #5421.
    </change>
  </history>

  <category>