25#include <boost/python/class.hpp>
26#include <boost/python/copy_const_reference.hpp>
27#include <boost/python/list.hpp>
28#include <boost/python/overloads.hpp>
29#include <boost/python/register_ptr_to_python.hpp>
45 const
std::
string &date) {
64 if (PyErr_Warn(PyExc_DeprecationWarning,
"ExperimentInfo.getInstrumentFilename() is deprecated.\n"
65 "Use InstrumentFileFinder.getInstrumentFilename() instead.") < 0)
66 throw boost::python::error_already_set();
86Mantid::Types::Core::DateAndTime instrumentValidFromDate(
const ExperimentInfo &expInfo) {
89Mantid::Types::Core::DateAndTime instrumentValidToDate(
const ExperimentInfo &expInfo) {
94const std::string &instrumentDefaultView(
const ExperimentInfo &expInfo) {
97const std::string &instrumentDefaultAxis(
const ExperimentInfo &expInfo) {
109 register_ptr_to_python<std::shared_ptr<ExperimentInfo>>();
111 class_<ExperimentInfo, boost::noncopyable>(
"ExperimentInfo", no_init)
113 "Returns the :class:`~mantid.geometry.Instrument` for this run "
114 "(deprecated, use the componentInfo/detectorInfo/spectrumInfo access layers).")
117 (arg(
"prefix"), arg(
"fileFormats"), arg(
"directoryNames"), arg(
"date")),
118 "Compile a list of files in compliance with name pattern-matching,\n"
119 "file format, and date-stamp constraints\n\n"
120 "Ideally, the valid-from and valid-to of any valid file should\n"
121 "encapsulate the argument date. If this is not possible, then\n"
122 "the file with the most recent valid-from stamp is selected\n\n"
123 "prefix: the name of a valid file must begin with this "
125 "fileFormats: list of valid file extensions\n"
126 "directoryNames: list of directories to be searched\n"
127 "date : the 'valid-from' and 'valid-to 'dates of a valid\n"
128 "file will encapsulate this date (e.g '1900-01-31 23:59:00')\n"
129 "\nreturns : list of absolute paths for each valid file\n")
130 .staticmethod(
"getResourceFilenames")
132 getInstrumentFilename_Overload(
"Returns IDF filename", (arg(
"instrument"), arg(
"date") =
"")))
133 .staticmethod(
"getInstrumentFilename")
135 "Return the :class:`~mantid.api.Sample` object. This cannot be "
136 "modified, use mutableSample to modify.")
138 args(
"self"),
"Return a modifiable :class:`~mantid.api.Sample` object.")
139 .def(
"getLabFrameSampleShape", &getLabFrameSampleShape, args(
"self"),
140 "Return the sample shape as it sits in the lab frame, rotated by whatever part of this "
141 "workspace's goniometer rotation the shape does not already carry.\n\n"
142 "A shape may be stored in its own frame or already rotated into the lab frame - "
143 ":ref:`algm-CopySample` bakes the goniometer in, while :ref:`algm-SetGoniometer` alone "
144 "leaves the shape untouched - so rotating by the goniometer unconditionally would turn an "
145 "already-rotated shape a second time. This applies only what is outstanding, and returns "
146 "a new shape; the workspace's own sample is unchanged.")
147 .def(
"run", &
ExperimentInfo::run, return_value_policy<reference_existing_object>(), args(
"self"),
148 "Return the :class:`~mantid.api.Run` object. This cannot be "
149 "modified, use mutableRun to modify.")
151 "Return a modifiable :class:`~mantid.api.Run` object.")
154 args(
"self",
"detId"))
159 "Return a const reference to the "
160 ":class:`~mantid.geometry.DetectorInfo` "
164 "Return a const reference to the :class:`~mantid.api.SpectrumInfo` "
168 "Return a const reference to the "
169 ":class:`~mantid.geometry.ComponentInfo` "
173 "Return a const reference to a :class:`~mantid.geometry.ComponentInfo` "
174 "describing the base instrument: the geometry as loaded from the instrument "
175 "definition, before any moves, rotations or other parameters were applied.")
176 .def(
"instrumentValidFromDate", &instrumentValidFromDate, args(
"self"),
177 "Return the valid-from :class:`~mantid.kernel.DateAndTime` of the instrument.")
178 .def(
"instrumentValidToDate", &instrumentValidToDate, args(
"self"),
179 "Return the valid-to :class:`~mantid.kernel.DateAndTime` of the instrument.")
180 .def(
"instrumentFilename", &instrumentFilename, args(
"self"), return_value_policy<copy_const_reference>(),
181 "Return the name of the file that the original IDF was from.")
182 .def(
"instrumentXmlText", &instrumentXmlText, args(
"self"), return_value_policy<copy_const_reference>(),
183 "Return the instrument XML.")
184 .def(
"instrumentDefaultView", &instrumentDefaultView, args(
"self"), return_value_policy<copy_const_reference>(),
185 "Return the name of the preferred view in instrument view.")
186 .def(
"instrumentDefaultAxis", &instrumentDefaultAxis, args(
"self"), return_value_policy<copy_const_reference>(),
187 "Return the axis the instrument view is wrapped around by default.")
189 "Return the name of the instrument for this experiment.")
190 .def(
"setSample", setSample, args(
"self",
"sample"))
191 .def(
"setRun", setRun, args(
"self",
"run"))
193 "Update parameters in the instrument-parameter map. Logs must be loaded before calling this method");
#define GET_POINTER_SPECIALIZATION(TYPE)
std::string getInstrumentFilenameWarn(const std::string &instName, const std::string &date="")
list getResourceFilenames(const std::string &prefix, const list &fileFormats, const list &directoryNames, const std::string &date)
Converter from C++ signature to python signature.
Mantid::Geometry::Instrument_const_sptr getInstrumentDeprecated(const ExperimentInfo &self)
void export_ExperimentInfo()
#define GNU_DIAG_OFF(x)
This is a collection of macros for turning compiler warnings off in a controlled manner.
This class is shared by a few Workspace types and holds information related to a particular experimen...
Run & mutableRun()
Writable version of the run object.
const SpectrumInfo & spectrumInfo() const
Return a reference to the SpectrumInfo object.
Geometry::InstrumentMetadata const & instrumentMetadata() const
const Geometry::DetectorInfo & detectorInfo() const
Return a const reference to the DetectorInfo object.
double getEFixed(const detid_t detID) const
Easy access to the efixed value for this run & detector ID.
const Run & run() const
Run details object access.
Geometry::ComponentInfo const & baseComponentInfo() const
Returns a ComponentInfo for the base (unparametrized) instrument, i.e.
std::string getInstrumentName() const
Return the name of the instrument from the ComponentInfo object.
Geometry::Instrument_const_sptr getInstrument() const
Returns the parameterized instrument.
Kernel::DeltaEMode::Type getEMode() const
Returns the emode for this run.
const Sample & sample() const
Sample accessors.
void setEFixed(const detid_t detID, const double value)
Set the efixed value for a given detector ID.
int getRunNumber() const
Utility method to get the run number.
const Geometry::ComponentInfo & componentInfo() const
Sample & mutableSample()
Writable version of the sample object.
void populateInstrumentParameters()
Add parameters to the instrument parameter map that are defined in instrument definition file or para...
static std::vector< std::string > getResourceFilenames(const std::string &prefix, const std::vector< std::string > &fileFormats, const std::vector< std::string > &directoryNames, const std::string &date)
Utility to retrieve a resource file (IDF, Parameters, ..)
static std::string getInstrumentFilename(const std::string &instrumentName, const std::string &date="")
Get the IDF using the instrument name and date.
This class stores information regarding an experimental run as a series of log entries.
const Geometry::Goniometer & getGoniometer() const
Return reference to the first const Goniometer object for this run.
This class stores information about the sample used in particular run.
const Geometry::IObject & getShape() const
Return the sample shape.
const Kernel::DblMatrix & getR() const
Return global rotation matrix.
MANTID_GEOMETRY_DLL std::shared_ptr< IObject > getLabFrameShape(const IObject &shape, const Kernel::Matrix< double > &goniometerR)
The shape as it sits in the lab frame: a clone rotated by whatever part of goniometerR it does not al...
std::shared_ptr< const Instrument > Instrument_const_sptr
Shared pointer to an const instrument object.
std::shared_ptr< IObject > IObject_sptr
Typdef for a shared pointer.
int32_t detid_t
Typedef for a detector ID.
Converts a Python sequence type to a C++ std::vector, where the element type is defined by the templa...
Converter that takes a std::vector and converts it into a python list.
Implements the RemoveConstSharedPtr policy.