Mantid
Loading...
Searching...
No Matches
ISpectrum.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
9#include <boost/python/class.hpp>
10#include <boost/python/copy_const_reference.hpp>
11#include <boost/python/register_ptr_to_python.hpp>
12
13using Mantid::detid_t;
15using namespace boost::python;
16
18
20 register_ptr_to_python<ISpectrum *>();
21
22 class_<ISpectrum, boost::noncopyable>("ISpectrum", no_init)
23 .def("hasDetectorID", &ISpectrum::hasDetectorID, (arg("self"), arg("det_id")),
24 "Returns True if the spectrum contain the given spectrum number")
25 .def("getSpectrumNo", &ISpectrum::getSpectrumNo, arg("self"), "Returns the spectrum number of this spectrum")
26 .def("getDetectorIDs", (const std::set<detid_t> &(ISpectrum::*)() const) & ISpectrum::getDetectorIDs, arg("self"),
27 return_value_policy<copy_const_reference>(), "Returns a list of detector IDs for this spectrum")
28 .def("addDetectorID", &ISpectrum::addDetectorID, (arg("self"), arg("det_id")),
29 "Add a detector ID to this spectrum")
30 .def("setDetectorID", &ISpectrum::setDetectorID, (arg("self"), arg("det_id")), "Set the given ID has the only")
31 .def("clearDetectorIDs", &ISpectrum::clearDetectorIDs, arg("self"), "Clear the set of detector IDs")
32 .def("setSpectrumNo", &ISpectrum::setSpectrumNo, (arg("self"), arg("num")),
33 "Set the spectrum number for this spectrum")
34 .def("hasDx", &ISpectrum::hasDx, arg("self"),
35 "Returns True if the spectrum uses the "
36 "DX (X Error) array, else False.");
37}
#define GET_POINTER_SPECIALIZATION(TYPE)
Definition: GetPointer.h:17
void export_ISpectrum()
Definition: ISpectrum.cpp:19
A "spectrum" is an object that holds the data for a particular spectrum, in particular:
Definition: ISpectrum.h:39
specnum_t getSpectrumNo() const
Definition: ISpectrum.cpp:123
bool hasDetectorID(const detid_t detID) const
Return true if the given detector ID is in the list for this ISpectrum.
Definition: ISpectrum.cpp:109
void clearDetectorIDs()
Clear the detector IDs set.
Definition: ISpectrum.cpp:117
void addDetectorID(const detid_t detID)
Add a detector ID to the set of detector IDs.
Definition: ISpectrum.cpp:51
bool hasDx() const
Gets the value of the use flag.
Definition: ISpectrum.cpp:136
void setDetectorID(const detid_t detID)
Clear the list of detector IDs, then add one.
Definition: ISpectrum.cpp:84
const std::set< detid_t > & getDetectorIDs() const
Get a const reference to the detector IDs set.
Definition: ISpectrum.cpp:113
void setSpectrumNo(specnum_t num)
Sets the the spectrum number of this spectrum.
Definition: ISpectrum.cpp:127
int32_t detid_t
Typedef for a detector ID.
Definition: SpectrumInfo.h:21