Unverified Commit 6f954c62 authored by Jesse Mapel's avatar Jesse Mapel Committed by GitHub
Browse files

Updated equalizer output (#4000)

* Fixed equalizer output

* Added changelog

* Added issue number
parent cdd478a8
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -30,6 +30,10 @@ update the Unreleased link so that it compares against the latest release tag.

## [Unreleased]

### Fixed

 - Equalizer now reports the correct equation and values used to perform the adjustment. [#3987](https://github.com/USGS-Astrogeology/ISIS3/issues/3987)

## [4.2.0] - 2020-07-27

### Added
+4 −0
Original line number Diff line number Diff line
@@ -246,6 +246,10 @@
      Changed pvl.DIFF of input for app tests nonOverlapRecalculate and nonOverlapRetryBoth to
      ignore file names. Allows test to pass when not using default data area. Fixes #4738.
    </change>
    <change name="Jesse Mapel" date="2020-09-01">
      Reported formula and variables now match the formula selected by the ADJUST
      argument. Fixes #3987.
    </change>
  </history>

  <groups>
+49 −20
Original line number Diff line number Diff line
@@ -347,23 +347,52 @@ namespace Isis {
    // Add normalization statistics
    for (int img = 0; img < m_imageList.size(); img++) {
      // Format and name information
      // It is important that the variable names are listed in the same
      // order as they are added to the PvlKeyword in the for loop.
      PvlGroup norm("Normalization");
      switch(m_sType) {
        case OverlapNormalization::Both:
          norm.addComment("Formula: newDN = (oldDN - AVERAGE) * GAIN + AVERAGE + OFFSET");
          norm.addComment("BandN = (GAIN, OFFSET, AVERAGE)");
          break;
        case OverlapNormalization::Gains:
          norm.addComment("Formula: newDN = oldDN * GAIN + AVERAGE * GAIN");
          norm.addComment("BandN = (GAIN, AVERAGE)");
          break;
        case OverlapNormalization::Offsets:
          norm.addComment("Formula: newDN = OFFSET + AVERAGE");
          norm.addComment("BandN = (OFFSET, AVERAGE)");
          break;
        case OverlapNormalization::GainsWithoutNormalization:
          norm.addComment("Formula: newDN = oldDN * GAIN");
          norm.addComment("BandN = (GAIN)");
          break;
      }
      norm += PvlKeyword("FileName", m_imageList[img].original());

      if (m_normsSolved) {
        // Band by band statistics
        for (int band = 1; band <= m_maxBand; band++) {
          QString mult = toString(m_adjustments[img]->getGain(band - 1));
          QString base = toString(m_adjustments[img]->getOffset(band - 1));
          QString avg = toString(m_adjustments[img]->getAverage(band - 1));
          QString bandNum = toString(band);
          QString bandStr = "Band" + bandNum;
          PvlKeyword bandStats(bandStr);
          bandStats += mult;
          bandStats += base;
          bandStats += avg;
          // GAIN
          if (m_sType == OverlapNormalization::Both ||
              m_sType == OverlapNormalization::Gains ||
              m_sType == OverlapNormalization::GainsWithoutNormalization) {
            bandStats += toString(m_adjustments[img]->getGain(band - 1));
          }
          // OFFSET
          if (m_sType == OverlapNormalization::Both ||
              m_sType == OverlapNormalization::Offsets) {
            bandStats += toString(m_adjustments[img]->getOffset(band - 1));
          }
          // AVERAGE
          if (m_sType == OverlapNormalization::Both ||
              m_sType == OverlapNormalization::Gains ||
              m_sType == OverlapNormalization::Offsets) {
            bandStats += toString(m_adjustments[img]->getAverage(band - 1));
          }
          norm += bandStats;
        }
      }