BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
Datafield Class Reference

Description

Stores radiation power per bin.

Public Member Functions

 Datafield (const Datafield &)=delete
 
 Datafield (const std::vector< IAxis * > &axes)
 Constructor that takes ownership of supplied axes. More...
 
 Datafield (const std::vector< IAxis * > &axes, const std::vector< double > &vector)
 Constructor that takes ownership of supplied axes. More...
 
 Datafield (Datafield &&)=default
 
 Datafield (Frame *frame)
 Constructor that takes ownership of supplied frame. More...
 
 Datafield (Frame *frame, const std::vector< double > &vector)
 Constructor that takes ownership of supplied frame. More...
 
 ~Datafield ()
 
const IAxis & axis (size_t k) const
 
Datafieldclone () const
 
Datafieldcrop (double xmin, double xmax) const
 
Datafieldcrop (double xmin, double ymin, double xmax, double ymax) const
 
std::vector< double > flatVector () const
 Returns copy of raw data vector. More...
 
const Frameframe () const
 
bool hasSameShape (const Datafield &other) const
 Returns true if objects a) have same dimensions b) bin boundaries of axes coincide. More...
 
bool hasSameSizes (const Datafield &other) const
 Returns true if object have same dimensions and number of axes bins. More...
 
double maxVal () const
 
double minVal () const
 
DatafieldnormalizedToMaximum () const
 
PyObject * npArray () const
 Returns data as Python numpy array. More...
 
double & operator[] (size_t i)
 indexed accessor More...
 
const double & operator[] (size_t i) const
 ied accessor (const) More...
 
size_t rank () const
 
void setAllTo (const double &value)
 Sets content of output data to specific value. More...
 
void setAt (size_t i, double val)
 
void setVector (const std::vector< double > &data_vector)
 Sets new values to raw data vector. More...
 
size_t size () const
 Returns total size of data buffer (product of bin number in every dimension). More...
 
double valAt (size_t i) const
 
const IAxis & xAxis () const
 
DatafieldxProjection ()
 Project a 2D histogram into 1D histogram along X. The projection is made from all bins along y-axis. More...
 
DatafieldxProjection (double ylow, double yup)
 Project a 2D histogram into 1D histogram along X. The projection is made from all y-bins corresponding to ordinate between ylow and yup. More...
 
DatafieldxProjection (double yvalue)
 Project a 2D histogram into 1D histogram along X. The projection is made from the y-bin closest to given ordinate yvalue. More...
 
const IAxis & yAxis () const
 
DatafieldyProjection ()
 Project a 2D histogram into 1D histogram along Y. The projection is made from all bins along x-axis. More...
 
DatafieldyProjection (double xlow, double xup)
 Project a 2D histogram into 1D histogram along Y. The projection is made from all x-bins corresponding to abscissa between xlow and xup. More...
 
DatafieldyProjection (double xvalue)
 Project a 2D histogram into 1D histogram along Y. The projection is made from the x-bin closest to given abscissa xvalue. More...
 

Constructor & Destructor Documentation

◆ Datafield() [1/6]

Datafield::Datafield ( Frame frame)

Constructor that takes ownership of supplied frame.

◆ Datafield() [2/6]

Datafield::Datafield ( Frame frame,
const std::vector< double > &  vector 
)

Constructor that takes ownership of supplied frame.

◆ Datafield() [3/6]

Datafield::Datafield ( const std::vector< IAxis * > &  axes)

Constructor that takes ownership of supplied axes.

◆ Datafield() [4/6]

Datafield::Datafield ( const std::vector< IAxis * > &  axes,
const std::vector< double > &  vector 
)

Constructor that takes ownership of supplied axes.

◆ Datafield() [5/6]

Datafield::Datafield ( const Datafield )
delete

◆ Datafield() [6/6]

Datafield::Datafield ( Datafield &&  )
default

◆ ~Datafield()

Datafield::~Datafield ( )

Member Function Documentation

◆ axis()

const IAxis& Datafield::axis ( size_t  k) const

◆ clone()

Datafield* Datafield::clone ( ) const

◆ crop() [1/2]

Datafield* Datafield::crop ( double  xmin,
double  xmax 
) const

◆ crop() [2/2]

Datafield* Datafield::crop ( double  xmin,
double  ymin,
double  xmax,
double  ymax 
) const

◆ flatVector()

std::vector<double> Datafield::flatVector ( ) const

Returns copy of raw data vector.

◆ frame()

const Frame& Datafield::frame ( ) const

◆ hasSameShape()

bool Datafield::hasSameShape ( const Datafield other) const

Returns true if objects a) have same dimensions b) bin boundaries of axes coincide.

◆ hasSameSizes()

bool Datafield::hasSameSizes ( const Datafield other) const

Returns true if object have same dimensions and number of axes bins.

◆ maxVal()

double Datafield::maxVal ( ) const

◆ minVal()

double Datafield::minVal ( ) const

◆ normalizedToMaximum()

Datafield* Datafield::normalizedToMaximum ( ) const

◆ npArray()

PyObject* Datafield::npArray ( ) const

Returns data as Python numpy array.

◆ operator[]() [1/2]

double& Datafield::operator[] ( size_t  i)

indexed accessor

◆ operator[]() [2/2]

const double& Datafield::operator[] ( size_t  i) const

ied accessor (const)

◆ rank()

size_t Datafield::rank ( ) const

◆ setAllTo()

void Datafield::setAllTo ( const double &  value)

Sets content of output data to specific value.

◆ setAt()

void Datafield::setAt ( size_t  i,
double  val 
)

◆ setVector()

void Datafield::setVector ( const std::vector< double > &  data_vector)

Sets new values to raw data vector.

◆ size()

size_t Datafield::size ( ) const

Returns total size of data buffer (product of bin number in every dimension).

◆ valAt()

double Datafield::valAt ( size_t  i) const

◆ xAxis()

const IAxis& Datafield::xAxis ( ) const

◆ xProjection() [1/3]

Datafield* Datafield::xProjection ( )

Project a 2D histogram into 1D histogram along X. The projection is made from all bins along y-axis.

◆ xProjection() [2/3]

Datafield* Datafield::xProjection ( double  ylow,
double  yup 
)

Project a 2D histogram into 1D histogram along X. The projection is made from all y-bins corresponding to ordinate between ylow and yup.

Parameters
ylowlower edje on y-axis
yupupper edje on y-axis

◆ xProjection() [3/3]

Datafield* Datafield::xProjection ( double  yvalue)

Project a 2D histogram into 1D histogram along X. The projection is made from the y-bin closest to given ordinate yvalue.

Parameters
yvaluethe value on y-axis at which projection is taken

◆ yAxis()

const IAxis& Datafield::yAxis ( ) const

◆ yProjection() [1/3]

Datafield* Datafield::yProjection ( )

Project a 2D histogram into 1D histogram along Y. The projection is made from all bins along x-axis.

◆ yProjection() [2/3]

Datafield* Datafield::yProjection ( double  xlow,
double  xup 
)

Project a 2D histogram into 1D histogram along Y. The projection is made from all x-bins corresponding to abscissa between xlow and xup.

Parameters
xlowlower edje on x-axis
xupupper edje on x-axis

◆ yProjection() [3/3]

Datafield* Datafield::yProjection ( double  xvalue)

Project a 2D histogram into 1D histogram along Y. The projection is made from the x-bin closest to given abscissa xvalue.

Parameters
xvaluethe value on x-axis at which projection is taken