Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Friends | List of all members
Mantid::API::MatrixWorkspace Class Referenceabstract

Base MatrixWorkspace Abstract Class. More...

#include <MatrixWorkspace.h>

Inheritance diagram for Mantid::API::MatrixWorkspace:
Mantid::API::IMDWorkspace Mantid::API::ExperimentInfo Mantid::API::Workspace Mantid::API::MDGeometry Mantid::Kernel::DataItem AxeslessWorkspaceTester Mantid::API::HistoWorkspace Mantid::API::IEventWorkspace VariableBinThrowingTester WorkspaceTester Mantid::DataObjects::Workspace2D Mantid::DataObjects::WorkspaceSingleValue Mantid::DataObjects::EventWorkspace Mantid::Algorithms::SparseWorkspace Mantid::DataObjects::RebinnedOutput Mantid::DataObjects::SpecialWorkspace2D Mantid::DataObjects::GroupingWorkspace Mantid::DataObjects::MaskWorkspace Mantid::DataObjects::OffsetsWorkspace

Public Member Functions

MatrixWorkspace_uptr clone () const
 Returns a clone of the workspace. More...
 
MatrixWorkspace_uptr cloneEmpty () const
 Returns a default-initialized clone of the workspace. More...
 
const Indexing::IndexInfo & indexInfo () const
 Returns a const reference to the IndexInfo object of the workspace. More...
 
void initialize (const Indexing::IndexInfo &indexInfo, const HistogramData::Histogram &histogram)
 
void initialize (const std::size_t &NVectors, const HistogramData::Histogram &histogram)
 
void initialize (const std::size_t &NVectors, const std::size_t &XLength, const std::size_t &YLength)
 Initialize the workspace. More...
 
MatrixWorkspaceoperator= (const MatrixWorkspace &other)=delete
 
void setIndexInfo (const Indexing::IndexInfo &indexInfo)
 Sets the IndexInfo object of the workspace. More...
 
const std::string toString () const override
 Serializes the object to a string. More...
 
const std::string toString () const override
 String description of state. More...
 
 ~MatrixWorkspace () override
 Delete. More...
 
- Public Member Functions inherited from Mantid::API::IMDWorkspace
std::string changeQConvention ()
 
virtual void clearFileBacked (bool)
 if a workspace was filebacked, this should clear file-based status, delete file-based information and close related files. More...
 
virtual void clearMDMasking ()=0
 Clear existing masks. More...
 
std::unique_ptr< IMDWorkspaceclone () const
 Returns a clone of the workspace. More...
 
std::unique_ptr< IMDWorkspacecloneEmpty () const
 Returns a default-initialized clone of the workspace. More...
 
std::unique_ptr< IMDIteratorcreateIterator (Mantid::Geometry::MDImplicitFunction *function=nullptr) const
 Creates a single iterator and returns it. More...
 
virtual std::vector< std::unique_ptr< IMDIterator > > createIterators (size_t suggestedNumCores=1, Mantid::Geometry::MDImplicitFunction *function=nullptr) const =0
 Creates a new iterator pointing to the first cell in the workspace. More...
 
virtual MDNormalization displayNormalization () const
 
virtual MDNormalization displayNormalizationHisto () const
 
std::string getConvention () const
 
virtual LinePlot getLinePlot (const Mantid::Kernel::VMD &start, const Mantid::Kernel::VMD &end, Mantid::API::MDNormalization normalize) const
 Method to generate a line plot through a MD-workspace. More...
 
virtual uint64_t getNEvents () const =0
 
virtual uint64_t getNPoints () const =0
 Get the number of points associated with the workspace. More...
 
virtual signal_t getSignalAtCoord (const coord_t *coords, const Mantid::API::MDNormalization &normalization) const =0
 Returns the (normalized) signal at a given coordinates. More...
 
signal_t getSignalAtVMD (const Mantid::Kernel::VMD &coords, const Mantid::API::MDNormalization &normalization=Mantid::API::VolumeNormalization) const
 Returns the signal (normalized by volume) at a given coordinates. More...
 
virtual signal_t getSignalWithMaskAtCoord (const coord_t *coords, const Mantid::API::MDNormalization &normalization) const =0
 Returns the (normalized) signal at a given coordinates or 0 if the value. More...
 
signal_t getSignalWithMaskAtVMD (const Mantid::Kernel::VMD &coords, const Mantid::API::MDNormalization &normalization=Mantid::API::VolumeNormalization) const
 Returns the signal (normalized by volume) at a given coordinates or 0 if masked. More...
 
virtual Kernel::SpecialCoordinateSystem getSpecialCoordinateSystem () const =0
 
virtual bool hasOrientedLattice () const =0
 
 IMDWorkspace (const Parallel::StorageMode storageMode=Parallel::StorageMode::Cloned)
 Default constructor. More...
 
virtual bool isMDHistoWorkspace () const
 
virtual ITableWorkspace_sptr makeBoxTable (size_t, size_t)
 this is the method to build table workspace from any workspace. More...
 
IMDWorkspaceoperator= (const IMDWorkspace &other)=delete
 
void setConvention (std::string convention)
 
virtual void setMDMasking (std::unique_ptr< Mantid::Geometry::MDImplicitFunction > maskingRegion)=0
 Setter for the masking region. More...
 
- Public Member Functions inherited from Mantid::API::Workspace
Workspace_uptr clone () const
 Returns a clone (copy) of the workspace with covariant return type in all derived classes. More...
 
Workspace_uptr cloneEmpty () const
 Returns a default-initialized clone of the workspace. More...
 
const std::string & getComment () const
 Get the workspace comment. More...
 
const WorkspaceHistorygetHistory () const
 Returns a reference to the WorkspaceHistory const. More...
 
virtual size_t getMemorySize () const =0
 Get the footprint in memory in bytes. More...
 
std::string getMemorySizeAsStr () const
 Returns the memory footprint in sensible units. More...
 
const std::string & getName () const override
 Get the workspace name. More...
 
virtual const std::string getTitle () const
 Get the workspace title. More...
 
WorkspaceHistoryhistory ()
 Returns a reference to the WorkspaceHistory. More...
 
bool isDirty (const int n=1) const
 Check whether other algorithms have been applied to the workspace by checking the history length. More...
 
virtual bool isGroup () const
 
Workspaceoperator= (const Workspace &other)=delete
 
void setComment (const std::string &)
 Set the comment field of the workspace. More...
 
virtual void setTitle (const std::string &)
 Set the title of the workspace. More...
 
Parallel::StorageMode storageMode () const
 Returns the storage mode (used for MPI runs) More...
 
bool threadSafe () const override
 Marks the workspace as safe for multiple threads to edit data simutaneously. More...
 
 Workspace (const Parallel::StorageMode storageMode=Parallel::StorageMode::Cloned)
 
 ~Workspace ()
 
- Public Member Functions inherited from Mantid::Kernel::DataItem
 DataItem ()
 Default constructor. More...
 
 DataItem (const DataItem &other)
 Copy constructor Always makes a unique lock. More...
 
virtual ~DataItem ()
 Destructor. More...
 
virtual const std::string id () const =0
 A string ID for the class. More...
 
void readLock ()
 Acquires a read lock. More...
 
void unlock ()
 
- Public Member Functions inherited from Mantid::API::MDGeometry
void addDimension (const std::shared_ptr< Mantid::Geometry::IMDDimension > &dim)
 Add a dimension. More...
 
void addDimension (Mantid::Geometry::IMDDimension *dim)
 Add a dimension. More...
 
bool allBasisNormalized () const
 
void clearOriginalWorkspaces ()
 Clear original workspaces. More...
 
void clearTransforms ()
 Clear transforms. More...
 
virtual std::vector< coord_testimateResolution () const
 
Mantid::Kernel::VMDgetBasisVector (size_t index)
 Get the basis vector (in the original workspace) for a dimension of this workspace. More...
 
const Mantid::Kernel::VMDgetBasisVector (size_t index) const
 Get the basis vector (in the original workspace) for a dimension of this workspace. More...
 
virtual std::shared_ptr< const Mantid::Geometry::IMDDimensiongetDimension (size_t index) const
 Get a dimension. More...
 
size_t getDimensionIndexById (const std::string &id) const
 Get the index of the dimension that matches the ID given. More...
 
size_t getDimensionIndexByName (const std::string &name) const
 Get the index of the dimension that matches the name given. More...
 
virtual std::shared_ptr< const Mantid::Geometry::IMDDimensiongetDimensionWithId (std::string id) const
 Get a dimension. More...
 
std::string getGeometryXML () const
 
std::vector< std::shared_ptr< const Geometry::IMDDimension > > getNonIntegratedDimensions () const
 Get non-collapsed dimensions. More...
 
size_t getNumberTransformsFromOriginal () const
 Get the number of transforms defined from the original coordinate system. More...
 
size_t getNumberTransformsToOriginal () const
 Get the number of transforms defined to the original coordinate system. More...
 
virtual size_t getNumDims () const
 
virtual size_t getNumNonIntegratedDims () const
 
Mantid::Kernel::VMDgetOrigin ()
 
const Mantid::Kernel::VMDgetOrigin () const
 
std::shared_ptr< WorkspacegetOriginalWorkspace (size_t index=0) const
 Get the "original" workspace (the workspace that was the source for a binned MDWorkspace). More...
 
std::shared_ptr< const Mantid::Geometry::IMDDimensiongetTDimension () const
 Get the t-dimension mapping. More...
 
Mantid::API::CoordTransform const * getTransformFromOriginal (size_t index=0) const
 Get the Coordinate Transformation that goes from the original workspace to this workspace's coordinates. More...
 
Mantid::API::CoordTransform const * getTransformToOriginal (size_t index=0) const
 Get the Coordinate Transformation that goes from THIS workspace's coordinates to the ORIGINAL workspace's coordinates. More...
 
const Kernel::DblMatrixgetWTransf () const
 get the transformation from Qin crystal cartezian coordinate system to Q in orthogonal or real HKL coordiate system alined with arbitrary slicing plane More...
 
std::shared_ptr< const Mantid::Geometry::IMDDimensiongetXDimension () const
 Get the x-dimension mapping. More...
 
std::shared_ptr< const Mantid::Geometry::IMDDimensiongetYDimension () const
 Get the y-dimension mapping. More...
 
std::shared_ptr< const Mantid::Geometry::IMDDimensiongetZDimension () const
 Get the z-dimension mapping. More...
 
bool hasOriginalWorkspace (size_t index=0) const
 
void initGeometry (const std::vector< std::shared_ptr< Geometry::IMDDimension > > &dimensions)
 Initialize the geometry. More...
 
 MDGeometry ()
 Constructor. More...
 
 MDGeometry (const MDGeometry &other)
 Copy Constructor. More...
 
size_t numOriginalWorkspaces () const
 
MDGeometryoperator= (const MDGeometry &other)
 
void setBasisVector (size_t index, const Mantid::Kernel::VMD &vec)
 Set the basis vector (in the original workspace) for a dimension of this workspace. More...
 
void setOrigin (const Mantid::Kernel::VMD &orig)
 Sets the origin of this geometry. More...
 
void setOriginalWorkspace (std::shared_ptr< Workspace > ws, size_t index=0)
 Set the "original" workspace (the workspace that was the source for a binned MDWorkspace). More...
 
void setTransformFromOriginal (Mantid::API::CoordTransform *transform, size_t index=0)
 Sets the Coordinate Transformation that goes from the original workspace to this workspace's coordinates. More...
 
void setTransformToOriginal (Mantid::API::CoordTransform *transform, size_t index=0)
 Sets the Coordinate Transformation that goes from THIS workspace's coordinates to the ORIGINAL workspace's coordinates. More...
 
void setWTransf (const Kernel::DblMatrix &WTransf)
 set the transformation from Q in crystal cartezian coordinate system to Q in orthogonal or real HKL coordiate system alined with arbitrary slicing plane More...
 
void transformDimensions (std::vector< double > &scaling, std::vector< double > &offset)
 Transform the dimensions contained in this geometry x' = x*scaling + offset. More...
 
virtual ~MDGeometry ()
 Destructor. More...
 
- Public Member Functions inherited from Mantid::API::ExperimentInfo
virtual ExperimentInfocloneExperimentInfo () const
 Clone us. More...
 
const Geometry::ComponentInfocomponentInfo () const
 
const Geometry::ParameterMapconstInstrumentParameters () const
 Const version. More...
 
void copyExperimentInfoFrom (const ExperimentInfo *other)
 Copy everything from the given experiment object. More...
 
const Geometry::DetectorInfodetectorInfo () const
 Return a const reference to the DetectorInfo object. More...
 
 ExperimentInfo ()
 Default constructor. More...
 
 ExperimentInfo (const ExperimentInfo &)
 Copy constructor. More...
 
std::string getAvailableWorkspaceEndDate () const
 Return workspace end date as a formatted string (strftime style, as returned by Kernel::DateAdnTime) string, if available. More...
 
std::string getAvailableWorkspaceStartDate () const
 Return workspace start date as a formatted string (strftime, as returned by Types::Core::DateAndTime) string, if available. More...
 
double getEFixed (const detid_t detID) const
 Easy access to the efixed value for this run & detector ID. More...
 
double getEFixed (const std::shared_ptr< const Geometry::IDetector > &detector=std::shared_ptr< const Geometry::IDetector >{nullptr}) const
 Easy access to the efixed value for this run & optional detector. More...
 
double getEFixedForIndirect (const std::shared_ptr< const Geometry::IDetector > &detector, const std::vector< std::string > &parameterNames) const
 
double getEFixedGivenEMode (const std::shared_ptr< const Geometry::IDetector > &detector, const Kernel::DeltaEMode::Type emode) const
 Easy access to the efixed value for this run & detector. More...
 
Kernel::DeltaEMode::Type getEMode () const
 Returns the emode for this run. More...
 
Geometry::Instrument_const_sptr getInstrument () const
 Returns the parameterized instrument. More...
 
Kernel::PropertygetLog (const std::string &log) const
 Access a log for this experiment. More...
 
double getLogAsSingleValue (const std::string &log) const
 Access a single value from a log for this experiment. More...
 
int getRunNumber () const
 Utility method to get the run number. More...
 
std::string getWorkspaceStartDate () const
 Returns the start date for this experiment (or current time if no info available) More...
 
Geometry::ParameterMapinstrumentParameters ()
 Returns a modifiable set of instrument parameters. More...
 
const Geometry::ParameterMapinstrumentParameters () const
 Returns the set of parameters modifying the base instrument (const-version) More...
 
void invalidateSpectrumDefinition (const size_t index)
 Notifies the ExperimentInfo that a spectrum definition has changed. More...
 
void loadExperimentInfoNexus (const std::string &nxFilename, ::NeXus::File *file, std::string &parameterStr)
 Loads an experiment description from the open NeXus file. More...
 
void loadExperimentInfoNexus (const std::string &nxFilename, ::NeXus::File *file, std::string &parameterStr, const Mantid::Kernel::NexusHDF5Descriptor &fileInfo, const std::string &prefix)
 
void loadInstrumentInfoNexus (const std::string &nxFilename, ::NeXus::File *file)
 Load the instrument from an open NeXus file without reading any parameters. More...
 
void loadInstrumentInfoNexus (const std::string &nxFilename, ::NeXus::File *file, std::string &parameterStr)
 Load the instrument from an open NeXus file. More...
 
void loadInstrumentParametersNexus (::NeXus::File *file, std::string &parameterStr)
 Load instrument parameters from an open Nexus file in Instument group if found there. More...
 
void loadSampleAndLogInfoNexus (::NeXus::File *file)
 Load the sample and log info from an open NeXus file. More...
 
void loadSampleAndLogInfoNexus (::NeXus::File *file, const Mantid::Kernel::NexusHDF5Descriptor &fileInfo, const std::string &prefix)
 Load the sample and log info from an open NeXus file. More...
 
Geometry::ComponentInfomutableComponentInfo ()
 
Geometry::DetectorInfomutableDetectorInfo ()
 Return a non-const reference to the DetectorInfo object. More...
 
RunmutableRun ()
 Writable version of the run object. More...
 
SamplemutableSample ()
 Writable version of the sample object. More...
 
SpectrumInfomutableSpectrumInfo ()
 Return a non-const reference to the SpectrumInfo object. More...
 
ExperimentInfooperator= (const ExperimentInfo &)
 Implements the copy assignment operator. More...
 
void populateInstrumentParameters ()
 Add parameters to the instrument parameter map that are defined in instrument definition file or parameter file, which may contain parameters that require logfile data to be available. More...
 
void readParameterMap (const std::string &parameterStr)
 Populate the parameter map given a string. More...
 
const Runrun () const
 Run details object access. More...
 
const Samplesample () const
 Sample accessors. More...
 
void saveExperimentInfoNexus (::NeXus::File *file, bool saveInstrument, bool saveSample, bool saveLogs) const
 Saves this experiment description to the open NeXus file. More...
 
void saveExperimentInfoNexus (::NeXus::File *file, bool saveLegacyInstrument=true) const
 Saves this experiment description to the open NeXus file. More...
 
void setDetectorGrouping (const size_t index, const std::set< detid_t > &detIDs) const
 Sets the detector grouping for the spectrum with the given index. More...
 
void setEFixed (const detid_t detID, const double value)
 Set the efixed value for a given detector ID. More...
 
void setInstrument (const Geometry::Instrument_const_sptr &instr)
 Instrument accessors. More...
 
void setNumberOfDetectorGroups (const size_t count) const
 Sets the number of detector groups. More...
 
void setSharedRun (Kernel::cow_ptr< Run > run)
 Set the run object. Use in particular to clear run without copying old run. More...
 
Kernel::cow_ptr< RunsharedRun ()
 Return the cow ptr of the run. More...
 
const SpectrumInfospectrumInfo () const
 Return a reference to the SpectrumInfo object. More...
 
const std::string toString () const
 Returns a string description of the object. More...
 
void updateSpectrumDefinitionIfNecessary (const size_t index) const
 
virtual ~ExperimentInfo ()
 Virtual destructor. More...
 

Private Member Functions

const std::string toString () const
 Returns a string description of the object. More...
 

Friends

class WorkspaceFactoryImpl
 

Instrument queries

using MaskList = std::map< size_t, double >
 Masked bins for each spectrum are stored as a set of pairs containing <bin index, weight> More...
 
static const std::string xDimensionId = "xDimension"
 Dimension id for x-dimension. More...
 
static const std::string yDimensionId = "yDimension"
 Dimensin id for y-dimension. More...
 
std::vector< std::unique_ptr< Axis > > m_axes
 A vector of pointers to the axes for this workspace. More...
 
std::unique_ptr< Indexing::IndexInfo > m_indexInfo
 
bool m_isInitialized {false}
 Has this workspace been initialised? More...
 
std::string m_YUnit
 The unit for the data values (e.g. Counts) More...
 
std::string m_YUnitLabel
 A text label for use when plotting spectra. More...
 
std::atomic< bool > m_isCommonBinsFlagValid {false}
 Flag indicating if the common bins flag is in a valid state. More...
 
bool m_isCommonBinsFlag {false}
 Flag indicating whether the data has common bins. More...
 
std::mutex m_isCommonBinsMutex
 A mutex protecting the update of m_isCommonBinsFlag. More...
 
std::map< int64_t, MaskListm_masks
 The set of masked bins in a map keyed on workspace index. More...
 
std::shared_ptr< MatrixWorkspacem_monitorWorkspace
 A workspace holding monitor data relating to the main data in the containing workspace (null if none). More...
 
std::atomic< bool > m_indexInfoNeedsUpdate {true}
 
std::mutex m_indexInfoMutex
 
std::shared_ptr< const Geometry::IDetectorgetDetector (const size_t workspaceIndex) const
 Get the effective detector for the given spectrum. More...
 
double detectorTwoTheta (const Geometry::IDetector &det) const
 Returns the 2Theta scattering angle for a detector. More...
 
double detectorSignedTwoTheta (const Geometry::IDetector &det) const
 Returns the signed 2Theta scattering angle for a detector. More...
 
virtual void updateSpectraUsing (const SpectrumDetectorMapping &map)
 
void rebuildSpectraMapping (const bool includeMonitors=true, const specnum_t specNumOffset=1)
 Build the default spectra mapping, most likely wanted after an instrument update. More...
 
spec2index_map getSpectrumToWorkspaceIndexMap () const
 Return a map where: KEY is the Spectrum # VALUE is the Workspace Index. More...
 
detid2index_map getDetectorIDToWorkspaceIndexMap (bool throwIfMultipleDets=false, bool ignoreIfNoValidDets=false) const
 Return a map where: KEY is the DetectorID (pixel ID) VALUE is the Workspace Index. More...
 
virtual std::vector< size_t > getDetectorIDToWorkspaceIndexVector (detid_t &offset, bool throwIfMultipleDets=false) const
 Return a vector where: The index into the vector = DetectorID (pixel ID) + offset The value at that index = the corresponding Workspace Index. More...
 
virtual std::vector< size_t > getSpectrumToWorkspaceIndexVector (specnum_t &offset) const
 Return a vector where: The index into the vector = spectrum number + offset The value at that index = the corresponding Workspace Index. More...
 
std::vector< size_t > getIndicesFromSpectra (const std::vector< specnum_t > &spectraList) const
 Converts a list of spectrum numbers to the corresponding workspace indices. More...
 
size_t getIndexFromSpectrumNumber (const specnum_t specNo) const
 Given a spectrum number, find the corresponding workspace index. More...
 
std::vector< size_t > getIndicesFromDetectorIDs (const std::vector< detid_t > &detIdList) const
 Converts a list of detector IDs to the corresponding workspace indices. More...
 
std::vector< specnum_tgetSpectraFromDetectorIDs (const std::vector< detid_t > &detIdList) const
 Converts a list of detector IDs to the corresponding spectrum numbers. More...
 
bool hasGroupedDetectors () const
 Does the workspace has any grouped detectors? More...
 
virtual bool isRaggedWorkspace () const =0
 Returns true if the workspace is ragged (has differently sized spectra). More...
 
size_t getMemorySize () const override
 Get the footprint in memory in bytes. More...
 
virtual size_t getMemorySizeForXAxes () const
 Returns the memory used (in bytes) by the X axes, handling ragged bins. More...
 
virtual std::size_t size () const =0
 Returns the number of single indexable items in the workspace. More...
 
virtual std::size_t blocksize () const =0
 Returns the size of each block of data returned by the dataY accessors. More...
 
virtual std::size_t getNumberBins (const std::size_t &index) const =0
 Returns the number of bins for a given histogram index. More...
 
virtual std::size_t getMaxNumberBins () const =0
 Returns the maximum number of bins in a workspace (works on ragged data). More...
 
virtual std::size_t getNumberHistograms () const =0
 Returns the number of histograms in the workspace. More...
 
void setTitle (const std::string &) override
 Sets MatrixWorkspace title. More...
 
const std::string getTitle () const override
 Gets MatrixWorkspace title (same as Run object run_title property) More...
 
virtual Types::Core::DateAndTime getFirstPulseTime () const
 Return the time of the first pulse received, by accessing the run's sample logs to find the proton_charge. More...
 
Types::Core::DateAndTime getLastPulseTime () const
 Return the time of the last pulse received, by accessing the run's sample logs to find the proton_charge. More...
 
std::size_t yIndexOfX (const double xValue, const std::size_t &index=0, const double tolerance=0.0) const
 Returns the y index which corresponds to the X Value provided. More...
 
virtual ISpectrumgetSpectrum (const size_t index)=0
 Return the underlying ISpectrum ptr at the given workspace index. More...
 
virtual const ISpectrumgetSpectrum (const size_t index) const =0
 Return the underlying ISpectrum ptr (const version) at the given workspace index. More...
 
HistogramData::Histogram histogram (const size_t index) const
 Returns the Histogram at the given workspace index. More...
 
template<typename... T>
void setHistogram (const size_t index, T &&...data) &
 
void convertToCounts (const size_t index)
 
void convertToFrequencies (const size_t index)
 
HistogramData::BinEdges binEdges (const size_t index) const
 
HistogramData::Points points (const size_t index) const
 
HistogramData::PointStandardDeviations pointStandardDeviations (const size_t index) const
 
template<typename... T>
void setBinEdges (const size_t index, T &&...data) &
 
template<typename... T>
void setPoints (const size_t index, T &&...data) &
 
template<typename... T>
void setPointVariances (const size_t index, T &&...data) &
 
template<typename... T>
void setPointStandardDeviations (const size_t index, T &&...data) &
 
HistogramData::Counts counts (const size_t index) const
 
HistogramData::CountVariances countVariances (const size_t index) const
 
HistogramData::CountStandardDeviations countStandardDeviations (const size_t index) const
 
HistogramData::Frequencies frequencies (const size_t index) const
 
HistogramData::FrequencyVariances frequencyVariances (const size_t index) const
 
HistogramData::FrequencyStandardDeviations frequencyStandardDeviations (const size_t index) const
 
template<typename... T>
void setCounts (const size_t index, T &&...data) &
 
template<typename... T>
void setCountVariances (const size_t index, T &&...data) &
 
template<typename... T>
void setCountStandardDeviations (const size_t index, T &&...data) &
 
template<typename... T>
void setFrequencies (const size_t index, T &&...data) &
 
template<typename... T>
void setFrequencyVariances (const size_t index, T &&...data) &
 
template<typename... T>
void setFrequencyStandardDeviations (const size_t index, T &&...data) &
 
const HistogramData::HistogramX & x (const size_t index) const
 
const HistogramData::HistogramY & y (const size_t index) const
 
const HistogramData::HistogramE & e (const size_t index) const
 
const HistogramData::HistogramDx & dx (const size_t index) const
 
HistogramData::HistogramX & mutableX (const size_t index) &
 
HistogramData::HistogramDx & mutableDx (const size_t index) &
 
HistogramData::HistogramY & mutableY (const size_t index) &
 
HistogramData::HistogramE & mutableE (const size_t index) &
 
Kernel::cow_ptr< HistogramData::HistogramX > sharedX (const size_t index) const
 
Kernel::cow_ptr< HistogramData::HistogramY > sharedY (const size_t index) const
 
Kernel::cow_ptr< HistogramData::HistogramE > sharedE (const size_t index) const
 
Kernel::cow_ptr< HistogramData::HistogramDx > sharedDx (const size_t index) const
 
void setSharedX (const size_t index, const Kernel::cow_ptr< HistogramData::HistogramX > &x) &
 
void setSharedDx (const size_t index, const Kernel::cow_ptr< HistogramData::HistogramDx > &dx) &
 
void setSharedY (const size_t index, const Kernel::cow_ptr< HistogramData::HistogramY > &y) &
 
void setSharedE (const size_t index, const Kernel::cow_ptr< HistogramData::HistogramE > &e) &
 
const MantidVecreadX (std::size_t const index) const
 Deprecated, use x() instead. More...
 
const MantidVecreadY (std::size_t const index) const
 Deprecated, use y() instead. More...
 
const MantidVecreadE (std::size_t const index) const
 Deprecated, use e() instead. More...
 
const MantidVecreadDx (size_t const index) const
 Deprecated, use dx() instead. More...
 
virtual MantidVecdataX (const std::size_t index)
 Deprecated, use mutableX() instead. Returns the x data. More...
 
virtual MantidVecdataY (const std::size_t index)
 Deprecated, use mutableY() instead. Returns the y data. More...
 
virtual MantidVecdataE (const std::size_t index)
 Deprecated, use mutableE() instead. Returns the error data. More...
 
virtual MantidVecdataDx (const std::size_t index)
 Deprecated, use mutableDx() instead. Returns the x error data. More...
 
virtual const MantidVecdataX (const std::size_t index) const
 Deprecated, use x() instead. Returns the x data const. More...
 
virtual const MantidVecdataY (const std::size_t index) const
 Deprecated, use y() instead. Returns the y data const. More...
 
virtual const MantidVecdataE (const std::size_t index) const
 Deprecated, use e() instead. Returns the error const. More...
 
virtual const MantidVecdataDx (const std::size_t index) const
 Deprecated, use dx() instead. Returns the error const. More...
 
virtual double getXMin () const
 
virtual double getXMax () const
 
virtual void getXMinMax (double &xmin, double &xmax) const
 
virtual Kernel::cow_ptr< HistogramData::HistogramX > refX (const std::size_t index) const
 Deprecated, use sharedX() instead. Returns a pointer to the x data. More...
 
virtual void setX (const std::size_t index, const Kernel::cow_ptr< HistogramData::HistogramX > &X)
 Deprecated, use setSharedX() instead. More...
 
virtual void setX (const std::size_t index, const std::shared_ptr< HistogramData::HistogramX > &X)
 Deprecated, use setSharedX() instead. More...
 
virtual bool hasDx (const std::size_t index) const
 Probes if DX (X Error) values were set on a particular spectrum. More...
 
virtual void generateHistogram (const std::size_t index, const MantidVec &X, MantidVec &Y, MantidVec &E, bool skipError=false) const =0
 Generate the histogram or rebin the existing histogram. More...
 
virtual void getIntegratedSpectra (std::vector< double > &out, const double minX, const double maxX, const bool entireRange) const
 Return a vector with the integrated counts for all spectra withing the given range. More...
 
std::pair< size_t, double > getXIndex (size_t i, double x, bool isLeft=true, size_t start=0) const
 Return an index in the X vector for an x-value close to a given value. More...
 
int axes () const
 
virtual AxisgetAxis (const std::size_t &axisIndex) const
 Get a non owning pointer to a workspace axis. More...
 
void replaceAxis (const std::size_t &axisIndex, std::unique_ptr< Axis > newAxis)
 Replaces one of the workspace's axes with the new one provided. More...
 
size_t numberOfAxis () const
 Will return the number of Axis currently stored in the workspace it is not always safe to assume it is just 2. More...
 
virtual bool isCommonLogBins () const
 Returns true if the workspace contains common X bins with log spacing. More...
 
virtual bool isHistogramData () const
 Returns true if the workspace contains data in histogram form (as opposed to point-like) More...
 
virtual bool isCommonBins () const
 Returns true if the workspace contains common X bins. More...
 
virtual bool isIntegerBins () const
 Returns true if the workspace has common, integer X bins. More...
 
std::string YUnit () const
 Returns the units of the data in the workspace. More...
 
void setYUnit (const std::string &newUnit)
 Sets a new unit for the data (Y axis) in the workspace. More...
 
std::string YUnitLabel (bool useLatex=false, bool plotAsDistribution=false) const
 Returns a caption for the units of the data in the workspace. More...
 
void setYUnitLabel (const std::string &newLabel)
 Sets a new caption for the data (Y axis) in the workspace. More...
 
bool isDistribution () const
 Are the Y-values dimensioned? More...
 
void setDistribution (bool newValue)
 Set the flag for whether the Y-values are dimensioned. More...
 
void maskBin (const size_t &workspaceIndex, const size_t &binIndex, const double &weight=1.0)
 Called by the algorithm MaskBins to mask a single bin for the first time, algorithms that later propagate the the mask from an input to the output should call flagMasked() instead. More...
 
void flagMasked (const size_t &index, const size_t &binIndex, const double &weight=1.0)
 Writes the masking weight to m_masks (doesn't alter y-values). More...
 
bool hasMaskedBins (const size_t &workspaceIndex) const
 Does this spectrum contain any masked bins. More...
 
bool hasAnyMaskedBins () const
 Does this workspace contain any masked bins. More...
 
const MaskListmaskedBins (const size_t &workspaceIndex) const
 Returns the list of masked bins for a spectrum. More...
 
std::vector< size_t > maskedBinsIndices (const size_t &workspaceIndex) const
 
void setMaskedBins (const size_t workspaceIndex, const MaskList &maskedBins)
 Set the list of masked bins for given workspaceIndex. More...
 
void setUnmaskedBins (const size_t workspaceIndex)
 Removes the mask from an index. More...
 
virtual void setMonitorWorkspace (const std::shared_ptr< MatrixWorkspace > &monitorWS)
 Sets the internal monitor workspace to the provided workspace. More...
 
std::shared_ptr< MatrixWorkspacemonitorWorkspace () const
 Returns a pointer to the internal monitor workspace. More...
 
void loadInstrumentNexus (::NeXus::File *file)
 
size_t getNumDims () const override
 
std::shared_ptr< const Mantid::Geometry::IMDDimensiongetDimension (size_t index) const override
 Get a dimension. More...
 
std::shared_ptr< const Mantid::Geometry::IMDDimensiongetDimensionWithId (std::string id) const override
 Get a dimension. More...
 
uint64_t getNPoints () const override
 Gets the number of points available on the workspace. More...
 
uint64_t getNEvents () const override
 Get the number of points available on the workspace. More...
 
LinePlot getLinePlot (const Mantid::Kernel::VMD &start, const Mantid::Kernel::VMD &end, Mantid::API::MDNormalization normalize) const override
 Generate a line plot through the matrix workspace. More...
 
signal_t getSignalAtCoord (const coord_t *coords, const Mantid::API::MDNormalization &normalization) const override
 Get the signal at a coordinate in the workspace. More...
 
signal_t getSignalWithMaskAtCoord (const coord_t *coords, const Mantid::API::MDNormalization &normalization) const override
 Get the signal at a coordinate in the workspace. More...
 
std::vector< std::unique_ptr< IMDIterator > > createIterators (size_t suggestedNumCores=1, Mantid::Geometry::MDImplicitFunction *function=nullptr) const override
 Create iterators. More...
 
void setMDMasking (std::unique_ptr< Mantid::Geometry::MDImplicitFunction > maskingRegion) override
 Apply masking. More...
 
void clearMDMasking () override
 Clear exsting masking. More...
 
Mantid::Kernel::SpecialCoordinateSystem getSpecialCoordinateSystem () const override
 
virtual bool hasOrientedLattice () const override
 
virtual std::pair< int64_t, int64_t > findY (double value, const std::pair< int64_t, int64_t > &idx={0, 0}) const
 Find first index in Y equal to value. More...
 
std::pair< size_t, size_t > getImageStartEndXIndices (size_t i, double startX, double endX) const
 Get start and end x indices for images. More...
 
MantidImage_sptr getImageY (size_t start=0, size_t stop=0, size_t width=0, double startX=EMPTY_DBL(), double endX=EMPTY_DBL()) const
 Create an image of Ys. More...
 
MantidImage_sptr getImageE (size_t start=0, size_t stop=0, size_t width=0, double startX=EMPTY_DBL(), double endX=EMPTY_DBL()) const
 Create an image of Es. More...
 
virtual void setImageY (const MantidImage &image, size_t start=0, bool parallelExecution=true)
 Copy the data (Y's) from an image to this workspace. More...
 
virtual void setImageE (const MantidImage &image, size_t start=0, bool parallelExecution=true)
 Copy the data from an image to this workspace's errors. More...
 
void invalidateCachedSpectrumNumbers ()
 
void invalidateCommonBinsFlag ()
 Invalidates the commons bins flag. More...
 
 MatrixWorkspace (const MatrixWorkspace &other)
 Protected copy constructor. May be used by childs for cloning. More...
 
 MatrixWorkspace (const Parallel::StorageMode storageMode=Parallel::StorageMode::Cloned)
 Default constructor. More...
 
virtual void init (const std::size_t &NVectors, const std::size_t &XLength, const std::size_t &YLength)=0
 Initialises the workspace. More...
 
virtual void init (const HistogramData::Histogram &histogram)=0
 
virtual ISpectrumgetSpectrumWithoutInvalidation (const size_t index)=0
 
void updateCachedDetectorGrouping (const size_t index) const override
 Update detector grouping for spectrum with given index. More...
 
std::string getDimensionIdFromAxis (const int &axisIndex) const
 Getter for the dimension id based on the axis. More...
 
std::size_t binIndexOfValue (Mantid::HistogramData::HistogramX const &xValues, const double xValue, const bool ascendingOrder) const
 Returns the bin index of the given X value. More...
 
std::size_t xIndexOfValue (const Mantid::HistogramData::HistogramX &xValues, const double xValue, const double tolerance) const
 Returns the X index of the given X value. More...
 
MatrixWorkspacedoClone () const override=0
 Virtual clone method. Not implemented to force implementation in children. More...
 
MatrixWorkspacedoCloneEmpty () const override=0
 Virtual cloneEmpty method. More...
 
MantidImage_sptr getImage (const MantidVec &(MatrixWorkspace::*read)(std::size_t const) const, size_t start, size_t stop, size_t width, size_t indexStart, size_t indexEnd) const
 Create an MantidImage instance. More...
 
void setImage (MantidVec &(MatrixWorkspace::*dataVec)(const std::size_t), const MantidImage &image, size_t start, bool parallelExecution)
 Copy data from an image. More...
 
void setIndexInfoWithoutISpectrumUpdate (const Indexing::IndexInfo &indexInfo)
 Variant of setIndexInfo, used by WorkspaceFactoryImpl. More...
 
void buildDefaultSpectrumDefinitions ()
 
void rebuildDetectorIDGroupings ()
 
virtual bool isHistogramDataByIndex (std::size_t index=0) const
 Whether the specified histogram contains histogram data (ie bins) More...
 

Additional Inherited Members

- Protected Member Functions inherited from Mantid::API::IMDWorkspace
 IMDWorkspace (const IMDWorkspace &)=default
 Protected copy constructor. May be used by childs for cloning. More...
 
void makeSinglePointWithNaN (std::vector< coord_t > &x, std::vector< signal_t > &y, std::vector< signal_t > &e) const
 Make a single point with NaN as the signal and error This can be returned when there would otherwise be nothing to plot. More...
 
const std::string toString () const override
 Serializes the object to a string. More...
 
- Protected Member Functions inherited from Mantid::API::Workspace
void setStorageMode (Parallel::StorageMode mode)
 Sets the storage mode (used for MPI runs) More...
 
 Workspace (const Workspace &)
 Protected copy constructor. May be used by childs for cloning. More...
 
- Protected Member Functions inherited from Mantid::Kernel::DataItem
Poco::RWLock * getLock () const
 Private method to access the RWLock object. More...
 
- Protected Member Functions inherited from Mantid::API::MDGeometry
void deleteNotificationReceived (const std::shared_ptr< const Workspace > &deleted)
 Function called when observer objects recieves a notification. More...
 
- Protected Member Functions inherited from Mantid::API::ExperimentInfo
size_t numberOfDetectorGroups () const
 Returns the number of detector groups. More...
 
virtual void populateIfNotLoaded () const
 Called as the first operation of most public methods. More...
 
void setSpectrumDefinitions (Kernel::cow_ptr< std::vector< SpectrumDefinition > > spectrumDefinitions)
 Sets the SpectrumDefinition for all spectra. More...
 
virtual void updateCachedDetectorGrouping (const size_t index) const
 Update detector grouping for spectrum with given index. More...
 
- Protected Attributes inherited from Mantid::API::MDGeometry
std::vector< Mantid::Kernel::VMDm_basisVectors
 Vector of the basis vector (in the original workspace) for each dimension of this workspace. More...
 
std::vector< std::shared_ptr< Geometry::IMDDimension > > m_dimensions
 Vector of the dimensions used, in the order X Y Z t, etc. More...
 
std::unique_ptr< MDGeometryNotificationHelperm_notificationHelper
 Helper that deals with notifications and observing the ADS. More...
 
Mantid::Kernel::VMD m_origin
 Vector of the origin (in the original workspace) that corresponds to 0,0,0... in this workspace. More...
 
std::vector< std::shared_ptr< Workspace > > m_originalWorkspaces
 Pointer to the original workspace(s), if this workspace is a coordinate transformation from an original workspace. More...
 
std::vector< std::shared_ptr< const Mantid::API::CoordTransform > > m_transforms_FromOriginal
 Coordinate Transformation that goes from the original workspace to this workspace's coordinates. More...
 
std::vector< std::shared_ptr< const Mantid::API::CoordTransform > > m_transforms_ToOriginal
 Coordinate Transformation that goes from this workspace's coordinates to the original workspace coordinates. More...
 
Kernel::DblMatrix m_Wtransf
 the matrix which transforms momentums from orthogonal Q-system to Orthogonal HKL or non-orthogonal HKL system alighned WRT to arbitrary coordinate system requested See the UB matrix formalizm, pg 7 for further details on implementation. More...
 
- Protected Attributes inherited from Mantid::API::ExperimentInfo
std::shared_ptr< Geometry::ParameterMapm_parmap
 Parameters modifying the base instrument. More...
 
Geometry::Instrument_const_sptr sptr_instrument
 The base (unparametrized) instrument. More...
 

Detailed Description

Base MatrixWorkspace Abstract Class.

Author
Laurent C Chapon, ISIS, RAL
Date
26/09/2007

Definition at line 52 of file MatrixWorkspace.h.

Member Typedef Documentation

◆ MaskList

using Mantid::API::MatrixWorkspace::MaskList = std::map<size_t, double>

Masked bins for each spectrum are stored as a set of pairs containing <bin index, weight>

Definition at line 351 of file MatrixWorkspace.h.

Constructor & Destructor Documentation

◆ ~MatrixWorkspace()

Mantid::API::MatrixWorkspace::~MatrixWorkspace ( )
overridedefault

Delete.

Destructor.

◆ MatrixWorkspace() [1/2]

Mantid::API::MatrixWorkspace::MatrixWorkspace ( const MatrixWorkspace other)
protected

Protected copy constructor. May be used by childs for cloning.

Definition at line 117 of file MatrixWorkspace.cpp.

References m_axes, and m_isCommonBinsFlagValid.

◆ MatrixWorkspace() [2/2]

Mantid::API::MatrixWorkspace::MatrixWorkspace ( const Parallel::StorageMode  storageMode = Parallel::StorageMode::Cloned)
protected

Default constructor.

Definition at line 113 of file MatrixWorkspace.cpp.

Member Function Documentation

◆ axes()

int Mantid::API::MatrixWorkspace::axes ( ) const
Returns
The number of axes which this workspace has

Definition at line 866 of file MatrixWorkspace.cpp.

References m_axes.

Referenced by export_MatrixWorkspace(), getDimensionWithId(), getSignalAtCoord(), and toString().

◆ binEdges()

HistogramData::BinEdges Mantid::API::MatrixWorkspace::binEdges ( const size_t  index) const
inline

◆ binIndexOfValue()

std::size_t Mantid::API::MatrixWorkspace::binIndexOfValue ( Mantid::HistogramData::HistogramX const &  xValues,
const double  xValue,
const bool  ascendingOrder 
) const
private

Returns the bin index of the given X value.

Parameters
xValues:: The histogram to search
xValue:: The X value to search for
ascendingOrder:: True if the order of the xValues is ascending
Returns
An index to the bin containing X

Definition at line 1372 of file MatrixWorkspace.cpp.

Referenced by yIndexOfX().

◆ blocksize()

virtual std::size_t Mantid::API::MatrixWorkspace::blocksize ( ) const
pure virtual

◆ buildDefaultSpectrumDefinitions()

void Mantid::API::MatrixWorkspace::buildDefaultSpectrumDefinitions ( )
private

Definition at line 2077 of file MatrixWorkspace.cpp.

References Mantid::API::ExperimentInfo::detectorInfo(), and m_indexInfo.

Referenced by setIndexInfo().

◆ clearMDMasking()

void Mantid::API::MatrixWorkspace::clearMDMasking ( )
overridevirtual

Clear exsting masking.

Implements Mantid::API::IMDWorkspace.

Definition at line 1756 of file MatrixWorkspace.cpp.

◆ clone()

MatrixWorkspace_uptr Mantid::API::MatrixWorkspace::clone ( ) const
inline

Returns a clone of the workspace.

Definition at line 71 of file MatrixWorkspace.h.

◆ cloneEmpty()

MatrixWorkspace_uptr Mantid::API::MatrixWorkspace::cloneEmpty ( ) const
inline

Returns a default-initialized clone of the workspace.

Definition at line 74 of file MatrixWorkspace.h.

◆ convertToCounts()

void Mantid::API::MatrixWorkspace::convertToCounts ( const size_t  index)
inline

Definition at line 159 of file MatrixWorkspace.h.

References index.

◆ convertToFrequencies()

void Mantid::API::MatrixWorkspace::convertToFrequencies ( const size_t  index)
inline

Definition at line 160 of file MatrixWorkspace.h.

References index.

◆ counts()

HistogramData::Counts Mantid::API::MatrixWorkspace::counts ( const size_t  index) const
inline

Definition at line 178 of file MatrixWorkspace.h.

References index.

Referenced by Mantid::MDAlgorithms::IntegrateFlux::integrateSpectraHistograms().

◆ countStandardDeviations()

HistogramData::CountStandardDeviations Mantid::API::MatrixWorkspace::countStandardDeviations ( const size_t  index) const
inline

Definition at line 180 of file MatrixWorkspace.h.

References index.

◆ countVariances()

HistogramData::CountVariances Mantid::API::MatrixWorkspace::countVariances ( const size_t  index) const
inline

Definition at line 179 of file MatrixWorkspace.h.

References index.

◆ createIterators()

std::vector< std::unique_ptr< IMDIterator > > Mantid::API::MatrixWorkspace::createIterators ( size_t  suggestedNumCores = 1,
Mantid::Geometry::MDImplicitFunction function = nullptr 
) const
overridevirtual

Create iterators.

Create IMDIterators from this 2D workspace.

Partitions the iterators according to the number of cores.

Parameters
suggestedNumCores:: split the iterators into this many cores (if threadsafe)
function:: implicit function to limit range
Returns
MatrixWorkspaceMDIterator vector

Implements Mantid::API::IMDWorkspace.

Definition at line 1618 of file MatrixWorkspace.cpp.

References getNumberHistograms(), and Mantid::API::Workspace::threadSafe().

◆ dataDx() [1/2]

virtual MantidVec & Mantid::API::MatrixWorkspace::dataDx ( const std::size_t  index)
inlinevirtual

Deprecated, use mutableDx() instead. Returns the x error data.

Reimplemented in Mantid::DataObjects::EventWorkspace.

Definition at line 262 of file MatrixWorkspace.h.

References index.

Referenced by export_MatrixWorkspace().

◆ dataDx() [2/2]

virtual const MantidVec & Mantid::API::MatrixWorkspace::dataDx ( const std::size_t  index) const
inlinevirtual

Deprecated, use dx() instead. Returns the error const.

Reimplemented in Mantid::DataObjects::EventWorkspace.

Definition at line 271 of file MatrixWorkspace.h.

References index.

◆ dataE() [1/2]

virtual MantidVec & Mantid::API::MatrixWorkspace::dataE ( const std::size_t  index)
inlinevirtual

◆ dataE() [2/2]

virtual const MantidVec & Mantid::API::MatrixWorkspace::dataE ( const std::size_t  index) const
inlinevirtual

Deprecated, use e() instead. Returns the error const.

Reimplemented in Mantid::DataObjects::EventWorkspace.

Definition at line 269 of file MatrixWorkspace.h.

References index.

◆ dataX() [1/2]

virtual MantidVec & Mantid::API::MatrixWorkspace::dataX ( const std::size_t  index)
inlinevirtual

Deprecated, use mutableX() instead. Returns the x data.

Reimplemented in Mantid::DataObjects::EventWorkspace.

Definition at line 256 of file MatrixWorkspace.h.

References index.

Referenced by Mantid::DataObjects::SpecialWorkspace2D::copyFrom(), export_MatrixWorkspace(), and getXMinMax().

◆ dataX() [2/2]

virtual const MantidVec & Mantid::API::MatrixWorkspace::dataX ( const std::size_t  index) const
inlinevirtual

Deprecated, use x() instead. Returns the x data const.

Reimplemented in Mantid::DataObjects::EventWorkspace.

Definition at line 265 of file MatrixWorkspace.h.

References index.

◆ dataY() [1/2]

virtual MantidVec & Mantid::API::MatrixWorkspace::dataY ( const std::size_t  index)
inlinevirtual

◆ dataY() [2/2]

virtual const MantidVec & Mantid::API::MatrixWorkspace::dataY ( const std::size_t  index) const
inlinevirtual

Deprecated, use y() instead. Returns the y data const.

Reimplemented in Mantid::DataObjects::EventWorkspace.

Definition at line 267 of file MatrixWorkspace.h.

References index.

◆ detectorSignedTwoTheta()

double Mantid::API::MatrixWorkspace::detectorSignedTwoTheta ( const Geometry::IDetector det) const

Returns the signed 2Theta scattering angle for a detector.

Parameters
det:: A pointer to the detector object (N.B. might be a DetectorGroup)
Returns
The scattering angle (0 < theta < pi)
Exceptions
InstrumentDefinitionErrorif source or sample is missing, or they are in the same place

Definition at line 817 of file MatrixWorkspace.cpp.

References Mantid::API::ExperimentInfo::getInstrument(), Mantid::Geometry::IDetector::getSignedTwoTheta(), Mantid::Kernel::V3D::nullVector(), and Mantid::API::ExperimentInfo::sample().

Referenced by Mantid::Algorithms::ConvertSpectrumAxis::exec(), and export_MatrixWorkspace().

◆ detectorTwoTheta()

double Mantid::API::MatrixWorkspace::detectorTwoTheta ( const Geometry::IDetector det) const

Returns the 2Theta scattering angle for a detector.

Parameters
det:: A pointer to the detector object (N.B. might be a DetectorGroup)
Returns
The scattering angle (0 < theta < pi)
Exceptions
InstrumentDefinitionErrorif source or sample is missing, or they are in the same place

Definition at line 846 of file MatrixWorkspace.cpp.

References Mantid::API::ExperimentInfo::getInstrument(), Mantid::Geometry::IDetector::getTwoTheta(), Mantid::Kernel::V3D::nullVector(), and Mantid::API::ExperimentInfo::sample().

Referenced by Mantid::Algorithms::ConvertSpectrumAxis::exec(), export_MatrixWorkspace(), and Mantid::DataHandling::SaveNexusProcessed::saveSpectraDetectorMapNexus().

◆ doClone()

MatrixWorkspace * Mantid::API::MatrixWorkspace::doClone ( ) const
overrideprivatepure virtual

◆ doCloneEmpty()

MatrixWorkspace * Mantid::API::MatrixWorkspace::doCloneEmpty ( ) const
overrideprivatepure virtual

◆ dx()

const HistogramData::HistogramDx & Mantid::API::MatrixWorkspace::dx ( const size_t  index) const
inline

Definition at line 211 of file MatrixWorkspace.h.

References index.

Referenced by Mantid::Algorithms::SortXAxis::copyXandDxToOutputWorkspace().

◆ e()

const HistogramData::HistogramE & Mantid::API::MatrixWorkspace::e ( const size_t  index) const
inline

◆ findY()

std::pair< int64_t, int64_t > Mantid::API::MatrixWorkspace::findY ( double  value,
const std::pair< int64_t, int64_t > &  idx = {0, 0} 
) const
virtual

Find first index in Y equal to value.

Parameters
valueNumber to find in Y
idxstarting indices for search
Returns
Tuple with the ihistogram and bin indices.

Definition at line 1868 of file MatrixWorkspace.cpp.

References getNumberHistograms(), value, Mantid::Geometry::Y, and Mantid::Geometry::y.

◆ flagMasked()

void Mantid::API::MatrixWorkspace::flagMasked ( const size_t &  index,
const size_t &  binIndex,
const double &  weight = 1.0 
)

Writes the masking weight to m_masks (doesn't alter y-values).

Contains a parallel critical section and so is thread safe

Parameters
index:: The workspace index of the spectrum
binIndex:: The index of the bin in the spectrum
weight:: 'How heavily' the bin is to be masked. =1 for full masking (the default).

Definition at line 1170 of file MatrixWorkspace.cpp.

References index, m_masks, maskBin(), and PARALLEL_CRITICAL.

Referenced by maskBin().

◆ frequencies()

HistogramData::Frequencies Mantid::API::MatrixWorkspace::frequencies ( const size_t  index) const
inline

Definition at line 183 of file MatrixWorkspace.h.

References index.

◆ frequencyStandardDeviations()

HistogramData::FrequencyStandardDeviations Mantid::API::MatrixWorkspace::frequencyStandardDeviations ( const size_t  index) const
inline

Definition at line 187 of file MatrixWorkspace.h.

References index.

◆ frequencyVariances()

HistogramData::FrequencyVariances Mantid::API::MatrixWorkspace::frequencyVariances ( const size_t  index) const
inline

Definition at line 184 of file MatrixWorkspace.h.

References index.

◆ generateHistogram()

virtual void Mantid::API::MatrixWorkspace::generateHistogram ( const std::size_t  index,
const MantidVec X,
MantidVec Y,
MantidVec E,
bool  skipError = false 
) const
pure virtual

◆ getAxis()

Axis * Mantid::API::MatrixWorkspace::getAxis ( const std::size_t &  axisIndex) const
virtual

◆ getDetector()

Geometry::IDetector_const_sptr Mantid::API::MatrixWorkspace::getDetector ( const size_t  workspaceIndex) const

Get the effective detector for the given spectrum.

Parameters
workspaceIndexThe workspace index for which the detector is required
Returns
A single detector object representing the detector(s) contributing to the given spectrum number. If more than one detector contributes then the returned object's concrete type will be DetectorGroup.
Exceptions
Kernel::Exception::NotFoundErrorIf the Instrument is missing or the requested workspace index does not have any associated detectors

Definition at line 787 of file MatrixWorkspace.cpp.

References Mantid::Kernel::Logger::debug(), Mantid::API::g_log, Mantid::API::ISpectrum::getDetectorIDs(), Mantid::API::ExperimentInfo::getInstrument(), and getSpectrum().

Referenced by export_MatrixWorkspace().

◆ getDetectorIDToWorkspaceIndexMap()

detid2index_map Mantid::API::MatrixWorkspace::getDetectorIDToWorkspaceIndexMap ( bool  throwIfMultipleDets = false,
bool  ignoreIfNoValidDets = false 
) const

Return a map where: KEY is the DetectorID (pixel ID) VALUE is the Workspace Index.

Parameters
throwIfMultipleDets:: set to true to make the algorithm throw an error if there is more than one detector for a specific workspace index.
ignoreIfNoValidDets:: set to true to exclude spectra that do not include any valid detector IDs. Note that if any valid detector IDs exist then all of the detector IDs (including the invalid ones) will be returned.
Exceptions
runtime_errorif there is more than one detector per spectrum (if throwIfMultipleDets is true)
Returns
Index to Index Map object. THE CALLER TAKES OWNERSHIP OF THE MAP AND IS RESPONSIBLE FOR ITS DELETION.

Definition at line 488 of file MatrixWorkspace.cpp.

References Mantid::API::ISpectrum::getDetectorIDs(), getNumberHistograms(), getSpectrum(), and Mantid::API::ExperimentInfo::spectrumInfo().

Referenced by Mantid::DataHandling::LoadMask::convertSpMasksToDetIDs().

◆ getDetectorIDToWorkspaceIndexVector()

std::vector< size_t > Mantid::API::MatrixWorkspace::getDetectorIDToWorkspaceIndexVector ( detid_t &  offset,
bool  throwIfMultipleDets = false 
) const
virtual

Return a vector where: The index into the vector = DetectorID (pixel ID) + offset The value at that index = the corresponding Workspace Index.

Parameters
offset:: add this to the detector ID to get the index into the vector.
throwIfMultipleDets:: set to true to make the algorithm throw an error if there is more than one detector for a specific workspace index.
Exceptions
runtime_errorif there is more than one detector per spectrum (if throwIfMultipleDets is true)
Returns
:: vector set to above definition

Definition at line 535 of file MatrixWorkspace.cpp.

References Mantid::Kernel::Logger::debug(), Mantid::API::g_log, Mantid::API::ISpectrum::getDetectorIDs(), Mantid::API::ExperimentInfo::getInstrument(), getNumberHistograms(), getSpectrum(), and index.

◆ getDimension()

std::shared_ptr< const Mantid::Geometry::IMDDimension > Mantid::API::MatrixWorkspace::getDimension ( size_t  index) const
overridevirtual

Get a dimension.

Parameters
index:: which dimension
Returns
the dimension at that index

Reimplemented from Mantid::API::MDGeometry.

Definition at line 1582 of file MatrixWorkspace.cpp.

References getAxis(), index, xDimensionId, and yDimensionId.

Referenced by Mantid::API::MatrixWorkspaceMDIterator::MatrixWorkspaceMDIterator().

◆ getDimensionIdFromAxis()

std::string Mantid::API::MatrixWorkspace::getDimensionIdFromAxis ( const int &  axisIndex) const
protected

Getter for the dimension id based on the axis.

Definition at line 1423 of file MatrixWorkspace.cpp.

References Mantid::Kernel::DataItem::id(), xDimensionId, and yDimensionId.

Referenced by getDimensionWithId().

◆ getDimensionWithId()

std::shared_ptr< const Mantid::Geometry::IMDDimension > Mantid::API::MatrixWorkspace::getDimensionWithId ( std::string  id) const
overridevirtual

Get a dimension.

Parameters
id:: string ID of the dimension
Returns
the dimension with the specified id string.

Reimplemented from Mantid::API::MDGeometry.

Definition at line 1592 of file MatrixWorkspace.cpp.

References axes(), getAxis(), getDimensionIdFromAxis(), and Mantid::Kernel::DataItem::id().

◆ getFirstPulseTime()

Types::Core::DateAndTime Mantid::API::MatrixWorkspace::getFirstPulseTime ( ) const
virtual

Return the time of the first pulse received, by accessing the run's sample logs to find the proton_charge.

NOTE, JZ: Pulse times before 1991 (up to 100) are skipped. This is to avoid a DAS bug at SNS around Mar 2011 where the first pulse time is Jan 1, 1990.

Returns
the time of the first pulse
Exceptions
Exception::NotFoundErrorif the log is not found; or if it is empty.
invalid_argumentif the log is not a double TimeSeriesProperty (should be impossible)

Definition at line 1302 of file MatrixWorkspace.cpp.

References Mantid::Kernel::TimeSeriesProperty< TYPE >::firstTime(), Mantid::API::LogManager::getTimeSeriesProperty(), Mantid::Kernel::TimeSeriesProperty< TYPE >::nthTime(), and Mantid::API::ExperimentInfo::run().

◆ getImage()

MantidImage_sptr Mantid::API::MatrixWorkspace::getImage ( const MantidVec &(MatrixWorkspace::*)(std::size_t const) const  read,
size_t  start,
size_t  stop,
size_t  width,
size_t  indexStart,
size_t  indexEnd 
) const
private

Create an MantidImage instance.

Creates a 2D image.

Parameters
read:: Pointer to a method returning a MantidVec to provide data for the image.
start:: First workspace index for the image.
stop:: Last workspace index for the image.
width:: Image width. Must divide (stop - start + 1) exactly.
indexStart:: First index of the x integration range.
indexEnd:: Last index of the x integration range.

Definition at line 1780 of file MatrixWorkspace.cpp.

References blocksize(), getNumberHistograms(), height, isHistogramData(), and PARALLEL_FOR_NO_WSP_CHECK.

Referenced by getImageE(), and getImageY().

◆ getImageE()

MantidImage_sptr Mantid::API::MatrixWorkspace::getImageE ( size_t  start = 0,
size_t  stop = 0,
size_t  width = 0,
double  startX = EMPTY_DBL(),
double  endX = EMPTY_DBL() 
) const

Create an image of Es.

Creates a 2D image of the error values in this workspace.

Parameters
start:: First workspace index for the image.
stop:: Last workspace index for the image.
width:: Image width. Must divide (stop - start + 1) exactly.
startX:: Lower bound of the x integration range.
endX:: Upper bound of the x integration range.

Definition at line 1935 of file MatrixWorkspace.cpp.

References getImage(), getImageStartEndXIndices(), and readE().

◆ getImageStartEndXIndices()

std::pair< size_t, size_t > Mantid::API::MatrixWorkspace::getImageStartEndXIndices ( size_t  i,
double  startX,
double  endX 
) const

Get start and end x indices for images.

Parameters
i:: Histogram index.
startX:: Lower bound of the x integration range.
endX:: Upper bound of the x integration range.

Definition at line 1898 of file MatrixWorkspace.cpp.

References Mantid::EMPTY_DBL(), getXIndex(), and Mantid::Geometry::x.

Referenced by getImageE(), and getImageY().

◆ getImageY()

MantidImage_sptr Mantid::API::MatrixWorkspace::getImageY ( size_t  start = 0,
size_t  stop = 0,
size_t  width = 0,
double  startX = EMPTY_DBL(),
double  endX = EMPTY_DBL() 
) const

Create an image of Ys.

Creates a 2D image of the y values in this workspace.

Parameters
start:: First workspace index for the image.
stop:: Last workspace index for the image.
width:: Image width. Must divide (stop - start + 1) exactly.
startX:: Lower bound of the x integration range.
endX:: Upper bound of the x integration range.

Definition at line 1922 of file MatrixWorkspace.cpp.

References getImage(), getImageStartEndXIndices(), and readY().

◆ getIndexFromSpectrumNumber()

size_t Mantid::API::MatrixWorkspace::getIndexFromSpectrumNumber ( const specnum_t  specNo) const

Given a spectrum number, find the corresponding workspace index.

Parameters
specNo:: spectrum number wanted
Returns
the workspace index
Exceptions
runtime_errorif not found.

Definition at line 603 of file MatrixWorkspace.cpp.

References getNumberHistograms(), getSpectrum(), and Mantid::API::ISpectrum::getSpectrumNo().

Referenced by export_MatrixWorkspace().

◆ getIndicesFromDetectorIDs()

std::vector< size_t > Mantid::API::MatrixWorkspace::getIndicesFromDetectorIDs ( const std::vector< detid_t > &  detIdList) const

Converts a list of detector IDs to the corresponding workspace indices.

Note that only known detector IDs are converted (so an empty vector will be returned if none of the IDs are recognised), and that the returned workspace indices are effectively a set (i.e. there are no duplicates).

Parameters
detIdList:: The list of detector IDs required
Returns
:: a vector of indices

Definition at line 622 of file MatrixWorkspace.cpp.

References Mantid::API::ISpectrum::getDetectorIDs(), getNumberHistograms(), getSpectrum(), and m_indexInfo.

Referenced by Mantid::Algorithms::CalculateEfficiency::maskComponent().

◆ getIndicesFromSpectra()

std::vector< size_t > Mantid::API::MatrixWorkspace::getIndicesFromSpectra ( const std::vector< specnum_t > &  spectraList) const

Converts a list of spectrum numbers to the corresponding workspace indices.

Not a very efficient operation, but unfortunately it's sometimes required.

Parameters
spectraList:: The list of spectrum numbers required
Returns
:: the vector of indices (empty if not a Workspace2D)

Definition at line 579 of file MatrixWorkspace.cpp.

References getNumberHistograms(), getSpectrum(), and Mantid::API::ISpectrum::getSpectrumNo().

◆ getIntegratedSpectra()

void Mantid::API::MatrixWorkspace::getIntegratedSpectra ( std::vector< double > &  out,
const double  minX,
const double  maxX,
const bool  entireRange 
) const
virtual

Return a vector with the integrated counts for all spectra withing the given range.

Integrate all the spectra in the matrix workspace within the range given.

NaN and Infinite values are ignored. Default implementation, can be overridden by base classes if they know something smarter!

Parameters
out:: returns the vector where there is one entry per spectrum in the workspace. Same order as the workspace indices.
minX:: minimum X bin to use in integrating.
maxX:: maximum X bin to use in integrating.
entireRange:: set to true to use the entire range. minX and maxX are then ignored!

Reimplemented in Mantid::DataObjects::EventWorkspace.

Definition at line 732 of file MatrixWorkspace.cpp.

References getNumberHistograms(), isHistogramData(), PARALLEL_FOR_IF, readX(), Mantid::API::Workspace::threadSafe(), Mantid::Geometry::x, and Mantid::Geometry::y.

◆ getLastPulseTime()

Types::Core::DateAndTime Mantid::API::MatrixWorkspace::getLastPulseTime ( ) const

Return the time of the last pulse received, by accessing the run's sample logs to find the proton_charge.

Returns
the time of the first pulse
Exceptions
runtime_errorif the log is not found; or if it is empty.
invalid_argumentif the log is not a double TimeSeriesProperty (should be impossible)

Definition at line 1327 of file MatrixWorkspace.cpp.

References Mantid::API::LogManager::getTimeSeriesProperty(), Mantid::Kernel::TimeSeriesProperty< TYPE >::lastTime(), and Mantid::API::ExperimentInfo::run().

◆ getLinePlot()

IMDWorkspace::LinePlot Mantid::API::MatrixWorkspace::getLinePlot ( const Mantid::Kernel::VMD start,
const Mantid::Kernel::VMD end,
Mantid::API::MDNormalization  normalize 
) const
overridevirtual

Generate a line plot through the matrix workspace.

Obtain coordinates for a line plot through a MDWorkspace.

Cross the workspace from start to end points, recording the signal along the line. Sets the x,y vectors to the histogram bin boundaries and counts

Parameters
start:: coordinates of the start point of the line
end:: coordinates of the end point of the line
normalize:: how to normalize the signal
Returns
:: a LinePlot in which x is set to the boundaries of the bins, relative to start of the line, y is set to the normalized signal for each bin with Length = length(x) - 1 and e is set to the normalized errors for each bin with Length = length(x) - 1.

Reimplemented from Mantid::API::IMDWorkspace.

Definition at line 1654 of file MatrixWorkspace.cpp.

References Mantid::API::IMDWorkspace::getLinePlot(), and Mantid::Kernel::normalize().

◆ getMaxNumberBins()

virtual std::size_t Mantid::API::MatrixWorkspace::getMaxNumberBins ( ) const
pure virtual

Returns the maximum number of bins in a workspace (works on ragged data).

Implemented in Mantid::DataObjects::EventWorkspace, Mantid::DataObjects::Workspace2D, Mantid::DataObjects::WorkspaceSingleValue, and AxeslessWorkspaceTester.

Referenced by export_MatrixWorkspace().

◆ getMemorySize()

size_t Mantid::API::MatrixWorkspace::getMemorySize ( ) const
overridevirtual

Get the footprint in memory in bytes.

Return memory used by the workspace, in bytes.

Returns
bytes used.

Implements Mantid::API::Workspace.

Reimplemented in Mantid::DataObjects::EventWorkspace.

Definition at line 1271 of file MatrixWorkspace.cpp.

References Mantid::API::Run::getMemorySize(), Mantid::API::ExperimentInfo::run(), and size().

◆ getMemorySizeForXAxes()

size_t Mantid::API::MatrixWorkspace::getMemorySizeForXAxes ( ) const
virtual

Returns the memory used (in bytes) by the X axes, handling ragged bins.

Returns
bytes used

Definition at line 1279 of file MatrixWorkspace.cpp.

References getNumberHistograms(), refX(), and Mantid::Geometry::X.

Referenced by Mantid::DataObjects::EventWorkspace::getMemorySize().

◆ getNEvents()

uint64_t Mantid::API::MatrixWorkspace::getNEvents ( ) const
inlineoverridevirtual

Get the number of points available on the workspace.

Implements Mantid::API::IMDWorkspace.

Definition at line 380 of file MatrixWorkspace.h.

◆ getNPoints()

uint64_t Mantid::API::MatrixWorkspace::getNPoints ( ) const
overridevirtual

Gets the number of points available on the workspace.

Implements Mantid::API::IMDWorkspace.

Definition at line 1416 of file MatrixWorkspace.cpp.

References size().

◆ getNumberBins()

virtual std::size_t Mantid::API::MatrixWorkspace::getNumberBins ( const std::size_t &  index) const
pure virtual

◆ getNumberHistograms()

virtual std::size_t Mantid::API::MatrixWorkspace::getNumberHistograms ( ) const
pure virtual

Returns the number of histograms in the workspace.

Implemented in Mantid::DataObjects::EventWorkspace, Mantid::DataObjects::Workspace2D, Mantid::DataObjects::WorkspaceSingleValue, and AxeslessWorkspaceTester.

Referenced by Mantid::Algorithms::ConjoinWorkspaces::checkForOverlap(), Mantid::PythonInterface::cloneDx(), Mantid::PythonInterface::cloneE(), Mantid::PythonInterface::cloneX(), Mantid::PythonInterface::cloneY(), createIterators(), Mantid::MDAlgorithms::IntegrateFlux::createOutputWorkspace(), Mantid::Algorithms::MonteCarloAbsorption::doSimulation(), Mantid::Algorithms::DiscusMultipleScatteringCorrection::exec(), Mantid::Algorithms::WorkspaceJoiners::execWS2D(), export_MatrixWorkspace(), Mantid::Algorithms::SparseWorkspace::extremeAngles(), Mantid::Algorithms::SparseWorkspace::extremeWavelengths(), findY(), Mantid::Algorithms::AppendSpectra::fixSpectrumNumbers(), Mantid::Algorithms::ConjoinWorkspaces::fixSpectrumNumbers(), getDetectorIDToWorkspaceIndexMap(), getDetectorIDToWorkspaceIndexVector(), getImage(), getIndexFromSpectrumNumber(), getIndicesFromDetectorIDs(), getIndicesFromSpectra(), getIntegratedSpectra(), getMemorySizeForXAxes(), Mantid::Algorithms::WorkspaceJoiners::getMinMax(), getSignalAtCoord(), getSpectraFromDetectorIDs(), Mantid::Algorithms::DiscusMultipleScatteringCorrection::getXMinMax(), getXMinMax(), hasGroupedDetectors(), hasMaskedBins(), indexInfo(), Mantid::API::SpectraAxis::indexOfValue(), Mantid::API::WorkspaceFactoryImpl::initializeFromParent(), Mantid::MDAlgorithms::IntegrateFlux::integrateSpectraEvents(), Mantid::MDAlgorithms::IntegrateFlux::integrateSpectraHistograms(), Mantid::MDAlgorithms::IntegrateFlux::integrateSpectraPointData(), isCommonBins(), isCommonLogBins(), Mantid::Algorithms::isItSorted(), Mantid::API::SpectraAxis::length(), Mantid::Algorithms::SofQWCentre::makeDistribution(), Mantid::Algorithms::RemoveMaskedSpectra::makeIndexList(), Mantid::Algorithms::DetectorDiagnostic::makeInstrumentMap(), maskBin(), Mantid::API::WorkspaceHelpers::matchingBins(), Mantid::API::MatrixWorkspaceMDIterator::MatrixWorkspaceMDIterator(), Mantid::Algorithms::PolarizationEfficiencyCor::needInterpolation(), Mantid::Algorithms::DirectILLTubeBackground::peakExcludingAverage(), Mantid::Algorithms::MaskNonOverlappingBins::processNonRagged(), Mantid::Algorithms::MaskNonOverlappingBins::processRagged(), rebuildSpectraMapping(), setDistribution(), setImage(), setIndexInfo(), setIndexInfoWithoutISpectrumUpdate(), Mantid::Algorithms::SmoothNeighbours::setupNewInstrument(), Mantid::API::WorkspaceHelpers::sharedXData(), toString(), updateSpectraUsing(), Mantid::API::WorkspaceNearestNeighbourInfo::WorkspaceNearestNeighbourInfo(), and yIndexOfX().

◆ getNumDims()

size_t Mantid::API::MatrixWorkspace::getNumDims ( ) const
overridevirtual
Returns
the number of dimensions in this workspace

Reimplemented from Mantid::API::MDGeometry.

Reimplemented in Mantid::DataObjects::WorkspaceSingleValue.

Definition at line 1421 of file MatrixWorkspace.cpp.

◆ getSignalAtCoord()

signal_t Mantid::API::MatrixWorkspace::getSignalAtCoord ( const coord_t coords,
const Mantid::API::MDNormalization normalization 
) const
overridevirtual

Get the signal at a coordinate in the workspace.

Returns the (normalized) signal at a given coordinates.

Parameters
coords:: bare array, size 2, of coordinates. X, Y
normalization:: how to normalize the signal
Returns
normalized signal.

Implements Mantid::API::IMDWorkspace.

Definition at line 1665 of file MatrixWorkspace.cpp.

References axes(), getAxis(), getNumberHistograms(), Mantid::API::Axis::indexOfValue(), Mantid::Kernel::VectorHelper::indexOfValueFromCenters(), Mantid::Kernel::VectorHelper::indexOfValueFromEdges(), isHistogramData(), Mantid::API::Axis::isNumeric(), Mantid::API::NoNormalization, Mantid::API::NumEventsNormalization, std::to_string(), Mantid::API::VolumeNormalization, Mantid::Geometry::x, and Mantid::Geometry::y.

Referenced by getSignalWithMaskAtCoord().

◆ getSignalWithMaskAtCoord()

signal_t Mantid::API::MatrixWorkspace::getSignalWithMaskAtCoord ( const coord_t coords,
const Mantid::API::MDNormalization normalization 
) const
overridevirtual

Get the signal at a coordinate in the workspace.

Returns the (normalized) signal at a given coordinates Implementation differs from getSignalAtCoord for MD workspaces.

Parameters
coords:: bare array, size 2, of coordinates. X, Y
normalization:: how to normalize the signal
Returns
normalized signal.

Implements Mantid::API::IMDWorkspace.

Definition at line 1740 of file MatrixWorkspace.cpp.

References getSignalAtCoord().

◆ getSpecialCoordinateSystem()

Mantid::Kernel::SpecialCoordinateSystem Mantid::API::MatrixWorkspace::getSpecialCoordinateSystem ( ) const
overridevirtual
Returns
the special coordinate system used if any.

Implements Mantid::API::IMDWorkspace.

Reimplemented in AxeslessWorkspaceTester.

Definition at line 1763 of file MatrixWorkspace.cpp.

References Mantid::Kernel::None.

◆ getSpectraFromDetectorIDs()

std::vector< specnum_t > Mantid::API::MatrixWorkspace::getSpectraFromDetectorIDs ( const std::vector< detid_t > &  detIdList) const

Converts a list of detector IDs to the corresponding spectrum numbers.

Might be slow!

Parameters
detIdList:: The list of detector IDs required
Returns
:: a reference to the vector of spectrum numbers. 0 for not-found detectors

Definition at line 654 of file MatrixWorkspace.cpp.

References getNumberHistograms(), getSpectrum(), Mantid::API::ISpectrum::getSpectrumNo(), and Mantid::API::ISpectrum::hasDetectorID().

Referenced by Mantid::API::WorkspaceNearestNeighbourInfo::getNeighbours().

◆ getSpectrum() [1/2]

virtual const ISpectrum & Mantid::API::MatrixWorkspace::getSpectrum ( const size_t  index) const
pure virtual

◆ getSpectrum() [2/2]

virtual ISpectrum & Mantid::API::MatrixWorkspace::getSpectrum ( const size_t  index)
pure virtual

Return the underlying ISpectrum ptr at the given workspace index.

Implemented in Mantid::DataObjects::EventWorkspace, Mantid::DataObjects::Workspace2D, Mantid::DataObjects::WorkspaceSingleValue, AxeslessWorkspaceTester, and Mantid::API::IEventWorkspace.

Referenced by Mantid::Algorithms::ConjoinWorkspaces::checkForOverlap(), Mantid::Algorithms::MonteCarloAbsorption::doSimulation(), Mantid::Algorithms::DiscusMultipleScatteringCorrection::exec(), Mantid::Algorithms::WorkspaceJoiners::execWS2D(), export_MatrixWorkspace(), Mantid::Algorithms::ConjoinWorkspaces::fixSpectrumNumbers(), getDetector(), getDetectorIDToWorkspaceIndexMap(), getDetectorIDToWorkspaceIndexVector(), getIndexFromSpectrumNumber(), getIndicesFromDetectorIDs(), getIndicesFromSpectra(), Mantid::API::SpectraAxis::getMax(), Mantid::API::SpectraAxis::getMin(), Mantid::Algorithms::WorkspaceJoiners::getMinMax(), getSpectraFromDetectorIDs(), Mantid::API::SpectraAxis::getSpectraIndexMap(), hasGroupedDetectors(), indexInfo(), Mantid::API::WorkspaceFactoryImpl::initializeFromParent(), isDistribution(), isHistogramDataByIndex(), Mantid::Algorithms::CalculateEfficiency::maskComponent(), Mantid::API::SpectraAxis::operator()(), Mantid::Algorithms::BinaryOperation::propagateSpectraMask(), Mantid::DataHandling::LoadNexusProcessed::readInstrumentGroup(), rebuildDetectorIDGroupings(), rebuildSpectraMapping(), Mantid::DataHandling::SaveNexusProcessed::saveSpectrumNumbersNexus(), setDistribution(), Mantid::Algorithms::SmoothNeighbours::setupNewInstrument(), Mantid::API::SpectraAxis::spectraNo(), updateCachedDetectorGrouping(), updateSpectraUsing(), and Mantid::API::WorkspaceNearestNeighbourInfo::WorkspaceNearestNeighbourInfo().

◆ getSpectrumToWorkspaceIndexMap()

spec2index_map Mantid::API::MatrixWorkspace::getSpectrumToWorkspaceIndexMap ( ) const

Return a map where: KEY is the Spectrum # VALUE is the Workspace Index.

Definition at line 399 of file MatrixWorkspace.cpp.

References Mantid::Kernel::Logger::error(), Mantid::API::g_log, and m_axes.

Referenced by Mantid::DataHandling::LoadMask::convertSpMasksToDetIDs().

◆ getSpectrumToWorkspaceIndexVector()

std::vector< size_t > Mantid::API::MatrixWorkspace::getSpectrumToWorkspaceIndexVector ( specnum_t offset) const
virtual

Return a vector where: The index into the vector = spectrum number + offset The value at that index = the corresponding Workspace Index.

Returns
:: vector set to above definition
Parameters
offset:: add this to the detector ID to get the index into the vector.

Definition at line 421 of file MatrixWorkspace.cpp.

References m_axes.

◆ getSpectrumWithoutInvalidation()

virtual ISpectrum & Mantid::API::MatrixWorkspace::getSpectrumWithoutInvalidation ( const size_t  index)
protectedpure virtual

◆ getTitle()

const std::string Mantid::API::MatrixWorkspace::getTitle ( ) const
overridevirtual

◆ getXIndex()

std::pair< size_t, double > Mantid::API::MatrixWorkspace::getXIndex ( size_t  i,
double  x,
bool  isLeft = true,
size_t  start = 0 
) const

Return an index in the X vector for an x-value close to a given value.

Find an index in the X vector for an x-value close to a given value.

It is returned as the first member of the pair. The second member is the fraction [0,1] of bin width cut off by the search value. If the first member == size of X vector then search failed.

Parameters
i:: Histogram index.
x:: The value to find the index for.
isLeft:: If true the left bin boundary is returned, if false - the right one.
start:: Index to start the search from.

Definition at line 1952 of file MatrixWorkspace.cpp.

References fabs, index, Mantid::Geometry::X, and Mantid::Geometry::x.

Referenced by getImageStartEndXIndices().

◆ getXMax()

double Mantid::API::MatrixWorkspace::getXMax ( ) const
virtual

◆ getXMin()

double Mantid::API::MatrixWorkspace::getXMin ( ) const
virtual

◆ getXMinMax()

void Mantid::API::MatrixWorkspace::getXMinMax ( double &  xmin,
double &  xmax 
) const
virtual

◆ hasAnyMaskedBins()

bool Mantid::API::MatrixWorkspace::hasAnyMaskedBins ( ) const

Does this workspace contain any masked bins.

Returns
True if there are masked bins somewhere in this workspace

Definition at line 1195 of file MatrixWorkspace.cpp.

References m_masks.

Referenced by export_MatrixWorkspace().

◆ hasDx()

virtual bool Mantid::API::MatrixWorkspace::hasDx ( const std::size_t  index) const
inlinevirtual

Probes if DX (X Error) values were set on a particular spectrum.

Parameters
indexthe workspace index

Definition at line 298 of file MatrixWorkspace.h.

References index.

Referenced by Mantid::Algorithms::SortXAxis::copyXandDxToOutputWorkspace(), and export_MatrixWorkspace().

◆ hasGroupedDetectors()

bool Mantid::API::MatrixWorkspace::hasGroupedDetectors ( ) const

Does the workspace has any grouped detectors?

Returns
true if the workspace has any grouped detectors, otherwise false

Definition at line 461 of file MatrixWorkspace.cpp.

References Mantid::API::ISpectrum::getDetectorIDs(), getNumberHistograms(), and getSpectrum().

◆ hasMaskedBins()

bool Mantid::API::MatrixWorkspace::hasMaskedBins ( const size_t &  workspaceIndex) const

Does this spectrum contain any masked bins.

Parameters
workspaceIndex:: The workspace index to test
Returns
True if there are masked bins for this spectrum

Definition at line 1184 of file MatrixWorkspace.cpp.

References getNumberHistograms(), and m_masks.

Referenced by Mantid::CurveFitting::Algorithms::SplineBackground::addWsDataToSpline(), Mantid::CurveFitting::Algorithms::SplineBackground::calculateNumBinsToProcess(), Mantid::Algorithms::WorkspaceJoiners::execWS2D(), and export_MatrixWorkspace().

◆ hasOrientedLattice()

bool Mantid::API::MatrixWorkspace::hasOrientedLattice ( ) const
overridevirtual

◆ histogram()

HistogramData::Histogram Mantid::API::MatrixWorkspace::histogram ( const size_t  index) const
inline

◆ indexInfo()

const Indexing::IndexInfo & Mantid::API::MatrixWorkspace::indexInfo ( ) const

◆ init() [1/2]

virtual void Mantid::API::MatrixWorkspace::init ( const HistogramData::Histogram &  histogram)
protectedpure virtual

◆ init() [2/2]

virtual void Mantid::API::MatrixWorkspace::init ( const std::size_t &  NVectors,
const std::size_t &  XLength,
const std::size_t &  YLength 
)
protectedpure virtual

Initialises the workspace.

Sets the size and lengths of the arrays. Must be overloaded.

Implemented in Mantid::DataObjects::EventWorkspace, Mantid::DataObjects::RebinnedOutput, Mantid::DataObjects::Workspace2D, and Mantid::DataObjects::WorkspaceSingleValue.

Referenced by initialize().

◆ initialize() [1/3]

void Mantid::API::MatrixWorkspace::initialize ( const Indexing::IndexInfo &  indexInfo,
const HistogramData::Histogram &  histogram 
)

◆ initialize() [2/3]

void Mantid::API::MatrixWorkspace::initialize ( const std::size_t &  NVectors,
const HistogramData::Histogram &  histogram 
)

Definition at line 287 of file MatrixWorkspace.cpp.

References histogram(), and initialize().

◆ initialize() [3/3]

void Mantid::API::MatrixWorkspace::initialize ( const std::size_t &  NVectors,
const std::size_t &  XLength,
const std::size_t &  YLength 
)

Initialize the workspace.

Calls the protected init() method, which is implemented in each type of workspace. Returns immediately if the workspace is already initialized.

Parameters
NVectors:: The number of spectra in the workspace (only relevant for a 2D workspace
XLength:: The number of X data points/bin boundaries in each vector (must all be the same)
YLength:: The number of data/error points in each vector (must all be the same)

Definition at line 262 of file MatrixWorkspace.cpp.

References init(), m_indexInfo, m_isInitialized, and Mantid::API::ExperimentInfo::setNumberOfDetectorGroups().

Referenced by initialize(), Mantid::Algorithms::SparseWorkspace::SparseWorkspace(), and Mantid::DataObjects::SpecialWorkspace2D::SpecialWorkspace2D().

◆ invalidateCachedSpectrumNumbers()

void Mantid::API::MatrixWorkspace::invalidateCachedSpectrumNumbers ( )

◆ invalidateCommonBinsFlag()

void Mantid::API::MatrixWorkspace::invalidateCommonBinsFlag ( )
inline

Invalidates the commons bins flag.

This is generally called when a method could allow the X values to be changed.

Definition at line 445 of file MatrixWorkspace.h.

Referenced by AxeslessWorkspaceTester::getSpectrum(), and Mantid::DataObjects::EventWorkspace::setAllX().

◆ isCommonBins()

bool Mantid::API::MatrixWorkspace::isCommonBins ( ) const
virtual

Returns true if the workspace contains common X bins.

Whether the workspace contains common X bins.

Returns
whether the workspace contains common X bins

Definition at line 1041 of file MatrixWorkspace.cpp.

References EPSILON(), getNumberHistograms(), m_isCommonBinsFlag, m_isCommonBinsFlagValid, m_isCommonBinsMutex, size(), and Mantid::Geometry::x.

Referenced by export_MatrixWorkspace(), Mantid::Algorithms::MaskNonOverlappingBins::isCommonBins(), isCommonLogBins(), and isIntegerBins().

◆ isCommonLogBins()

bool Mantid::API::MatrixWorkspace::isCommonLogBins ( ) const
virtual

Returns true if the workspace contains common X bins with log spacing.

Whether the workspace contains common X bins with logarithmic spacing.

Returns
whether the workspace contains common X bins with log spacing

Definition at line 904 of file MatrixWorkspace.cpp.

References EPSILON(), getNumberHistograms(), isCommonBins(), and Mantid::Geometry::x.

Referenced by export_MatrixWorkspace().

◆ isDistribution()

bool Mantid::API::MatrixWorkspace::isDistribution ( ) const

Are the Y-values dimensioned?

Are the Y-values in this workspace dimensioned? TODO: For example: ????

Returns
whether workspace is a distribution or not

Definition at line 989 of file MatrixWorkspace.cpp.

References getSpectrum(), and Mantid::API::ISpectrum::yMode().

Referenced by Mantid::Algorithms::WorkspaceJoiners::checkCompatibility(), Mantid::Algorithms::DirectILLTubeBackground::exec(), export_MatrixWorkspace(), Mantid::DataObjects::Workspace2D::generateHistogram(), Mantid::API::WorkspaceFactoryImpl::initializeFromParent(), setDistribution(), toString(), and YUnitLabel().

◆ isHistogramData()

bool Mantid::API::MatrixWorkspace::isHistogramData ( ) const
virtual

Returns true if the workspace contains data in histogram form (as opposed to point-like)

Whether the workspace contains histogram data.

Returns
whether the workspace contains histogram data

Reimplemented in Mantid::DataObjects::EventWorkspace.

Definition at line 1009 of file MatrixWorkspace.cpp.

References isHistogramDataByIndex().

Referenced by export_MatrixWorkspace(), getImage(), getIntegratedSpectra(), Mantid::API::MWXDimension::getNBins(), getSignalAtCoord(), Mantid::MDAlgorithms::IntegrateFlux::integrateSpectraMatrix(), Mantid::API::MatrixWorkspaceMDIterator::MatrixWorkspaceMDIterator(), Mantid::Algorithms::PolarizationEfficiencyCor::needInterpolation(), and toString().

◆ isHistogramDataByIndex()

bool Mantid::API::MatrixWorkspace::isHistogramDataByIndex ( std::size_t  index = 0) const
privatevirtual

Whether the specified histogram contains histogram data (ie bins)

Parameters
index:: Index of the histogram to be checked
Returns
whether the histogram contains histogram data

Definition at line 1019 of file MatrixWorkspace.cpp.

References getSpectrum(), Mantid::API::ISpectrum::histogram(), histogram(), index, Mantid::Geometry::x, and Mantid::Geometry::y.

Referenced by isHistogramData(), and yIndexOfX().

◆ isIntegerBins()

bool Mantid::API::MatrixWorkspace::isIntegerBins ( ) const
virtual

Returns true if the workspace has common, integer X bins.

Whether the workspace's bins are integers - and common.

Returns
Whether the workspace's bins are integers - and common.

Definition at line 1108 of file MatrixWorkspace.cpp.

References isCommonBins(), and Mantid::Geometry::x.

◆ isRaggedWorkspace()

virtual bool Mantid::API::MatrixWorkspace::isRaggedWorkspace ( ) const
pure virtual

Returns true if the workspace is ragged (has differently sized spectra).

Implemented in Mantid::DataObjects::EventWorkspace, Mantid::DataObjects::Workspace2D, Mantid::DataObjects::WorkspaceSingleValue, and AxeslessWorkspaceTester.

Referenced by export_MatrixWorkspace().

◆ loadInstrumentNexus()

void Mantid::API::MatrixWorkspace::loadInstrumentNexus ( ::NeXus::File *  file)

◆ maskBin()

void Mantid::API::MatrixWorkspace::maskBin ( const size_t &  workspaceIndex,
const size_t &  binIndex,
const double &  weight = 1.0 
)

Called by the algorithm MaskBins to mask a single bin for the first time, algorithms that later propagate the the mask from an input to the output should call flagMasked() instead.

Here y-values and errors will be scaled by (1-weight) as well as the mask flags (m_masks) being updated. This function doesn't protect the writes to the y and e-value arrays and so is not safe if called by multiple threads working on the same spectrum. Writing to the mask set is marked parrallel critical so different spectra can be analysised in parallel

Parameters
workspaceIndex:: The workspace index of the bin
binIndex:: The index of the bin in the spectrum
weight:: 'How heavily' the bin is to be masked. =1 for full masking (the default).

Definition at line 1135 of file MatrixWorkspace.cpp.

References e(), flagMasked(), getNumberHistograms(), mutableE(), mutableY(), size(), and Mantid::Geometry::y.

Referenced by flagMasked().

◆ maskedBins()

const MatrixWorkspace::MaskList & Mantid::API::MatrixWorkspace::maskedBins ( const size_t &  workspaceIndex) const

Returns the list of masked bins for a spectrum.

Parameters
workspaceIndex
Returns
A const reference to the list of masked bins
Exceptions
Kernel::Exception::IndexErrorif there are no bins masked for this spectrum (so call hasMaskedBins first!)

Definition at line 1203 of file MatrixWorkspace.cpp.

References m_masks.

Referenced by Mantid::CurveFitting::Algorithms::SplineBackground::addWsDataToSpline(), Mantid::CurveFitting::Algorithms::SplineBackground::calculateNumBinsToProcess(), Mantid::Algorithms::WorkspaceJoiners::execWS2D(), maskedBinsIndices(), and setMaskedBins().

◆ maskedBinsIndices()

std::vector< size_t > Mantid::API::MatrixWorkspace::maskedBinsIndices ( const size_t &  workspaceIndex) const

Definition at line 1214 of file MatrixWorkspace.cpp.

References m_masks, and maskedBins().

◆ monitorWorkspace()

std::shared_ptr< MatrixWorkspace > Mantid::API::MatrixWorkspace::monitorWorkspace ( ) const

Returns a pointer to the internal monitor workspace.

Definition at line 1266 of file MatrixWorkspace.cpp.

References m_monitorWorkspace.

◆ mutableDx()

HistogramData::HistogramDx & Mantid::API::MatrixWorkspace::mutableDx ( const size_t  index) &
inline

Definition at line 213 of file MatrixWorkspace.h.

References index.

Referenced by Mantid::Algorithms::SortXAxis::copyXandDxToOutputWorkspace().

◆ mutableE()

HistogramData::HistogramE & Mantid::API::MatrixWorkspace::mutableE ( const size_t  index) &
inline

◆ mutableX()

HistogramData::HistogramX & Mantid::API::MatrixWorkspace::mutableX ( const size_t  index) &
inline

◆ mutableY()

HistogramData::HistogramY & Mantid::API::MatrixWorkspace::mutableY ( const size_t  index) &
inline

◆ numberOfAxis()

size_t Mantid::API::MatrixWorkspace::numberOfAxis ( ) const

Will return the number of Axis currently stored in the workspace it is not always safe to assume it is just 2.

Return the number of Axis stored by this workspace.

Returns
int

Definition at line 944 of file MatrixWorkspace.cpp.

References m_axes.

◆ operator=()

MatrixWorkspace & Mantid::API::MatrixWorkspace::operator= ( const MatrixWorkspace other)
delete

◆ points()

HistogramData::Points Mantid::API::MatrixWorkspace::points ( const size_t  index) const
inline

◆ pointStandardDeviations()

HistogramData::PointStandardDeviations Mantid::API::MatrixWorkspace::pointStandardDeviations ( const size_t  index) const
inline

Definition at line 163 of file MatrixWorkspace.h.

References index.

◆ readDx()

const MantidVec & Mantid::API::MatrixWorkspace::readDx ( size_t const  index) const
inline

Deprecated, use dx() instead.

Returns a read-only (i.e. const) reference to the specified X error array

Parameters
index:: workspace index to retrieve.

Definition at line 253 of file MatrixWorkspace.h.

References index.

Referenced by export_MatrixWorkspace().

◆ readE()

const MantidVec & Mantid::API::MatrixWorkspace::readE ( std::size_t const  index) const
inline

Deprecated, use e() instead.

Returns a read-only (i.e. const) reference to the specified E array

Parameters
index:: workspace index to retrieve.

Definition at line 249 of file MatrixWorkspace.h.

References index.

Referenced by export_MatrixWorkspace(), Mantid::API::MatrixWorkspaceMDIterator::getError(), and getImageE().

◆ readX()

const MantidVec & Mantid::API::MatrixWorkspace::readX ( std::size_t const  index) const
inline

Deprecated, use x() instead.

Returns a read-only (i.e. const) reference to the specified X array

Parameters
index:: workspace index to retrieve.

Definition at line 241 of file MatrixWorkspace.h.

References index.

Referenced by Mantid::API::MatrixWorkspaceMDIterator::calcWorkspacePos(), export_MatrixWorkspace(), and getIntegratedSpectra().

◆ readY()

const MantidVec & Mantid::API::MatrixWorkspace::readY ( std::size_t const  index) const
inline

Deprecated, use y() instead.

Returns a read-only (i.e. const) reference to the specified Y array

Parameters
index:: workspace index to retrieve.

Definition at line 245 of file MatrixWorkspace.h.

References index.

Referenced by Mantid::Algorithms::DetectorDiagnostic::calculateMedian(), Mantid::API::MatrixWorkspaceMDIterator::calcWorkspacePos(), export_MatrixWorkspace(), getImageY(), Mantid::DataObjects::GroupingWorkspace::makeDetectorIDToGroupMap(), and Mantid::API::MatrixWorkspaceMDIterator::MatrixWorkspaceMDIterator().

◆ rebuildDetectorIDGroupings()

void Mantid::API::MatrixWorkspace::rebuildDetectorIDGroupings ( )
private

◆ rebuildSpectraMapping()

void Mantid::API::MatrixWorkspace::rebuildSpectraMapping ( const bool  includeMonitors = true,
const specnum_t  specNumOffset = 1 
)

Build the default spectra mapping, most likely wanted after an instrument update.

Rebuild the default spectra mapping for a workspace.

If a non-empty instrument is set then the default maps each detector to a spectra with the same ID. If an empty instrument is set then a 1:1 map from 1->NHistograms is created.

Parameters
includeMonitors:: If false the monitors are not included
specNumOffset:: Constant offset from detector ID used to derive spectrum number

Definition at line 366 of file MatrixWorkspace.cpp.

References Mantid::API::ExperimentInfo::getInstrument(), getNumberHistograms(), getSpectrum(), index, and Mantid::API::ExperimentInfo::sptr_instrument.

Referenced by Mantid::DataObjects::SpecialWorkspace2D::SpecialWorkspace2D().

◆ refX()

virtual Kernel::cow_ptr< HistogramData::HistogramX > Mantid::API::MatrixWorkspace::refX ( const std::size_t  index) const
inlinevirtual

Deprecated, use sharedX() instead. Returns a pointer to the x data.

Reimplemented in Mantid::DataObjects::EventWorkspace.

Definition at line 278 of file MatrixWorkspace.h.

References index.

Referenced by getMemorySizeForXAxes().

◆ replaceAxis()

void Mantid::API::MatrixWorkspace::replaceAxis ( const std::size_t &  axisIndex,
std::unique_ptr< Axis newAxis 
)

Replaces one of the workspace's axes with the new one provided.

Parameters
axisIndex:: The index of the axis to replace
newAxis:: A Unique_ptr to the new axis. The class will take ownership.
Exceptions
IndexErrorIf the axisIndex given is outside the range of axes held by this workspace
std::runtime_errorIf the new axis is not of the correct length (within one of the old one)

Definition at line 891 of file MatrixWorkspace.cpp.

References m_axes.

Referenced by Mantid::DataObjects::createVerticalAxis(), and Mantid::DataObjects::createXAxis().

◆ setBinEdges()

template<typename... T>
void Mantid::API::MatrixWorkspace::setBinEdges ( const size_t  index,
T &&...  data 
) &
inline

Definition at line 166 of file MatrixWorkspace.h.

References index.

◆ setCounts()

template<typename... T>
void Mantid::API::MatrixWorkspace::setCounts ( const size_t  index,
T &&...  data 
) &
inline

Definition at line 190 of file MatrixWorkspace.h.

References index.

◆ setCountStandardDeviations()

template<typename... T>
void Mantid::API::MatrixWorkspace::setCountStandardDeviations ( const size_t  index,
T &&...  data 
) &
inline

Definition at line 196 of file MatrixWorkspace.h.

References index.

◆ setCountVariances()

template<typename... T>
void Mantid::API::MatrixWorkspace::setCountVariances ( const size_t  index,
T &&...  data 
) &
inline

Definition at line 193 of file MatrixWorkspace.h.

References index.

◆ setDistribution()

void Mantid::API::MatrixWorkspace::setDistribution ( bool  newValue)

Set the flag for whether the Y-values are dimensioned.

Returns
whether workspace is now a distribution

Definition at line 996 of file MatrixWorkspace.cpp.

References getNumberHistograms(), getSpectrum(), isDistribution(), and Mantid::API::ISpectrum::setYMode().

Referenced by export_MatrixWorkspace(), Mantid::API::WorkspaceFactoryImpl::initializeFromParent(), and Mantid::DataObjects::WorkspaceSingleValue::WorkspaceSingleValue().

◆ setFrequencies()

template<typename... T>
void Mantid::API::MatrixWorkspace::setFrequencies ( const size_t  index,
T &&...  data 
) &
inline

Definition at line 199 of file MatrixWorkspace.h.

References index.

◆ setFrequencyStandardDeviations()

template<typename... T>
void Mantid::API::MatrixWorkspace::setFrequencyStandardDeviations ( const size_t  index,
T &&...  data 
) &
inline

Definition at line 205 of file MatrixWorkspace.h.

References index.

◆ setFrequencyVariances()

template<typename... T>
void Mantid::API::MatrixWorkspace::setFrequencyVariances ( const size_t  index,
T &&...  data 
) &
inline

Definition at line 202 of file MatrixWorkspace.h.

References index.

◆ setHistogram()

template<typename... T>
void Mantid::API::MatrixWorkspace::setHistogram ( const size_t  index,
T &&...  data 
) &
inline

◆ setImage()

void Mantid::API::MatrixWorkspace::setImage ( MantidVec &(MatrixWorkspace::*)(const std::size_t)  dataVec,
const MantidImage image,
size_t  start,
bool  parallelExecution 
)
private

Copy data from an image.

Parameters
dataVec:: A method returning non-const references to data vectors to copy the image to.
image:: An image to copy the data from.
start:: Startinf workspace indx to copy data to.
parallelExecution:: Should inner loop run as parallel operation

Definition at line 2005 of file MatrixWorkspace.cpp.

References blocksize(), getNumberHistograms(), height, and PARALLEL_FOR_IF.

Referenced by setImageE(), and setImageY().

◆ setImageE()

void Mantid::API::MatrixWorkspace::setImageE ( const MantidImage image,
size_t  start = 0,
bool  parallelExecution = true 
)
virtual

Copy the data from an image to this workspace's errors.

Parameters
image:: An image to copy the data from.
start:: Startinf workspace indx to copy data to.
parallelExecution:: Should inner loop run as parallel operation

Reimplemented in Mantid::DataObjects::Workspace2D.

Definition at line 2055 of file MatrixWorkspace.cpp.

References dataE(), and setImage().

◆ setImageY()

void Mantid::API::MatrixWorkspace::setImageY ( const MantidImage image,
size_t  start = 0,
bool  parallelExecution = true 
)
virtual

Copy the data (Y's) from an image to this workspace.

Parameters
image:: An image to copy the data from.
start:: Startinf workspace indx to copy data to.
parallelExecution:: Should inner loop run as parallel operation

Reimplemented in Mantid::DataObjects::Workspace2D.

Definition at line 2045 of file MatrixWorkspace.cpp.

References dataY(), and setImage().

◆ setIndexInfo()

void Mantid::API::MatrixWorkspace::setIndexInfo ( const Indexing::IndexInfo &  indexInfo)

◆ setIndexInfoWithoutISpectrumUpdate()

void Mantid::API::MatrixWorkspace::setIndexInfoWithoutISpectrumUpdate ( const Indexing::IndexInfo &  indexInfo)
private

◆ setMaskedBins()

void Mantid::API::MatrixWorkspace::setMaskedBins ( const size_t  workspaceIndex,
const MaskList maskedBins 
)

Set the list of masked bins for given workspaceIndex.

Not thread safe.

No data is masked and previous masking for any bin for this workspace index is overridden, so this should only be used for copying flags into a new workspace, not for performing masking operations.

Definition at line 1236 of file MatrixWorkspace.cpp.

References m_masks, and maskedBins().

◆ setMDMasking()

void Mantid::API::MatrixWorkspace::setMDMasking ( std::unique_ptr< Mantid::Geometry::MDImplicitFunction maskingRegion)
overridevirtual

Apply masking.

Implements Mantid::API::IMDWorkspace.

Definition at line 1749 of file MatrixWorkspace.cpp.

◆ setMonitorWorkspace()

void Mantid::API::MatrixWorkspace::setMonitorWorkspace ( const std::shared_ptr< MatrixWorkspace > &  monitorWS)
virtual

Sets the internal monitor workspace to the provided workspace.

This method is intended for use by data-loading algorithms. Note that no checking is performed as to whether this workspace actually contains data pertaining to monitors, or that the spectra point to Detector objects marked as monitors. It simply has to be of the correct type to be accepted.

Parameters
monitorWSThe workspace containing the monitor data.

Definition at line 1256 of file MatrixWorkspace.cpp.

References m_monitorWorkspace.

◆ setPoints()

template<typename... T>
void Mantid::API::MatrixWorkspace::setPoints ( const size_t  index,
T &&...  data 
) &
inline

Definition at line 169 of file MatrixWorkspace.h.

References index.

◆ setPointStandardDeviations()

template<typename... T>
void Mantid::API::MatrixWorkspace::setPointStandardDeviations ( const size_t  index,
T &&...  data 
) &
inline

Definition at line 175 of file MatrixWorkspace.h.

References index.

◆ setPointVariances()

template<typename... T>
void Mantid::API::MatrixWorkspace::setPointVariances ( const size_t  index,
T &&...  data 
) &
inline

Definition at line 172 of file MatrixWorkspace.h.

References index.

◆ setSharedDx()

void Mantid::API::MatrixWorkspace::setSharedDx ( const size_t  index,
const Kernel::cow_ptr< HistogramData::HistogramDx > &  dx 
) &
inline

Definition at line 227 of file MatrixWorkspace.h.

References index.

◆ setSharedE()

void Mantid::API::MatrixWorkspace::setSharedE ( const size_t  index,
const Kernel::cow_ptr< HistogramData::HistogramE > &  e 
) &
inline

Definition at line 233 of file MatrixWorkspace.h.

References index.

◆ setSharedX()

void Mantid::API::MatrixWorkspace::setSharedX ( const size_t  index,
const Kernel::cow_ptr< HistogramData::HistogramX > &  x 
) &
inline

Definition at line 224 of file MatrixWorkspace.h.

References index, and Mantid::Geometry::x.

◆ setSharedY()

void Mantid::API::MatrixWorkspace::setSharedY ( const size_t  index,
const Kernel::cow_ptr< HistogramData::HistogramY > &  y 
) &
inline

Definition at line 230 of file MatrixWorkspace.h.

References index, and Mantid::Geometry::y.

◆ setTitle()

void Mantid::API::MatrixWorkspace::setTitle ( const std::string &  t)
overridevirtual

◆ setUnmaskedBins()

void Mantid::API::MatrixWorkspace::setUnmaskedBins ( const size_t  workspaceIndex)

Removes the mask from an index.

Not thread safe.

Parameters
workspaceIndexworkspace index to be unmasked

Definition at line 1245 of file MatrixWorkspace.cpp.

References m_masks.

◆ setX() [1/2]

virtual void Mantid::API::MatrixWorkspace::setX ( const std::size_t  index,
const Kernel::cow_ptr< HistogramData::HistogramX > &  X 
)
inlinevirtual

Deprecated, use setSharedX() instead.

Set the specified X array to point to the given existing array

Definition at line 284 of file MatrixWorkspace.h.

References index, and Mantid::Geometry::X.

Referenced by Mantid::DataObjects::createVerticalAxis().

◆ setX() [2/2]

virtual void Mantid::API::MatrixWorkspace::setX ( const std::size_t  index,
const std::shared_ptr< HistogramData::HistogramX > &  X 
)
inlinevirtual

Deprecated, use setSharedX() instead.

Set the specified X array to point to the given existing array

Definition at line 290 of file MatrixWorkspace.h.

References index, and Mantid::Geometry::X.

◆ setYUnit()

void Mantid::API::MatrixWorkspace::setYUnit ( const std::string &  newUnit)

Sets a new unit for the data (Y axis) in the workspace.

Definition at line 950 of file MatrixWorkspace.cpp.

References m_YUnit.

Referenced by export_MatrixWorkspace(), Mantid::API::WorkspaceFactoryImpl::initializeFromParent(), and Mantid::Algorithms::ConjoinWorkspaces::setYUnitAndLabel().

◆ setYUnitLabel()

void Mantid::API::MatrixWorkspace::setYUnitLabel ( const std::string &  newLabel)

Sets a new caption for the data (Y axis) in the workspace.

Definition at line 983 of file MatrixWorkspace.cpp.

References m_YUnitLabel.

Referenced by export_MatrixWorkspace(), Mantid::API::WorkspaceFactoryImpl::initializeFromParent(), and Mantid::Algorithms::ConjoinWorkspaces::setYUnitAndLabel().

◆ sharedDx()

Kernel::cow_ptr< HistogramData::HistogramDx > Mantid::API::MatrixWorkspace::sharedDx ( const size_t  index) const
inline

Definition at line 221 of file MatrixWorkspace.h.

References index.

◆ sharedE()

Kernel::cow_ptr< HistogramData::HistogramE > Mantid::API::MatrixWorkspace::sharedE ( const size_t  index) const
inline

Definition at line 220 of file MatrixWorkspace.h.

References index.

◆ sharedX()

Kernel::cow_ptr< HistogramData::HistogramX > Mantid::API::MatrixWorkspace::sharedX ( const size_t  index) const
inline

Definition at line 218 of file MatrixWorkspace.h.

References index.

◆ sharedY()

Kernel::cow_ptr< HistogramData::HistogramY > Mantid::API::MatrixWorkspace::sharedY ( const size_t  index) const
inline

Definition at line 219 of file MatrixWorkspace.h.

References index.

◆ size()

virtual std::size_t Mantid::API::MatrixWorkspace::size ( ) const
pure virtual

◆ toString() [1/3]

const std::string Mantid::API::ExperimentInfo::toString ( ) const
privatevirtual

Returns a string description of the object.

Returns
A human-readable description of the object

Reimplemented from Mantid::API::IMDWorkspace.

Definition at line 69 of file ExperimentInfo.cpp.

◆ toString() [2/3]

const std::string Mantid::API::IMDWorkspace::toString ( ) const
overridevirtual

Serializes the object to a string.

Reimplemented from Mantid::API::IMDWorkspace.

Definition at line 137 of file IMDWorkspace.cpp.

◆ toString() [3/3]

const std::string Mantid::API::MatrixWorkspace::toString ( ) const
overridevirtual

◆ updateCachedDetectorGrouping()

void Mantid::API::MatrixWorkspace::updateCachedDetectorGrouping ( const size_t  index) const
overrideprotectedvirtual

Update detector grouping for spectrum with given index.

This method is called when the detector grouping stored in SpectrumDefinition at index in Beamline::SpectrumInfo is not initialized or outdated. Detector IDs are currently stored in ISpectrum, but grouping information needs to be available and updated in Beamline::SpectrumInfo.

Reimplemented from Mantid::API::ExperimentInfo.

Definition at line 2073 of file MatrixWorkspace.cpp.

References getSpectrum(), index, and Mantid::API::ExperimentInfo::setDetectorGrouping().

◆ updateSpectraUsing()

void Mantid::API::MatrixWorkspace::updateSpectraUsing ( const SpectrumDetectorMapping map)
virtual

◆ x()

const HistogramData::HistogramX & Mantid::API::MatrixWorkspace::x ( const size_t  index) const
inline

◆ xIndexOfValue()

std::size_t Mantid::API::MatrixWorkspace::xIndexOfValue ( const Mantid::HistogramData::HistogramX &  xValues,
const double  xValue,
const double  tolerance 
) const
private

Returns the X index of the given X value.

Parameters
xValues:: The histogram to search
xValue:: The X value to search for
tolerance:: The tolerance to accept between the passed xValue and the stored value (default = 0.0)
Returns
The index of the X value

Definition at line 1404 of file MatrixWorkspace.cpp.

References tolerance, and value.

Referenced by yIndexOfX().

◆ y()

const HistogramData::HistogramY & Mantid::API::MatrixWorkspace::y ( const size_t  index) const
inline

◆ yIndexOfX()

std::size_t Mantid::API::MatrixWorkspace::yIndexOfX ( const double  xValue,
const std::size_t &  index = 0,
const double  tolerance = 0.0 
) const

Returns the y index which corresponds to the X Value provided.

Parameters
xValue:: The X value to search for
index:: The index within the workspace to search within (default = 0)
tolerance:: The tolerance to accept between the passed xValue and the stored value (default = 0.0). Used for point data only.
Returns
The index corresponding to the X value provided

Definition at line 1340 of file MatrixWorkspace.cpp.

References binIndexOfValue(), getNumberHistograms(), index, isHistogramDataByIndex(), tolerance, Mantid::Geometry::x, and xIndexOfValue().

Referenced by Mantid::Algorithms::MonteCarloAbsorption::doSimulation(), and export_MatrixWorkspace().

◆ YUnit()

std::string Mantid::API::MatrixWorkspace::YUnit ( ) const

Returns the units of the data in the workspace.

Definition at line 947 of file MatrixWorkspace.cpp.

References m_YUnit.

Referenced by export_MatrixWorkspace().

◆ YUnitLabel()

std::string Mantid::API::MatrixWorkspace::YUnitLabel ( bool  useLatex = false,
bool  plotAsDistribution = false 
) const

Returns a caption for the units of the data in the workspace.

Parameters
useLatex:: Return label using Latex syntax
plotAsDistribution:: If true, the Y-axis has been divided by bin width

Definition at line 958 of file MatrixWorkspace.cpp.

References isDistribution(), m_YUnit, and m_YUnitLabel.

Referenced by export_MatrixWorkspace(), and toString().

Friends And Related Function Documentation

◆ WorkspaceFactoryImpl

friend class WorkspaceFactoryImpl
friend

Definition at line 60 of file MatrixWorkspace.h.

Member Data Documentation

◆ m_axes

std::vector<std::unique_ptr<Axis> > Mantid::API::MatrixWorkspace::m_axes
protected

◆ m_indexInfo

std::unique_ptr<Indexing::IndexInfo> Mantid::API::MatrixWorkspace::m_indexInfo
private

◆ m_indexInfoMutex

std::mutex Mantid::API::MatrixWorkspace::m_indexInfoMutex
mutableprivate

Definition at line 512 of file MatrixWorkspace.h.

Referenced by indexInfo().

◆ m_indexInfoNeedsUpdate

std::atomic<bool> Mantid::API::MatrixWorkspace::m_indexInfoNeedsUpdate {true}
mutableprivate

◆ m_isCommonBinsFlag

bool Mantid::API::MatrixWorkspace::m_isCommonBinsFlag {false}
mutableprivate

Flag indicating whether the data has common bins.

Definition at line 500 of file MatrixWorkspace.h.

Referenced by isCommonBins().

◆ m_isCommonBinsFlagValid

std::atomic<bool> Mantid::API::MatrixWorkspace::m_isCommonBinsFlagValid {false}
mutableprivate

Flag indicating if the common bins flag is in a valid state.

Definition at line 498 of file MatrixWorkspace.h.

Referenced by isCommonBins(), and MatrixWorkspace().

◆ m_isCommonBinsMutex

std::mutex Mantid::API::MatrixWorkspace::m_isCommonBinsMutex
mutableprivate

A mutex protecting the update of m_isCommonBinsFlag.

Definition at line 502 of file MatrixWorkspace.h.

Referenced by isCommonBins().

◆ m_isInitialized

bool Mantid::API::MatrixWorkspace::m_isInitialized {false}
private

Has this workspace been initialised?

Definition at line 490 of file MatrixWorkspace.h.

Referenced by initialize(), Mantid::API::WorkspaceFactoryImpl::initializeFromParent(), and invalidateCachedSpectrumNumbers().

◆ m_masks

std::map<int64_t, MaskList> Mantid::API::MatrixWorkspace::m_masks
private

◆ m_monitorWorkspace

std::shared_ptr<MatrixWorkspace> Mantid::API::MatrixWorkspace::m_monitorWorkspace
private

A workspace holding monitor data relating to the main data in the containing workspace (null if none).

Definition at line 509 of file MatrixWorkspace.h.

Referenced by monitorWorkspace(), and setMonitorWorkspace().

◆ m_YUnit

std::string Mantid::API::MatrixWorkspace::m_YUnit
private

The unit for the data values (e.g. Counts)

Definition at line 493 of file MatrixWorkspace.h.

Referenced by Mantid::API::WorkspaceFactoryImpl::initializeFromParent(), setYUnit(), YUnit(), and YUnitLabel().

◆ m_YUnitLabel

std::string Mantid::API::MatrixWorkspace::m_YUnitLabel
private

A text label for use when plotting spectra.

Definition at line 495 of file MatrixWorkspace.h.

Referenced by Mantid::API::WorkspaceFactoryImpl::initializeFromParent(), setYUnitLabel(), and YUnitLabel().

◆ xDimensionId

const std::string Mantid::API::MatrixWorkspace::xDimensionId = "xDimension"
static

Dimension id for x-dimension.

Definition at line 382 of file MatrixWorkspace.h.

Referenced by getDimension(), and getDimensionIdFromAxis().

◆ yDimensionId

const std::string Mantid::API::MatrixWorkspace::yDimensionId = "yDimension"
static

Dimensin id for y-dimension.

Definition at line 384 of file MatrixWorkspace.h.

Referenced by getDimension(), and getDimensionIdFromAxis().


The documentation for this class was generated from the following files: