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

Update to Stats Best[Max|Min]imum functions (#4433)

* Forced stats bestmin and bestmax to return the min and max if they are equal

* Added change log entry
parent 2b4ba67d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ release.
- Fixed logging in FindFeatures where we were trying to get a non-existent Pvl group from the Pvl log. [#4375](https://github.com/USGS-Astrogeology/ISIS3/issues/4375)
- Fixed an arccos evaluating a double close to either 1, -1 when calculating the ground azimuth in camera.cpp. [#4393](https://github.com/USGS-Astrogeology/ISIS3/issues/4393)
- Fixed hist outputs to N/A when all DNs are special pixels. [#3709](https://github.com/USGS-Astrogeology/ISIS3/issues/3709)
- Fixed an Minimum|Maximum calculation error when comparing all equal data in the qview statstics tool. [#4433](https://github.com/USGS-Astrogeology/ISIS3/issues/4414)

## [5.0.0] - 2021-04-01

+8 −0
Original line number Diff line number Diff line
@@ -597,6 +597,10 @@ namespace Isis {
   */
  double Statistics::BestMinimum(const double percent) const {
    if (m_validPixels < 1) return Isis::NULL8;
    // ChebyshevMinimum can return erroneous values when the data is all a
    // single value
    // In this case, we just want to return the minimum
    if (Minimum() == Maximum()) return Minimum();
    double min = ChebyshevMinimum(percent);
    if (Minimum() > min) min = Minimum();
    return min;
@@ -620,6 +624,10 @@ namespace Isis {
   */
  double Statistics::BestMaximum(const double percent) const {
    if (m_validPixels < 1) return Isis::NULL8;
    // ChebyshevMaximum can return erroneous values when the data is all a
    // single value
    // In this case, we just want to return the maximum
    if (Minimum() == Maximum()) return Maximum();
    double max = ChebyshevMaximum(percent);
    if (Maximum() < max) max = Maximum();
    return max;