BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
Histogram1D Class Reference

One dimensional histogram. More...

+ Inheritance diagram for Histogram1D:

Public Member Functions

 Histogram1D (const IAxis &axis)
 Constructor for 1D histogram with custom axis.
 
 Histogram1D (const OutputData< double > &data)
 Constructor for 1D histograms from basic OutputData object.
 
 Histogram1D (int nbinsx, const std::vector< double > &xbins)
 Constructor for variable bin size histograms. More...
 
 Histogram1D (int nbinsx, double xlow, double xup)
 Constructor for fix bin size histograms. More...
 
std::vector< double > binCenters () const
 returns vector of histogram bin centers
 
PyObject * binCentersNumpy () const
 
std::vector< double > binErrors () const
 returns vector of bin errors
 
PyObject * binErrorsNumpy () const
 
std::vector< double > binValues () const
 returns vector of bin content (the value accumulated by bins)
 
PyObject * binValuesNumpy () const
 
Histogram1Dclone () const
 Returns clone of other histogram.
 
Histogram1Dcrop (double xmin, double xmax)
 Creates new histogram by applying crop on axis.
 
int fill (double x, double weight=1.0)
 Increment bin with abscissa x with a weight.
 
size_t rank () const
 Returns the number of histogram dimensions.
 

Detailed Description

One dimensional histogram.

Constructor & Destructor Documentation

◆ Histogram1D() [1/2]

Histogram1D::Histogram1D ( int  nbinsx,
double  xlow,
double  xup 
)

Constructor for fix bin size histograms.

Parameters
nbinsxnumber of bins
xlowlow edge of the first bin
xupupper edge of the last bin

◆ Histogram1D() [2/2]

Histogram1D::Histogram1D ( int  nbinsx,
const std::vector< double > &  xbins 
)

Constructor for variable bin size histograms.

Parameters
nbinsxnumber of bins
xbinsArray of size nbins+1 containing low-edges for each bin and upper edge of last bin.