11#include <boost/python/class.hpp>
12#include <boost/python/enum.hpp>
13#include <boost/python/make_function.hpp>
14#include <boost/python/register_ptr_to_python.hpp>
42 register_ptr_to_python<IEventList *>();
44 enum_<EventType>(
"EventType")
50 class_<IEventList, bases<Mantid::API::ISpectrum>, boost::noncopyable>(
"IEventList", no_init)
52 .def(
"switchTo", &
IEventList::switchTo, args(
"self",
"newType"),
"Switch the event type to the one specified")
53 .def(
"clear", &
IEventList::clear, args(
"self",
"removeDetIDs"),
"Clears the event list")
56 "Returns the number of events within the list")
59 "Integrate the events between a range of X values, or all events.")
61 args(
"self",
"factor",
"offset"),
"Convert the time of flight by tof'=tof*factor+offset")
63 "Convert the tof units by scaling by a multiplier.")
64 .def(
"addTof", &
IEventList::addTof, args(
"self",
"offset"),
"Add an offset to the TOF of each event in the list.")
66 "Add an offset to the pulsetime (wall-clock time) of each event in "
68 .def(
"addPulsetimes", &addPulsetimes, args(
"self",
"seconds"),
69 "Add offsets to the pulsetime (wall-clock time) of each event in "
72 "Mask out events that have a tof between tofMin and tofMax "
74 .def(
"maskCondition", &maskCondition, args(
"self",
"mask"),
"Mask out events by the condition vector")
82 .def(
"getPulseTimesAsNumpy",
84 "Get a vector of the pulse times of the events")
86 "The maximum pulse time for the list of the events.")
88 "The minimum pulse time for the list of the events.")
89 .def(
"getTofMin", &
IEventList::getTofMin, args(
"self"),
"The minimum tof value for the list of the events.")
90 .def(
"getTofMax", &
IEventList::getTofMax, args(
"self"),
"The maximum tof value for the list of the events.")
92 args(
"self",
"value",
"error"),
93 "Multiply the weights in this event "
94 "list by a scalar variable with an "
95 "error; though the error can be 0.0")
97 args(
"self",
"value",
"error"),
98 "Divide the weights in this event "
99 "list by a scalar with an "
100 "(optional) error.");
#define GET_POINTER_SPECIALIZATION(TYPE)
return_value_policy< Policies::VectorToNumpy > return_clone_numpy
return_value_policy for copied numpy array
IEventList : Interface to Mantid::DataObjects::EventList class, used to expose to PythonAPI.
virtual void addPulsetime(const double seconds)=0
Add a value to the pulse time values.
virtual void addTof(const double offset)=0
Add a value to the TOF values.
virtual Mantid::API::EventType getEventType() const =0
Return the current event type for the list.
virtual Mantid::Types::Core::DateAndTime getPulseTimeMax() const =0
Get the maximum pulse time from the list.
virtual std::size_t getNumberEvents() const =0
Get the number of events from the list.
virtual Mantid::Types::Core::DateAndTime getPulseTimeMin() const =0
Get the minimum pulse time from the list.
virtual void maskCondition(const std::vector< bool > &mask)=0
Mask the events by the condition vector.
virtual void scaleTof(const double factor)=0
Scale the TOF values by a constant.
virtual std::vector< double > getWeights() const =0
Return the list of event weight values.
virtual double integrate(const double minX, const double maxX, const bool entireRange) const =0
Integrate the event list.
virtual std::vector< Mantid::Types::Core::DateAndTime > getPulseTimes() const =0
Return the list of pulse time values.
virtual void maskTof(const double tofMin, const double tofMax)=0
Mask a given TOF range.
virtual void multiply(const double value, const double error=0.0)=0
Multiply event list by a constant with error.
virtual bool isSortedByTof() const =0
IS the list sorted by TOF?
virtual void convertTof(std::function< double(double)> func, const int sorting=0)=0
Convert the TOF values.
virtual void divide(const double value, const double error=0.0)=0
Divide event list by a constant with error.
virtual void clear(const bool removeDetIDs)=0
Clear the event list.
virtual std::vector< double > getTofs() const =0
Return the list of TOF values.
virtual void switchTo(Mantid::API::EventType newType)=0
Switch to a new event type within the list.
virtual void addPulsetimes(const std::vector< double > &seconds)=0
Add a separate value to each of the pulse time values.
virtual double getTofMin() const =0
Get the minimum TOF from the list.
virtual double getTofMax() const =0
Get the maximum TOF from the list.
size_t getMemorySize() const override=0
Get memory size of event list.
virtual std::vector< double > getWeightErrors() const =0
Return the list of event weight error values.
Thin object wrapper around a numpy array.
EventType
What kind of event list is being stored.
Converter taking an input numpy array and converting it to a std::vector.