BornAgain
1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Public Member Functions | |
QSpecScan (std::vector< double > qs_nm) | |
QSpecScan (const IAxis &qs_nm) | |
QSpecScan (int nbins, double qz_min, double qz_max) | |
~QSpecScan () override | |
QSpecScan * | clone () const override |
std::vector< SpecularSimulationElement > | generateSimulationElements () const override |
virtual const IAxis * | coordinateAxis () const override |
virtual const IFootprintFactor * | footprintFactor () const override |
std::vector< double > | footprint (size_t i, size_t n_elements) const override |
size_t | numberOfSimulationElements () const override |
std::vector< double > | createIntensities (const std::vector< SpecularSimulationElement > &sim_elements) const override |
std::string | print () const override |
void | setQResolution (const ScanResolution &resolution) |
void | setRelativeQResolution (const RangedDistribution &distr, double rel_dev) |
void | setRelativeQResolution (const RangedDistribution &distr, const std::vector< double > &rel_dev) |
void | setAbsoluteQResolution (const RangedDistribution &distr, double std_dev) |
void | setAbsoluteQResolution (const RangedDistribution &distr, const std::vector< double > &std_dev) |
virtual void | transferToCPP () |
Private Member Functions | |
void | checkInitialization () |
std::vector< double > | generateQzVector () const |
std::vector< std::vector< ParameterSample > > | applyQResolution () const |
Private Attributes | |
std::unique_ptr< IAxis > | m_qs |
std::unique_ptr< ScanResolution > | m_resolution |
std::vector< std::vector< ParameterSample > > | m_q_res_cache |
Scan type with z-components of scattering vector as coordinate values.
Wavelength and incident angles are not accessible separately.
Definition at line 28 of file QSpecScan.h.
QSpecScan::QSpecScan | ( | std::vector< double > | qs_nm | ) |
Accepts qz-value vector (in inverse nm)
Definition at line 23 of file QSpecScan.cpp.
References checkInitialization().
Referenced by clone().
QSpecScan::QSpecScan | ( | const IAxis & | qs_nm | ) |
Definition at line 30 of file QSpecScan.cpp.
References checkInitialization().
QSpecScan::QSpecScan | ( | int | nbins, |
double | qz_min, | ||
double | qz_max | ||
) |
Sets q-defined specular scan.
Accepts either numpy array of q-values sorted in ascending order or an IAxis object with q-values. Alternatively an axis can be defined in-place, then the first passed parameter is the number of bins, second - minimum on-axis q-value, third - maximum on-axis q_value.
Definition at line 37 of file QSpecScan.cpp.
References checkInitialization().
|
overridedefault |
|
overridevirtual |
Implements ISpecularScan.
Definition at line 46 of file QSpecScan.cpp.
References m_qs, m_resolution, and QSpecScan().
|
overridevirtual |
Generates simulation elements for specular simulations.
Implements ISpecularScan.
Definition at line 54 of file QSpecScan.cpp.
References generateQzVector().
|
inlineoverridevirtual |
Returns coordinate axis assigned to the data holder.
Implements ISpecularScan.
Definition at line 48 of file QSpecScan.h.
References m_qs.
Referenced by print().
|
inlineoverridevirtual |
Returns IFootprintFactor object pointer.
Implements ISpecularScan.
Definition at line 51 of file QSpecScan.h.
|
overridevirtual |
Returns footprint correction factor for a range of simulation elements of size n_elements and starting from element with index i.
Implements ISpecularScan.
Definition at line 65 of file QSpecScan.cpp.
References numberOfSimulationElements().
|
overridevirtual |
Returns the number of simulation elements.
Implements ISpecularScan.
Definition at line 74 of file QSpecScan.cpp.
References m_qs, and m_resolution.
Referenced by footprint(), and generateQzVector().
|
overridevirtual |
Returns intensity vector corresponding to convolution of given simulation elements.
Implements ISpecularScan.
Definition at line 80 of file QSpecScan.cpp.
References applyQResolution(), and m_qs.
|
overridevirtual |
Print scan definition in python format.
Implements ISpecularScan.
Definition at line 98 of file QSpecScan.cpp.
References coordinateAxis(), pyfmt::indent(), m_resolution, and IAxis::pyString().
void QSpecScan::setQResolution | ( | const ScanResolution & | resolution | ) |
Sets q resolution values via ScanResolution object.
Definition at line 113 of file QSpecScan.cpp.
References ScanResolution::clone(), m_q_res_cache, and m_resolution.
Referenced by setAbsoluteQResolution(), and setRelativeQResolution().
void QSpecScan::setRelativeQResolution | ( | const RangedDistribution & | distr, |
double | rel_dev | ||
) |
Definition at line 120 of file QSpecScan.cpp.
References ScanResolution::scanRelativeResolution(), and setQResolution().
Referenced by StandardSimulations::TOFRWithRelativeResolution().
void QSpecScan::setRelativeQResolution | ( | const RangedDistribution & | distr, |
const std::vector< double > & | rel_dev | ||
) |
Sets qz resolution values via RangedDistribution and values of relative deviations (that is, rel_dev equals standard deviation divided by the mean value).
rel_dev can be either single-valued or a numpy array. In the latter case the length of the array should coinside with the length of the qz-axis.
Definition at line 127 of file QSpecScan.cpp.
References ScanResolution::scanRelativeResolution(), and setQResolution().
void QSpecScan::setAbsoluteQResolution | ( | const RangedDistribution & | distr, |
double | std_dev | ||
) |
Definition at line 135 of file QSpecScan.cpp.
References ScanResolution::scanAbsoluteResolution(), and setQResolution().
Referenced by StandardSimulations::TOFRWithPointwiseResolution().
void QSpecScan::setAbsoluteQResolution | ( | const RangedDistribution & | distr, |
const std::vector< double > & | std_dev | ||
) |
Sets qz resolution values via RangedDistribution and values of standard deviations.
std_dev can be either single-valued or a numpy array. In the latter case the length of the array should coinside with the length of the qz-axis.
Definition at line 142 of file QSpecScan.cpp.
References ScanResolution::scanAbsoluteResolution(), and setQResolution().
|
private |
|
private |
Definition at line 162 of file QSpecScan.cpp.
References applyQResolution(), and numberOfSimulationElements().
Referenced by generateSimulationElements().
|
private |
Definition at line 174 of file QSpecScan.cpp.
References m_q_res_cache, m_qs, and m_resolution.
Referenced by createIntensities(), and generateQzVector().
|
inlinevirtualinherited |
Used for Python overriding of clone (see swig/tweaks.py)
Definition at line 34 of file ICloneable.h.
|
private |
Definition at line 91 of file QSpecScan.h.
Referenced by applyQResolution(), checkInitialization(), clone(), coordinateAxis(), createIntensities(), and numberOfSimulationElements().
|
private |
Definition at line 92 of file QSpecScan.h.
Referenced by applyQResolution(), clone(), numberOfSimulationElements(), print(), and setQResolution().
|
mutableprivate |
Definition at line 93 of file QSpecScan.h.
Referenced by applyQResolution(), and setQResolution().