Mantid
Loading...
Searching...
No Matches
IEventWorkspace.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 +
11
12#include <boost/python/class.hpp>
13#include <boost/python/object.hpp>
14
15using namespace Mantid::API;
17using namespace boost::python;
18
20
21namespace {
27IEventList &deprecatedGetEventList(IEventWorkspace &self, const size_t index) {
28 if (PyErr_Warn(PyExc_DeprecationWarning, "'getEventList' is deprecated, use 'getSpectrum' instead.") < 0)
29 throw boost::python::error_already_set();
30 return self.getSpectrum(index);
31}
32} // namespace
33
38 class_<IEventWorkspace, bases<Mantid::API::MatrixWorkspace>, boost::noncopyable>("IEventWorkspace", no_init)
39 .def("getNumberEvents", &IEventWorkspace::getNumberEvents, args("self"),
40 "Returns the number of events in the :class:`~mantid.api.Workspace`")
41 .def("getTofMin", &IEventWorkspace::getTofMin, args("self"),
42 "Returns the minimum TOF value (in microseconds) held by the "
43 ":class:`~mantid.api.Workspace`")
44 .def("getTofMax", &IEventWorkspace::getTofMax, args("self"),
45 "Returns the maximum TOF value (in microseconds) held by the "
46 ":class:`~mantid.api.Workspace`")
47 .def("getPulseTimeMin", &IEventWorkspace::getPulseTimeMin, args("self"),
48 "Returns the minimum pulse time held by the "
49 ":class:`~mantid.api.Workspace`")
50 .def("getPulseTimeMax", &IEventWorkspace::getPulseTimeMax, args("self"),
51 "Returns the maximum pulse time held by the "
52 ":class:`~mantid.api.Workspace`")
53 .def("getEventList", &deprecatedGetEventList, return_internal_reference<>(), args("self", "workspace_index"),
54 "Return the :class:`~mantid.api.IEventList` managing the events at "
55 "the given :class:`~mantid.api.Workspace` "
56 "index")
57 .def("clearMRU", &IEventWorkspace::clearMRU, args("self"), "Clear the most-recently-used lists");
58
60}
#define GET_POINTER_SPECIALIZATION(TYPE)
Definition GetPointer.h:17
std::map< DeltaEMode::Type, std::string > index
void export_IEventWorkspace()
Python exports of the Mantid::API::IEventWorkspace class.
IEventList : Interface to Mantid::DataObjects::EventList class, used to expose to PythonAPI.
Definition IEventList.h:27
This class provides an interface to an EventWorkspace.
virtual Mantid::Types::Core::DateAndTime getPulseTimeMax() const =0
virtual double getTofMin() const =0
virtual Mantid::Types::Core::DateAndTime getPulseTimeMin() const =0
virtual double getTofMax() const =0
virtual void clearMRU() const =0
IEventList & getSpectrum(const size_t index) override=0
Return the underlying ISpectrum ptr at the given workspace index.
virtual std::size_t getNumberEvents() const =0
Encapsulates the registration required for an interface type T that sits on top of a Kernel::DataItem...