BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
A detector with coordinate axes along angles phi and alpha.
Public Types | |
using | const_iterator = const SimulationAreaIterator & |
Public Member Functions | |
SphericalDetector ()=default | |
SphericalDetector (const SphericalDetector &other) | |
SphericalDetector (size_t n_bin, double width, double phi, double alpha) | |
Returns a detector with phi and alpha axes that have equal width and binning. More... | |
SphericalDetector (size_t n_phi, double phi_min, double phi_max, size_t n_alpha, double alpha_min, double alpha_max) | |
Returns a detector with given phi and alpha axes. More... | |
~SphericalDetector () override=default | |
std::vector< size_t > | active_indices () const |
Returns vector of unmasked detector indices. More... | |
void | addDetAxis (const IAxis &axis) |
void | addMask (const IShape2D &shape, bool mask_value=true) |
Adds mask of given shape to the stack of detector masks. The mask value 'true' means that the channel will be excluded from the simulation. The mask which is added last has priority. More... | |
void | applyDetectorResolution (Datafield *p_intensity_map) const |
Applies the detector resolution to the given intensity maps. More... | |
OwningVector< IAxis > | axesClippedToRegionOfInterest () const |
Returns the axes clipped to the region of interest. If no region of interest is explicitly defined, then the whole detector is taken as "region of interest". More... | |
const IAxis & | axis (size_t index) const |
One axis of the complete detector. Any region of interest is not taken into account. More... | |
size_t | axisBinIndex (size_t index, size_t selected_axis) const |
Calculate axis index for given global index. More... | |
std::string | className () const override |
SphericalDetector * | clone () const override |
Datafield * | createDetectorIntensity (const std::vector< std::unique_ptr< DiffuseElement >> &elements) const |
Returns new intensity map with resolution applied, and cropped to ROI if applicable. More... | |
Coords | defaultCoords () const override |
Returns default axes units. More... | |
size_t | detectorIndexToRegionOfInterestIndex (size_t detectorIndex) const |
const DetectorMask * | detectorMask () const |
const IDetectorResolution * | detectorResolution () const |
Returns a pointer to detector resolution object. More... | |
bool | hasExplicitRegionOfInterest () const |
True if a region of interest is explicitly set. More... | |
void | iterateOverNonMaskedPoints (std::function< void(const_iterator)> func) const |
Iterate over all non-masked points within "region of interest". If no region of interest is explicitly defined, then the whole detector is taken as "region of interest". More... | |
void | iterateOverRegionOfInterest (std::function< void(const_iterator)> func) const |
Iterate over all points within "region of interest", no matter whether they are masked or not. If no region of interest is explicitly defined, then the whole detector is taken as "region of interest". More... | |
void | maskAll () |
Put the mask for all detector channels (i.e. exclude whole detector from the analysis) More... | |
std::vector< const INode * > | nodeChildren () const override |
size_t | numberOfElements () const |
Returns number of simulation elements. More... | |
ICoordSystem * | offspecCoords (IAxis *beamAxis, const Direction &beamDirection) const override |
size_t | rank () const |
Returns number of defined axes. More... | |
std::pair< double, double > | regionOfInterestBounds (size_t iAxis) const |
The lower and upper bound of the region of interest. If no region of interest is explicitly defined, then the whole detector is taken as "region of interest". More... | |
size_t | regionOfInterestIndexToDetectorIndex (size_t regionOfInterestIndex) const |
Convert an index of the region of interest to an index of the detector. If no region of interest is set, then the index stays unmodified (since ROI == detector area). More... | |
void | resetRegionOfInterest () |
Resets region of interest making whole detector plane available for the simulation. More... | |
CoordSystem2D * | scatteringCoords (const Beam &beam) const override |
void | setAnalyzer (R3 direction, double efficiency, double total_transmission) |
Sets the polarization analyzer characteristics of the detector. More... | |
virtual void | setDetectorNormal (const Direction &) |
Inits detector with the beam settings. More... | |
void | setDetectorParameters (size_t n_x, double x_min, double x_max, size_t n_y, double y_min, double y_max) |
Sets equidistant axes. More... | |
void | setDetectorResolution (const IDetectorResolution &p_detector_resolution) |
Sets the detector resolution. More... | |
void | setRegionOfInterest (double xlow, double ylow, double xup, double yup) |
Sets rectangular region of interest with lower left and upper right corners defined. More... | |
void | setResolutionFunction (const IResolutionFunction2D &resFunc) |
size_t | sizeOfRegionOfInterest () const |
The size of the "Region of Interest". Same as totalSize() if no region of interest has been explicitly set. More... | |
size_t | totalSize () const |
Returns total number of pixels. Any region of interest is not taken into account. More... | |
Protected Member Functions | |
virtual std::pair< double, double > | boundsOfExplicitRegionOfInterest (size_t iAxis) const |
Lower and upper bound of one axis of an explicitly set ROI. Return 0/0 if no ROI has been explicitly set. More... | |
void | clear () |
size_t | getGlobalIndex (size_t x, size_t y) const |
Calculate global index from two axis indices. More... | |
virtual size_t | sizeOfExplicitRegionOfInterest () const |
Return 0 if no ROI has been explicitly set. Size means number of data points. More... | |
|
inherited |
|
default |
SphericalDetector::SphericalDetector | ( | size_t | n_phi, |
double | phi_min, | ||
double | phi_max, | ||
size_t | n_alpha, | ||
double | alpha_min, | ||
double | alpha_max | ||
) |
Returns a detector with given phi and alpha axes.
n_phi | number of phi-axis bins |
phi_min | low edge of first phi-bin |
phi_max | upper edge of last phi-bin |
n_alpha | number of alpha-axis bins |
alpha_min | low edge of first alpha-bin |
alpha_max | upper edge of last alpha-bin |
SphericalDetector::SphericalDetector | ( | size_t | n_bin, |
double | width, | ||
double | phi, | ||
double | alpha | ||
) |
Returns a detector with phi and alpha axes that have equal width and binning.
n_bin | number of bins per direction |
width | full width of angular range in phi or alpha |
phi | central phi angle |
alpha | central alpha angle |
SphericalDetector::SphericalDetector | ( | const SphericalDetector & | other | ) |
|
overridedefault |
|
inherited |
Returns vector of unmasked detector indices.
|
inherited |
|
inherited |
|
inherited |
Applies the detector resolution to the given intensity maps.
|
inherited |
Returns the axes clipped to the region of interest. If no region of interest is explicitly defined, then the whole detector is taken as "region of interest".
|
inherited |
One axis of the complete detector. Any region of interest is not taken into account.
|
inherited |
Calculate axis index for given global index.
|
protectedvirtualinherited |
Lower and upper bound of one axis of an explicitly set ROI. Return 0/0 if no ROI has been explicitly set.
|
override |
|
protectedinherited |
|
overridevirtual |
Implements IDetector.
|
inherited |
Returns new intensity map with resolution applied, and cropped to ROI if applicable.
|
overridevirtual |
Returns default axes units.
Implements IDetector.
|
inherited |
|
inherited |
|
inherited |
Returns a pointer to detector resolution object.
|
protectedinherited |
Calculate global index from two axis indices.
|
inherited |
True if a region of interest is explicitly set.
|
inherited |
Iterate over all non-masked points within "region of interest". If no region of interest is explicitly defined, then the whole detector is taken as "region of interest".
|
inherited |
Iterate over all points within "region of interest", no matter whether they are masked or not. If no region of interest is explicitly defined, then the whole detector is taken as "region of interest".
|
inherited |
Put the mask for all detector channels (i.e. exclude whole detector from the analysis)
|
overrideinherited |
|
inherited |
Returns number of simulation elements.
|
overridevirtual |
Implements IDetector.
|
inherited |
Returns number of defined axes.
|
inherited |
The lower and upper bound of the region of interest. If no region of interest is explicitly defined, then the whole detector is taken as "region of interest".
|
inherited |
Convert an index of the region of interest to an index of the detector. If no region of interest is set, then the index stays unmodified (since ROI == detector area).
|
inherited |
Resets region of interest making whole detector plane available for the simulation.
|
overridevirtual |
Implements IDetector.
|
inherited |
Sets the polarization analyzer characteristics of the detector.
|
virtualinherited |
Inits detector with the beam settings.
Reimplemented in RectangularDetector.
|
inherited |
Sets equidistant axes.
|
inherited |
Sets the detector resolution.
|
inherited |
Sets rectangular region of interest with lower left and upper right corners defined.
|
inherited |
|
protectedvirtualinherited |
Return 0 if no ROI has been explicitly set. Size means number of data points.
|
inherited |
The size of the "Region of Interest". Same as totalSize() if no region of interest has been explicitly set.
|
inherited |
Returns total number of pixels. Any region of interest is not taken into account.