java.lang.Object
uk.ac.diamond.scisoft.analysis.dataset.function.Histogram
All Implemented Interfaces:
DatasetToDatasetFunction

public class Histogram extends Object
Find histogram of each dataset and return pairs of 1D integer dataset of bin counts and 1D double dataset of bin edges (including rightmost edge).

By default, outliers are ignored.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
     
    protected org.eclipse.january.dataset.Dataset
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Histogram(int numBins)
    Constructor of the Histogram
    Histogram(int numBins, double lower, double upper)
    Constructor of the Histogram
    Histogram(int numBins, double lower, double upper, boolean ignore)
    Constructor of the Histogram
    Histogram(org.eclipse.january.dataset.IDataset edges)
    Constructor of the Histogram, ignoring outliers
    Histogram(org.eclipse.january.dataset.IDataset edges, boolean ignore)
    Constructor of the Histogram
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    setIgnoreOutliers(boolean b)
    Set histogram's outliers handling
    void
    setMinMax(double min, double max)
    Set minimum and maximum edges of histogram bins
    void
    setWeights(org.eclipse.january.dataset.IDataset weights)
    Set weights to use to add to count
    List<org.eclipse.january.dataset.Dataset>
    value(org.eclipse.january.dataset.IDataset... datasets)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ignoreOutliers

      protected boolean ignoreOutliers
    • weights

      protected org.eclipse.january.dataset.Dataset weights
  • Constructor Details

    • Histogram

      public Histogram(int numBins)
      Constructor of the Histogram
      Parameters:
      numBins - number of bins
    • Histogram

      public Histogram(int numBins, double lower, double upper)
      Constructor of the Histogram
      Parameters:
      numBins - number of bins
      lower - minimum value of histogram range
      upper - maximum value of histogram range
    • Histogram

      public Histogram(int numBins, double lower, double upper, boolean ignore)
      Constructor of the Histogram
      Parameters:
      numBins - number of bins
      lower - minimum value of histogram range
      upper - maximum value of histogram range
      ignore - if true, outliers will be ignored
    • Histogram

      public Histogram(org.eclipse.january.dataset.IDataset edges)
      Constructor of the Histogram, ignoring outliers
      Parameters:
      edges - bin edges including rightmost edge
    • Histogram

      public Histogram(org.eclipse.january.dataset.IDataset edges, boolean ignore)
      Constructor of the Histogram
      Parameters:
      edges - bin edges including rightmost edge
      ignore - if true, outliers will be ignored
  • Method Details

    • setMinMax

      public void setMinMax(double min, double max)
      Set minimum and maximum edges of histogram bins
      Parameters:
      min -
      max -
    • value

      public List<org.eclipse.january.dataset.Dataset> value(org.eclipse.january.dataset.IDataset... datasets)
      Parameters:
      datasets - input datasets
      Returns:
      a list of 1D datasets which are histograms and bins
    • setIgnoreOutliers

      public void setIgnoreOutliers(boolean b)
      Set histogram's outliers handling
      Parameters:
      b - if true, then ignore values that lie outside minimum and maximum bin edges
    • setWeights

      public void setWeights(org.eclipse.january.dataset.IDataset weights)
      Set weights to use to add to count

      Input dataset shapes must match weights shape otherwise null is given

      Parameters:
      weights -