67 #ifdef BORNAGAIN_PYTHON
88 const std::unique_ptr<IAxis> xaxis(
getXaxis().createClippedAxis(xmin, xmax));
95 *it_result = *it_origin;
Defines various functions to interact from numpy on Python side.
Defines class Histogram1D.
Defines class VariableBinAxis.
Axis with fixed bin size.
One dimensional histogram.
std::vector< double > getBinCenters() const
returns vector of histogram bin centers
int fill(double x, double weight=1.0)
Increment bin with abscissa x with a weight.
std::vector< double > getBinErrors() const
returns vector of bin errors
Histogram1D * crop(double xmin, double xmax)
Creates new histogram by applying crop on axis.
PyObject * getBinCentersNumpy() const
std::vector< double > getBinValues() const
returns vector of bin content (the value accumulated by bins)
Histogram1D(int nbinsx, double xlow, double xup)
Constructor for fix bin size histograms.
PyObject * getBinErrorsNumpy() const
PyObject * getBinValuesNumpy() const
Histogram1D * clone() const
Returns clone of other histogram.
Interface for one-dimensional axes.
virtual bool contains(double value) const
Returns true if axis contains given point.
virtual size_t findClosestIndex(double value) const =0
find bin index which is best match for given value
virtual double getMin() const =0
Returns value of first point of axis.
virtual std::vector< double > getBinCenters() const
virtual double getMax() const =0
Returns value of last point of axis.
Base class for 1D and 2D histograms holding values of double type.
std::vector< double > getDataVector(DataType dataType) const
returns vector of values of requested DataType
OutputData< CumulativeValue > m_data
void init_from_data(const OutputData< double > &source)
const IAxis & getXaxis() const
returns x-axis
iterator end()
Returns read/write iterator that points to the one past last element.
void addAxis(const IAxis &new_axis)
iterator begin()
Returns read/write iterator that points to the first element.
double getAxisValue(size_t global_index, size_t i_selected_axis) const
Returns the value of selected axis for given global_index.
Axis with variable bin size.
PyObject * createNumpyArray(const std::vector< double > &data)