Unverified Commit cffba452 authored by Kristin's avatar Kristin Committed by GitHub
Browse files

Update hist application to accpet nbins when min/max are not set (#3935)

* Update hist application to accpet nbins when min/max are not set

* Updated history comment on hist test
parent 92e68f6e
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -84,6 +84,10 @@
      Updated logic such that min/max values are no longer calculated from .cub
      Updated logic such that min/max values are no longer calculated from .cub
      if values are provided by the user.  Fixes #3881.
      if values are provided by the user.  Fixes #3881.
    </change>
    </change>
    <change name="Kristin Berry" date="2020-06-25">
      Re-added the ability to set number of bins without setting min/max values after the last update. 
      Follow-on to #3881.
    </change>
  </history>
  </history>


  <oldName>
  <oldName>
+5 −0
Original line number Original line Diff line number Diff line
@@ -57,7 +57,12 @@ void IsisMain() {
  }
  }
  else {
  else {
    hist = new Histogram(*icube, 1, p.Progress());
    hist = new Histogram(*icube, 1, p.Progress());

    if (ui.WasEntered("NBINS")){
      hist->SetBins(ui.GetInteger("NBINS"));
    }
    }
  }

  // Setup the histogram
  // Setup the histogram


  // Loop and accumulate histogram
  // Loop and accumulate histogram
+12 −1
Original line number Original line Diff line number Diff line
# 2020-06-25 - Kristin Berry - Added a test to check that if nbins is set, it is used.
#   To make the truthdata for this test, I set the number of bins to 25, a number much smaller than 
#   the internal default, and just checked that the output was different from the default test. 

APPNAME = hist
APPNAME = hist
histTruth.txt.IGNORELINES = Cube
histTruth.txt.IGNORELINES = Cube
histTruthNbins.txt.IGNORELINES = Cube
TEMP = $(OUTPUT)/histTruth.txt
TEMP = $(OUTPUT)/histTruth.txt
TEMPNBINS = $(OUTPUT)/histTruthNbins.txt


include $(ISISROOT)/make/isismake.tsts
include $(ISISROOT)/make/isismake.tsts


commands:
commands:
	# Test without additional arguments
	$(APPNAME) from=$(INPUT)/isisTruth.cub \
	$(APPNAME) from=$(INPUT)/isisTruth.cub \
	  to=$(TEMP) > /dev/null;
	  to=$(TEMP) > /dev/null;

	# Test with setting nbins
	$(APPNAME) from=$(INPUT)/isisTruth.cub nbins=25\
	  to=$(TEMPNBINS) > /dev/null;