22#include <boost/python/class.hpp>
23#include <boost/python/copy_const_reference.hpp>
24#include <boost/python/list.hpp>
25#include <boost/python/overloads.hpp>
26#include <boost/python/register_ptr_to_python.hpp>
42 const
std::
string &date) {
49 PyErr_Warn(PyExc_DeprecationWarning,
50 "'ExperimentInfo.getInstrument()' is deprecated in Mantid 7.0. "
51 "Use the componentInfo(), detectorInfo() and spectrumInfo() access layers instead. "
52 "See the 'Instrument Access via SpectrumInfo, DetectorInfo, ComponentInfo' concept page, "
53 "located at: https://docs.mantidproject.org/nightly/concepts/InstrumentAccessLayers.html");
58 PyErr_Warn(PyExc_DeprecationWarning,
"ExperimentInfo.getInstrumentFilename() is deprecated.\n"
59 "Use InstrumentFileFinder.getInstrumentFilename() instead.");
79Mantid::Types::Core::DateAndTime instrumentValidFromDate(
const ExperimentInfo &expInfo) {
82Mantid::Types::Core::DateAndTime instrumentValidToDate(
const ExperimentInfo &expInfo) {
87const std::string &instrumentDefaultView(
const ExperimentInfo &expInfo) {
90const std::string &instrumentDefaultAxis(
const ExperimentInfo &expInfo) {
96 register_ptr_to_python<std::shared_ptr<ExperimentInfo>>();
98 class_<ExperimentInfo, boost::noncopyable>(
"ExperimentInfo", no_init)
100 "Returns the :class:`~mantid.geometry.Instrument` for this run "
101 "(deprecated, use the componentInfo/detectorInfo/spectrumInfo access layers).")
104 (arg(
"prefix"), arg(
"fileFormats"), arg(
"directoryNames"), arg(
"date")),
105 "Compile a list of files in compliance with name pattern-matching,\n"
106 "file format, and date-stamp constraints\n\n"
107 "Ideally, the valid-from and valid-to of any valid file should\n"
108 "encapsulate the argument date. If this is not possible, then\n"
109 "the file with the most recent valid-from stamp is selected\n\n"
110 "prefix: the name of a valid file must begin with this "
112 "fileFormats: list of valid file extensions\n"
113 "directoryNames: list of directories to be searched\n"
114 "date : the 'valid-from' and 'valid-to 'dates of a valid\n"
115 "file will encapsulate this date (e.g '1900-01-31 23:59:00')\n"
116 "\nreturns : list of absolute paths for each valid file\n")
117 .staticmethod(
"getResourceFilenames")
119 getInstrumentFilename_Overload(
"Returns IDF filename", (arg(
"instrument"), arg(
"date") =
"")))
120 .staticmethod(
"getInstrumentFilename")
122 "Return the :class:`~mantid.api.Sample` object. This cannot be "
123 "modified, use mutableSample to modify.")
125 args(
"self"),
"Return a modifiable :class:`~mantid.api.Sample` object.")
126 .def(
"run", &
ExperimentInfo::run, return_value_policy<reference_existing_object>(), args(
"self"),
127 "Return the :class:`~mantid.api.Run` object. This cannot be "
128 "modified, use mutableRun to modify.")
130 "Return a modifiable :class:`~mantid.api.Run` object.")
133 args(
"self",
"detId"))
138 "Return a const reference to the "
139 ":class:`~mantid.geometry.DetectorInfo` "
143 "Return a const reference to the :class:`~mantid.api.SpectrumInfo` "
147 "Return a const reference to the "
148 ":class:`~mantid.geometry.ComponentInfo` "
150 .def(
"instrumentValidFromDate", &instrumentValidFromDate, args(
"self"),
151 "Return the valid-from :class:`~mantid.kernel.DateAndTime` of the instrument.")
152 .def(
"instrumentValidToDate", &instrumentValidToDate, args(
"self"),
153 "Return the valid-to :class:`~mantid.kernel.DateAndTime` of the instrument.")
154 .def(
"instrumentFilename", &instrumentFilename, args(
"self"), return_value_policy<copy_const_reference>(),
155 "Return the name of the file that the original IDF was from.")
156 .def(
"instrumentXmlText", &instrumentXmlText, args(
"self"), return_value_policy<copy_const_reference>(),
157 "Return the instrument XML.")
158 .def(
"instrumentDefaultView", &instrumentDefaultView, args(
"self"), return_value_policy<copy_const_reference>(),
159 "Return the name of the preferred view in instrument view.")
160 .def(
"instrumentDefaultAxis", &instrumentDefaultAxis, args(
"self"), return_value_policy<copy_const_reference>(),
161 "Return the axis the instrument view is wrapped around by default.")
163 "Return the name of the instrument for this experiment.")
164 .def(
"setSample", setSample, args(
"self",
"sample"))
165 .def(
"setRun", setRun, args(
"self",
"run"))
167 "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.
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.
This class stores information about the sample used in particular run.
std::shared_ptr< const Instrument > Instrument_const_sptr
Shared pointer to an const instrument object.
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.