BornAgain
1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Public Member Functions | |
AngularSpecScan (double wl, std::vector< double > inc_angle) | |
AngularSpecScan (double wl, const IAxis &inc_angle) | |
AngularSpecScan (double wl, int nbins, double alpha_i_min, double alpha_i_max) | |
~AngularSpecScan () override | |
AngularSpecScan * | 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 |
double | wavelength () const |
const ScanResolution * | wavelengthResolution () const |
const ScanResolution * | angleResolution () const |
void | setFootprintFactor (const IFootprintFactor *f_factor) |
void | setWavelengthResolution (const ScanResolution &resolution) |
void | setRelativeWavelengthResolution (const RangedDistribution &distr, double rel_dev) |
void | setRelativeWavelengthResolution (const RangedDistribution &distr, const std::vector< double > &rel_dev) |
void | setAbsoluteWavelengthResolution (const RangedDistribution &distr, double std_dev) |
void | setAbsoluteWavelengthResolution (const RangedDistribution &distr, const std::vector< double > &std_dev) |
void | setAngleResolution (const ScanResolution &resolution) |
void | setRelativeAngularResolution (const RangedDistribution &distr, double rel_dev) |
void | setRelativeAngularResolution (const RangedDistribution &distr, const std::vector< double > &rel_dev) |
void | setAbsoluteAngularResolution (const RangedDistribution &distr, double std_dev) |
void | setAbsoluteAngularResolution (const RangedDistribution &distr, const std::vector< double > &std_dev) |
virtual void | transferToCPP () |
Private Types | |
using | DistrOutput = std::vector< std::vector< ParameterSample > > |
Private Member Functions | |
void | checkInitialization () |
DistrOutput | applyWlResolution () const |
DistrOutput | applyIncResolution () const |
Private Attributes | |
double | m_wl |
std::unique_ptr< IAxis > | m_inc_angle |
std::unique_ptr< IFootprintFactor > | m_footprint |
std::unique_ptr< ScanResolution > | m_wl_resolution |
DistrOutput | m_wl_res_cache |
std::unique_ptr< ScanResolution > | m_inc_resolution |
DistrOutput | m_inc_res_cache |
Scan type with inclination angles as coordinate values and a unique wavelength.
Features footprint correction.
Definition at line 27 of file AngularSpecScan.h.
|
private |
Definition at line 112 of file AngularSpecScan.h.
AngularSpecScan::AngularSpecScan | ( | double | wl, |
std::vector< double > | inc_angle | ||
) |
Definition at line 46 of file AngularSpecScan.cpp.
References checkInitialization().
Referenced by clone().
AngularSpecScan::AngularSpecScan | ( | double | wl, |
const IAxis & | inc_angle | ||
) |
Definition at line 55 of file AngularSpecScan.cpp.
References checkInitialization().
AngularSpecScan::AngularSpecScan | ( | double | wl, |
int | nbins, | ||
double | alpha_i_min, | ||
double | alpha_i_max | ||
) |
Sets angle-defined specular scan.
The first parameter is always a wavelength in nm. Second parameter is either a numpy array of incident angles in radians or an IAxis object with angle values. Alternatively an axis can be defined in-place, then the second passed parameter is the number of bins, third - minimum on-axis angle value, fourth - maximum on-axis angle value.
Definition at line 63 of file AngularSpecScan.cpp.
References checkInitialization().
|
overridedefault |
|
overridevirtual |
Implements ISpecularScan.
Definition at line 72 of file AngularSpecScan.cpp.
References AngularSpecScan(), m_footprint, m_inc_angle, m_inc_resolution, m_wl, and m_wl_resolution.
|
overridevirtual |
Generates simulation elements for specular simulations.
Implements ISpecularScan.
Definition at line 83 of file AngularSpecScan.cpp.
References applyIncResolution(), applyWlResolution(), anonymous_namespace{AngularSpecScan.cpp}::extractValues(), m_inc_angle, M_PI_2, numberOfSimulationElements(), and ParameterSample::value.
|
inlineoverridevirtual |
Returns coordinate axis assigned to the data holder.
Implements ISpecularScan.
Definition at line 46 of file AngularSpecScan.h.
References m_inc_angle.
Referenced by anonymous_namespace{SpecularSimulation.cpp}::mangledScan(), and print().
|
inlineoverridevirtual |
Returns IFootprintFactor object pointer.
Implements ISpecularScan.
Definition at line 49 of file AngularSpecScan.h.
References m_footprint.
Referenced by anonymous_namespace{SpecularSimulation.cpp}::mangledScan().
|
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 186 of file AngularSpecScan.cpp.
References applyIncResolution(), anonymous_namespace{AngularSpecScan.cpp}::extractValues(), m_footprint, m_inc_resolution, M_PI_2, m_wl_resolution, numberOfSimulationElements(), and ParameterSample::value.
|
overridevirtual |
Returns the number of simulation elements.
Implements ISpecularScan.
Definition at line 223 of file AngularSpecScan.cpp.
References m_inc_angle, m_inc_resolution, and m_wl_resolution.
Referenced by footprint(), and generateSimulationElements().
|
overridevirtual |
Returns intensity vector corresponding to convolution of given simulation elements.
Implements ISpecularScan.
Definition at line 229 of file AngularSpecScan.cpp.
References applyIncResolution(), applyWlResolution(), anonymous_namespace{AngularSpecScan.cpp}::extractValues(), m_inc_angle, and ParameterSample::weight.
|
overridevirtual |
Print scan definition in python format.
Implements ISpecularScan.
Definition at line 253 of file AngularSpecScan.cpp.
References coordinateAxis(), pyfmt::indent(), m_footprint, m_inc_resolution, m_wl, m_wl_resolution, pyfmt::printDouble(), and IAxis::pyString().
|
inline |
|
inline |
Definition at line 68 of file AngularSpecScan.h.
References m_wl_resolution.
Referenced by anonymous_namespace{SpecularSimulation.cpp}::mangledScan().
|
inline |
Definition at line 69 of file AngularSpecScan.h.
References m_inc_resolution.
Referenced by anonymous_namespace{SpecularSimulation.cpp}::mangledScan().
void AngularSpecScan::setFootprintFactor | ( | const IFootprintFactor * | f_factor | ) |
Sets footprint correction factor.
Definition at line 105 of file AngularSpecScan.cpp.
References IFootprintFactor::clone(), and m_footprint.
Referenced by StandardSimulations::SpecularWithGaussianBeam(), and StandardSimulations::SpecularWithSquareBeam().
void AngularSpecScan::setWavelengthResolution | ( | const ScanResolution & | resolution | ) |
Sets wavelength resolution values via ScanResolution object.
Definition at line 110 of file AngularSpecScan.cpp.
References ScanResolution::clone(), m_wl_res_cache, and m_wl_resolution.
Referenced by setAbsoluteWavelengthResolution(), setRelativeWavelengthResolution(), and StandardSimulations::SpecularDivergentBeam().
void AngularSpecScan::setRelativeWavelengthResolution | ( | const RangedDistribution & | distr, |
double | rel_dev | ||
) |
Definition at line 117 of file AngularSpecScan.cpp.
References ScanResolution::scanRelativeResolution(), and setWavelengthResolution().
void AngularSpecScan::setRelativeWavelengthResolution | ( | const RangedDistribution & | distr, |
const std::vector< double > & | rel_dev | ||
) |
Sets wavelength 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 inclination angle axis.
Definition at line 125 of file AngularSpecScan.cpp.
References ScanResolution::scanRelativeResolution(), and setWavelengthResolution().
void AngularSpecScan::setAbsoluteWavelengthResolution | ( | const RangedDistribution & | distr, |
double | std_dev | ||
) |
Definition at line 133 of file AngularSpecScan.cpp.
References ScanResolution::scanAbsoluteResolution(), and setWavelengthResolution().
void AngularSpecScan::setAbsoluteWavelengthResolution | ( | const RangedDistribution & | distr, |
const std::vector< double > & | std_dev | ||
) |
Sets wavelength 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 inclination angle axis.
Definition at line 141 of file AngularSpecScan.cpp.
References ScanResolution::scanAbsoluteResolution(), and setWavelengthResolution().
void AngularSpecScan::setAngleResolution | ( | const ScanResolution & | resolution | ) |
Sets angle resolution values via ScanResolution object.
Definition at line 149 of file AngularSpecScan.cpp.
References ScanResolution::clone(), m_inc_res_cache, and m_inc_resolution.
Referenced by setAbsoluteAngularResolution(), setRelativeAngularResolution(), and StandardSimulations::SpecularDivergentBeam().
void AngularSpecScan::setRelativeAngularResolution | ( | const RangedDistribution & | distr, |
double | rel_dev | ||
) |
Definition at line 156 of file AngularSpecScan.cpp.
References ScanResolution::scanRelativeResolution(), and setAngleResolution().
void AngularSpecScan::setRelativeAngularResolution | ( | const RangedDistribution & | distr, |
const std::vector< double > & | rel_dev | ||
) |
Sets angular 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 inclination angle axis.
Definition at line 163 of file AngularSpecScan.cpp.
References ScanResolution::scanRelativeResolution(), and setAngleResolution().
void AngularSpecScan::setAbsoluteAngularResolution | ( | const RangedDistribution & | distr, |
double | std_dev | ||
) |
Definition at line 171 of file AngularSpecScan.cpp.
References ScanResolution::scanAbsoluteResolution(), and setAngleResolution().
void AngularSpecScan::setAbsoluteAngularResolution | ( | const RangedDistribution & | distr, |
const std::vector< double > & | std_dev | ||
) |
Sets angular 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 inclination angle axis.
Definition at line 178 of file AngularSpecScan.cpp.
References ScanResolution::scanAbsoluteResolution(), and setAngleResolution().
|
private |
Definition at line 280 of file AngularSpecScan.cpp.
References m_inc_angle, and m_wl.
Referenced by AngularSpecScan().
|
private |
Definition at line 294 of file AngularSpecScan.cpp.
References m_inc_angle, m_wl, m_wl_res_cache, and m_wl_resolution.
Referenced by createIntensities(), and generateSimulationElements().
|
private |
Definition at line 301 of file AngularSpecScan.cpp.
References m_inc_angle, m_inc_res_cache, and m_inc_resolution.
Referenced by createIntensities(), footprint(), and generateSimulationElements().
|
inlinevirtualinherited |
Used for Python overriding of clone (see swig/tweaks.py)
Definition at line 34 of file ICloneable.h.
|
private |
Definition at line 118 of file AngularSpecScan.h.
Referenced by applyWlResolution(), checkInitialization(), clone(), print(), and wavelength().
|
private |
Definition at line 119 of file AngularSpecScan.h.
Referenced by applyIncResolution(), applyWlResolution(), checkInitialization(), clone(), coordinateAxis(), createIntensities(), generateSimulationElements(), and numberOfSimulationElements().
|
private |
Definition at line 120 of file AngularSpecScan.h.
Referenced by clone(), footprint(), footprintFactor(), print(), and setFootprintFactor().
|
private |
Definition at line 122 of file AngularSpecScan.h.
Referenced by applyWlResolution(), clone(), footprint(), numberOfSimulationElements(), print(), setWavelengthResolution(), and wavelengthResolution().
|
mutableprivate |
Definition at line 123 of file AngularSpecScan.h.
Referenced by applyWlResolution(), and setWavelengthResolution().
|
private |
Definition at line 125 of file AngularSpecScan.h.
Referenced by angleResolution(), applyIncResolution(), clone(), footprint(), numberOfSimulationElements(), print(), and setAngleResolution().
|
mutableprivate |
Definition at line 126 of file AngularSpecScan.h.
Referenced by applyIncResolution(), and setAngleResolution().