InstrumentDataServiceImpl#
This is a Python binding to the C++ class Mantid::API::InstrumentDataServiceImpl.
What is it?#
The Instrument Data Service is a Data Service that is
specialized to hold cached Instruments.
This cache is managed internally by Mantid when instruments are loaded through
algorithms.
Unlike the AnalysisDataService,
the Python interface intentionally exposes only a limited set of methods.
Instruments should be added to the cache only by the framework, while Python is
restricted to querying, retrieving, and clearing cached entries.
Extracting an instrument from the Instrument Data Service#
The most usual way to populate the cache is to run an algorithm that loads an instrument.
LoadEmptyInstrument(InstrumentName="PG3")
The list of cached instruments can be queried as follows:
InstrumentDataService.getObjectNames()
You can then access the cached instrument directly from the InstrumentDataService.
instrument = InstrumentDataService.retrieve("POWGEN**************")
The returned object is a mantid.geometry.Instrument.
Reference#
- class mantid.api.InstrumentDataServiceImpl#
- static Instance() InstrumentDataServiceImpl :#
Return a reference to the singleton instance
- clear((InstrumentDataServiceImpl)self) None :#
Removes all objects managed by the service.
- doesExist((InstrumentDataServiceImpl)self, (str)name) bool :#
Returns True if the object is found in the service.
- getObjectNames((InstrumentDataServiceImpl)self[, (str)contain='']) list :#
Return the list of names currently known to the IDS
- remove((InstrumentDataServiceImpl)self, (str)name) None :#
Remove a named object
- retrieve((InstrumentDataServiceImpl)self, (str)name) mantid.geometry._geometry.Instrument :#
Retrieve the named object. Raises an exception if the name does not exist
- size((InstrumentDataServiceImpl)self) int :#
Returns the number of objects within the service