11#include "MantidTypes/SpectrumDefinition.h"
13#include <boost/python/class.hpp>
14#include <boost/python/copy_const_reference.hpp>
15#include <boost/python/list.hpp>
16#include <boost/python/return_value_policy.hpp>
17#include <boost/python/tuple.hpp>
19using Mantid::SpectrumDefinition;
34 return incref(make_tuple(angles.first, angles.second).ptr());
39 class_<SpectrumInfo, boost::noncopyable>(
"SpectrumInfo", no_init)
44 "Returns True if the detector(s) associated with the spectrum are "
47 "Returns True if the detector(s) associated with the spectrum are "
50 "Set the mask flag of the spectrum with the given index.")
52 "Returns the scattering angle 2 theta in radians w.r.t. beam "
55 "Returns the signed scattering angle 2 theta in radians w.r.t. beam "
58 "Returns the out-of-plane angle in radians angle w.r.t. to "
59 "vecPointingHorizontal "
62 "Returns the latitude and longitude for given spectrum index. "
63 "The returned value is a pair of (latitude, longitude)")
64 .def(
"l1", &
SpectrumInfo::l1, arg(
"self"),
"Returns the distance from the source to the sample.")
66 "Returns the distance from the sample to the spectrum.")
68 "Returns True if the spectrum is associated with detectors in the "
71 "Returns True if the spectrum is associated with exactly one "
74 "Returns the absolute position of the spectrum with the given "
79 (arg(
"self"), arg(
"index")),
80 "Returns the SpectrumDefinition of the spectrum with the given "
83 "Returns the total number of detectors used across spectrum info.")
85 "Return the uncalibrated difc diffractometer constant")
86 .def(
"diffractometerConstants",
88 (arg(
"self"), arg(
"index")),
"Return the diffractometer constants");
std::map< DeltaEMode::Type, std::string > index
PyObject * geographicalAngles(const SpectrumInfo &spectrumInfo, const size_t index)
void export_SpectrumInfo()
SpectrumInfoPythonIterator make_pyiterator(SpectrumInfo &spectrumInfo)
API::SpectrumInfo is an intermediate step towards a SpectrumInfo that is part of Instrument-2....
double signedTwoTheta(const size_t index) const
Returns the signed scattering angle 2 theta in radians (angle w.r.t.
bool isMonitor(const size_t index) const
Returns true if the detector(s) associated with the spectrum are monitors.
Kernel::V3D sourcePosition() const
Returns the source position.
Kernel::UnitParametersMap diffractometerConstants(const size_t index, std::vector< detid_t > &uncalibratedDets) const
Calculate average diffractometer constants (DIFA, DIFC, TZERO) of detectors associated with this spec...
void setMasked(const size_t index, bool masked)
Set the mask flag of the spectrum with given index.
Kernel::V3D samplePosition() const
Returns the sample position.
bool hasDetectors(const size_t index) const
Returns true if the spectrum is associated with detectors in the instrument.
double twoTheta(const size_t index) const
Returns the scattering angle 2 theta in radians (angle w.r.t.
double difcUncalibrated(const size_t index) const
Calculate average uncalibrated DIFC value of detectors associated with this spectrum.
Kernel::V3D position(const size_t index) const
Returns the position of the spectrum with given index.
double l2(const size_t index) const
Returns L2 (distance from sample to spectrum).
double azimuthal(const size_t index) const
Returns the out-of-plane angle in radians (angle w.r.t.
bool isMasked(const size_t index) const
Returns true if the detector(s) associated with the spectrum are masked.
bool hasUniqueDetector(const size_t index) const
Returns true if the spectrum is associated with exactly one detector.
const SpectrumDefinition & spectrumDefinition(const size_t index) const
Returns a const reference to the SpectrumDefinition of the spectrum.
size_t size() const
Returns the size of the SpectrumInfo, i.e., the number of spectra.
double l1() const
Returns L1 (distance from source to sample).
size_t detectorCount() const
std::pair< double, double > geographicalAngles(const size_t index) const
Calculate latitude and longitude for given spectrum index.
SpectrumInfoPythonIterator.
std::unordered_map< UnitParams, double > UnitParametersMap