Unverified Commit dbffb2d9 authored by Tyler Wilson's avatar Tyler Wilson Committed by GitHub
Browse files

Merge pull request #167 from jessemapel/rosetta_dark

Added dark current nulling to rosvirtis2isis. Fixes #5421.
parents 4f4437d4 26c44a69
Loading
Loading
Loading
Loading
+21 −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,26 @@ 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");
    // The third frame key is always the number of scans in between dark current scans.
    // So, we need to add one to that in order to get the number of lines to next dark current.
    int darkRate = toInt(frameKey[3]) + 1;
    LineManager darkLineManager(*outcube);

    for (int band = 1; band <= outcube->bandCount(); band++) {
      // The first line is always a dark current, so start there.
      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 ();
}

+3 −0
Original line number Diff line number Diff line
@@ -58,6 +58,9 @@
    <change name="Jesse Mapel" date="2018-05-14">
       Fixed compiler warnings from new lvl3 ingestion code.
    </change>
    <change name="Jesse Mapel" date="2018-05-14">
       Nulled dark current scans in level 2 data. Fixes #5421.
    </change>
  </history>

  <category>