Mantid
|
Base MatrixWorkspace Abstract Class. More...
#include <MatrixWorkspace.h>
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... | |
MatrixWorkspace & | operator= (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< IMDWorkspace > | clone () const |
Returns a clone of the workspace. More... | |
std::unique_ptr< IMDWorkspace > | cloneEmpty () const |
Returns a default-initialized clone of the workspace. More... | |
std::unique_ptr< IMDIterator > | createIterator (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... | |
IMDWorkspace & | operator= (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 WorkspaceHistory & | getHistory () 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... | |
WorkspaceHistory & | history () |
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 |
Workspace & | operator= (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_t > | estimateResolution () const |
Mantid::Kernel::VMD & | getBasisVector (size_t index) |
Get the basis vector (in the original workspace) for a dimension of this workspace. More... | |
const Mantid::Kernel::VMD & | getBasisVector (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::IMDDimension > | getDimension (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::IMDDimension > | getDimensionWithId (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::VMD & | getOrigin () |
const Mantid::Kernel::VMD & | getOrigin () const |
std::shared_ptr< Workspace > | getOriginalWorkspace (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::IMDDimension > | getTDimension () 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::DblMatrix & | getWTransf () 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::IMDDimension > | getXDimension () const |
Get the x-dimension mapping. More... | |
std::shared_ptr< const Mantid::Geometry::IMDDimension > | getYDimension () const |
Get the y-dimension mapping. More... | |
std::shared_ptr< const Mantid::Geometry::IMDDimension > | getZDimension () 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 |
MDGeometry & | operator= (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 ExperimentInfo * | cloneExperimentInfo () const |
Clone us. More... | |
const Geometry::ComponentInfo & | componentInfo () const |
const Geometry::ParameterMap & | constInstrumentParameters () const |
Const version. More... | |
void | copyExperimentInfoFrom (const ExperimentInfo *other) |
Copy everything from the given experiment object. More... | |
const Geometry::DetectorInfo & | detectorInfo () 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 > ¶meterNames) 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::Property * | getLog (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::ParameterMap & | instrumentParameters () |
Returns a modifiable set of instrument parameters. More... | |
const Geometry::ParameterMap & | instrumentParameters () 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 ¶meterStr) |
Loads an experiment description from the open NeXus file. More... | |
void | loadExperimentInfoNexus (const std::string &nxFilename, ::NeXus::File *file, std::string ¶meterStr, 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 ¶meterStr) |
Load the instrument from an open NeXus file. More... | |
void | loadInstrumentParametersNexus (::NeXus::File *file, std::string ¶meterStr) |
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::ComponentInfo & | mutableComponentInfo () |
Geometry::DetectorInfo & | mutableDetectorInfo () |
Return a non-const reference to the DetectorInfo object. More... | |
Run & | mutableRun () |
Writable version of the run object. More... | |
Sample & | mutableSample () |
Writable version of the sample object. More... | |
SpectrumInfo & | mutableSpectrumInfo () |
Return a non-const reference to the SpectrumInfo object. More... | |
ExperimentInfo & | operator= (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 ¶meterStr) |
Populate the parameter map given a string. More... | |
const Run & | run () const |
Run details object access. More... | |
const Sample & | sample () 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< Run > | sharedRun () |
Return the cow ptr of the run. More... | |
const SpectrumInfo & | spectrumInfo () 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, MaskList > | m_masks |
The set of masked bins in a map keyed on workspace index. More... | |
std::shared_ptr< MatrixWorkspace > | m_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::IDetector > | getDetector (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_t > | getSpectraFromDetectorIDs (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 ISpectrum & | getSpectrum (const size_t index)=0 |
Return the underlying ISpectrum ptr at the given workspace index. More... | |
virtual const ISpectrum & | getSpectrum (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 MantidVec & | readX (std::size_t const index) const |
Deprecated, use x() instead. More... | |
const MantidVec & | readY (std::size_t const index) const |
Deprecated, use y() instead. More... | |
const MantidVec & | readE (std::size_t const index) const |
Deprecated, use e() instead. More... | |
const MantidVec & | readDx (size_t const index) const |
Deprecated, use dx() instead. More... | |
virtual MantidVec & | dataX (const std::size_t index) |
Deprecated, use mutableX() instead. Returns the x data. More... | |
virtual MantidVec & | dataY (const std::size_t index) |
Deprecated, use mutableY() instead. Returns the y data. More... | |
virtual MantidVec & | dataE (const std::size_t index) |
Deprecated, use mutableE() instead. Returns the error data. More... | |
virtual MantidVec & | dataDx (const std::size_t index) |
Deprecated, use mutableDx() instead. Returns the x error data. More... | |
virtual const MantidVec & | dataX (const std::size_t index) const |
Deprecated, use x() instead. Returns the x data const. More... | |
virtual const MantidVec & | dataY (const std::size_t index) const |
Deprecated, use y() instead. Returns the y data const. More... | |
virtual const MantidVec & | dataE (const std::size_t index) const |
Deprecated, use e() instead. Returns the error const. More... | |
virtual const MantidVec & | dataDx (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 Axis * | getAxis (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 MaskList & | maskedBins (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< MatrixWorkspace > | monitorWorkspace () 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::IMDDimension > | getDimension (size_t index) const override |
Get a dimension. More... | |
std::shared_ptr< const Mantid::Geometry::IMDDimension > | getDimensionWithId (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 ISpectrum & | getSpectrumWithoutInvalidation (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... | |
MatrixWorkspace * | doClone () const override=0 |
Virtual clone method. Not implemented to force implementation in children. More... | |
MatrixWorkspace * | doCloneEmpty () 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::VMD > | m_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< MDGeometryNotificationHelper > | m_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::ParameterMap > | m_parmap |
Parameters modifying the base instrument. More... | |
Geometry::Instrument_const_sptr | sptr_instrument |
The base (unparametrized) instrument. More... | |
Base MatrixWorkspace Abstract Class.
Definition at line 52 of file MatrixWorkspace.h.
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.
|
overridedefault |
Delete.
Destructor.
|
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.
|
protected |
Default constructor.
Definition at line 113 of file MatrixWorkspace.cpp.
int Mantid::API::MatrixWorkspace::axes | ( | ) | const |
Definition at line 866 of file MatrixWorkspace.cpp.
References m_axes.
Referenced by export_MatrixWorkspace(), getDimensionWithId(), getSignalAtCoord(), and toString().
|
inline |
Definition at line 161 of file MatrixWorkspace.h.
References index.
Referenced by Mantid::Algorithms::WorkspaceJoiners::execEvent(), and Mantid::Algorithms::SofQW::setUpOutputWorkspace().
|
private |
Returns the bin index of the given X value.
xValues | :: The histogram to search |
xValue | :: The X value to search for |
ascendingOrder | :: True if the order of the xValues is ascending |
Definition at line 1372 of file MatrixWorkspace.cpp.
Referenced by yIndexOfX().
|
pure virtual |
Returns the size of each block of data returned by the dataY accessors.
This throws an exception if the lengths are not identical across the spectra.
Implemented in Mantid::DataObjects::EventWorkspace, Mantid::DataObjects::Workspace2D, Mantid::DataObjects::WorkspaceSingleValue, AxeslessWorkspaceTester, and VariableBinThrowingTester.
Referenced by Mantid::Algorithms::MonteCarloAbsorption::doSimulation(), export_MatrixWorkspace(), getImage(), Mantid::MDAlgorithms::IntegrateFlux::getMaxNumberOfPoints(), Mantid::Algorithms::PolarizationEfficiencyCor::needInterpolation(), setImage(), and toString().
|
private |
Definition at line 2077 of file MatrixWorkspace.cpp.
References Mantid::API::ExperimentInfo::detectorInfo(), and m_indexInfo.
Referenced by setIndexInfo().
|
overridevirtual |
Clear exsting masking.
Implements Mantid::API::IMDWorkspace.
Definition at line 1756 of file MatrixWorkspace.cpp.
|
inline |
Returns a clone of the workspace.
Definition at line 71 of file MatrixWorkspace.h.
|
inline |
Returns a default-initialized clone of the workspace.
Definition at line 74 of file MatrixWorkspace.h.
|
inline |
Definition at line 159 of file MatrixWorkspace.h.
References index.
|
inline |
Definition at line 160 of file MatrixWorkspace.h.
References index.
|
inline |
Definition at line 178 of file MatrixWorkspace.h.
References index.
Referenced by Mantid::MDAlgorithms::IntegrateFlux::integrateSpectraHistograms().
|
inline |
Definition at line 180 of file MatrixWorkspace.h.
References index.
|
inline |
Definition at line 179 of file MatrixWorkspace.h.
References index.
|
overridevirtual |
Create iterators.
Create IMDIterators from this 2D workspace.
Partitions the iterators according to the number of cores.
suggestedNumCores | :: split the iterators into this many cores (if threadsafe) |
function | :: implicit function to limit range |
Implements Mantid::API::IMDWorkspace.
Definition at line 1618 of file MatrixWorkspace.cpp.
References getNumberHistograms(), and Mantid::API::Workspace::threadSafe().
|
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().
|
inlinevirtual |
Deprecated, use dx() instead. Returns the error const.
Reimplemented in Mantid::DataObjects::EventWorkspace.
Definition at line 271 of file MatrixWorkspace.h.
References index.
|
inlinevirtual |
Deprecated, use mutableE() instead. Returns the error data.
Reimplemented in Mantid::DataObjects::EventWorkspace.
Definition at line 260 of file MatrixWorkspace.h.
References index.
Referenced by Mantid::DataObjects::MaskWorkspace::clearMask(), Mantid::DataObjects::SpecialWorkspace2D::copyFrom(), export_MatrixWorkspace(), Mantid::DataObjects::RebinnedOutput::finalize(), setImageE(), Mantid::DataObjects::SpecialWorkspace2D::setValue(), and Mantid::DataObjects::RebinnedOutput::unfinalize().
|
inlinevirtual |
Deprecated, use e() instead. Returns the error const.
Reimplemented in Mantid::DataObjects::EventWorkspace.
Definition at line 269 of file MatrixWorkspace.h.
References 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().
|
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.
|
inlinevirtual |
Deprecated, use mutableY() instead. Returns the y data.
Reimplemented in Mantid::DataObjects::EventWorkspace.
Definition at line 258 of file MatrixWorkspace.h.
References index.
Referenced by Mantid::DataObjects::SpecialWorkspace2D::binaryAND(), Mantid::DataObjects::SpecialWorkspace2D::binaryNOT(), Mantid::DataObjects::SpecialWorkspace2D::binaryOR(), Mantid::DataObjects::SpecialWorkspace2D::binaryXOR(), VariableBinThrowingTester::blocksize(), Mantid::DataObjects::MaskWorkspace::clearMask(), Mantid::DataObjects::SpecialWorkspace2D::copyFrom(), export_MatrixWorkspace(), Mantid::DataObjects::RebinnedOutput::finalize(), Mantid::DataObjects::SpecialWorkspace2D::getValue(), Mantid::DataObjects::MaskWorkspace::isMaskedIndex(), setImageY(), Mantid::DataObjects::MaskWorkspace::setMaskedIndex(), Mantid::DataObjects::SpecialWorkspace2D::setValue(), and Mantid::DataObjects::RebinnedOutput::unfinalize().
|
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.
double Mantid::API::MatrixWorkspace::detectorSignedTwoTheta | ( | const Geometry::IDetector & | det | ) | const |
Returns the signed 2Theta scattering angle for a detector.
det | :: A pointer to the detector object (N.B. might be a DetectorGroup) |
InstrumentDefinitionError | if 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().
double Mantid::API::MatrixWorkspace::detectorTwoTheta | ( | const Geometry::IDetector & | det | ) | const |
Returns the 2Theta scattering angle for a detector.
det | :: A pointer to the detector object (N.B. might be a DetectorGroup) |
InstrumentDefinitionError | if 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().
|
overrideprivatepure virtual |
Virtual clone method. Not implemented to force implementation in children.
Implements Mantid::API::IMDWorkspace.
Implemented in Mantid::Algorithms::SparseWorkspace, Mantid::DataObjects::EventWorkspace, Mantid::DataObjects::GroupingWorkspace, Mantid::DataObjects::MaskWorkspace, Mantid::DataObjects::OffsetsWorkspace, Mantid::DataObjects::RebinnedOutput, Mantid::DataObjects::SpecialWorkspace2D, Mantid::DataObjects::Workspace2D, Mantid::DataObjects::WorkspaceSingleValue, AxeslessWorkspaceTester, WorkspaceTester, Mantid::API::HistoWorkspace, and Mantid::API::IEventWorkspace.
|
overrideprivatepure virtual |
Virtual cloneEmpty method.
Not implemented to force implementation in children.
Implements Mantid::API::IMDWorkspace.
Implemented in Mantid::DataObjects::EventWorkspace, Mantid::DataObjects::GroupingWorkspace, Mantid::DataObjects::MaskWorkspace, Mantid::DataObjects::OffsetsWorkspace, Mantid::DataObjects::RebinnedOutput, Mantid::DataObjects::SpecialWorkspace2D, Mantid::DataObjects::Workspace2D, Mantid::DataObjects::WorkspaceSingleValue, AxeslessWorkspaceTester, WorkspaceTester, Mantid::API::HistoWorkspace, and Mantid::API::IEventWorkspace.
|
inline |
Definition at line 211 of file MatrixWorkspace.h.
References index.
Referenced by Mantid::Algorithms::SortXAxis::copyXandDxToOutputWorkspace().
|
inline |
Definition at line 210 of file MatrixWorkspace.h.
References index.
Referenced by Mantid::CurveFitting::Algorithms::SplineBackground::addWsDataToSpline(), Mantid::Algorithms::SparseWorkspace::bilinearInterpolateFromDetectorGrid(), Mantid::Algorithms::SortXAxis::copyYandEToOutputWorkspace(), Mantid::Algorithms::SparseWorkspace::esq(), Mantid::Algorithms::SparseWorkspace::esqrt(), Mantid::DataObjects::Workspace2D::init(), maskBin(), Mantid::Algorithms::SparseWorkspace::SparseWorkspace(), and updateSpectraUsing().
|
virtual |
Find first index in Y equal to value.
value | Number to find in Y |
idx | starting indices for search |
Definition at line 1868 of file MatrixWorkspace.cpp.
References getNumberHistograms(), value, Mantid::Geometry::Y, and Mantid::Geometry::y.
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
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().
|
inline |
Definition at line 183 of file MatrixWorkspace.h.
References index.
|
inline |
Definition at line 187 of file MatrixWorkspace.h.
References index.
|
inline |
Definition at line 184 of file MatrixWorkspace.h.
References index.
|
pure virtual |
Generate the histogram or rebin the existing histogram.
Implemented in Mantid::DataObjects::EventWorkspace, Mantid::DataObjects::Workspace2D, Mantid::DataObjects::WorkspaceSingleValue, and Mantid::API::IEventWorkspace.
|
virtual |
Get a non owning pointer to a workspace axis.
axisIndex | :: The index of the axis required |
IndexError | If the argument given is outside the range of axes held by this workspace |
Definition at line 874 of file MatrixWorkspace.cpp.
References m_axes.
Referenced by Mantid::DataHandling::LoadMuonNexusV2::applyTimeAxisUnitCorrection(), Mantid::API::MatrixWorkspaceMDIterator::calcWorkspacePos(), Mantid::Algorithms::WorkspaceJoiners::checkCompatibility(), Mantid::Algorithms::CompareWorkspaces::compareEventWorkspaces(), export_MatrixWorkspace(), Mantid::Algorithms::AppendSpectra::fixSpectrumNumbers(), getDimension(), getDimensionWithId(), Mantid::API::MWXDimension::getName(), getSignalAtCoord(), Mantid::API::MWXDimension::getUnits(), Mantid::CurveFitting::Algorithms::getWorkspaceIndicesFromAxes(), Mantid::DataHandling::LoadNexusProcessed::readInstrumentGroup(), and toString().
Geometry::IDetector_const_sptr Mantid::API::MatrixWorkspace::getDetector | ( | const size_t | workspaceIndex | ) | const |
Get the effective detector for the given spectrum.
workspaceIndex | The workspace index for which the detector is required |
Kernel::Exception::NotFoundError | If 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().
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.
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. |
runtime_error | if there is more than one detector per spectrum (if throwIfMultipleDets is true) |
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().
|
virtual |
Return a vector where: The index into the vector = DetectorID (pixel ID) + offset The value at that index = the corresponding Workspace Index.
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. |
runtime_error | if there is more than one detector per spectrum (if throwIfMultipleDets is true) |
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.
|
overridevirtual |
Get a dimension.
index | :: which dimension |
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().
|
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().
|
overridevirtual |
Get a dimension.
id | :: string ID of the dimension |
Reimplemented from Mantid::API::MDGeometry.
Definition at line 1592 of file MatrixWorkspace.cpp.
References axes(), getAxis(), getDimensionIdFromAxis(), and Mantid::Kernel::DataItem::id().
|
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.
Exception::NotFoundError | if the log is not found; or if it is empty. |
invalid_argument | if 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().
|
private |
Create an MantidImage instance.
Creates a 2D image.
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().
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.
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().
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.
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().
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.
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().
size_t Mantid::API::MatrixWorkspace::getIndexFromSpectrumNumber | ( | const specnum_t | specNo | ) | const |
Given a spectrum number, find the corresponding workspace index.
specNo | :: spectrum number wanted |
runtime_error | if not found. |
Definition at line 603 of file MatrixWorkspace.cpp.
References getNumberHistograms(), getSpectrum(), and Mantid::API::ISpectrum::getSpectrumNo().
Referenced by export_MatrixWorkspace().
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).
detIdList | :: The list of detector IDs required |
Definition at line 622 of file MatrixWorkspace.cpp.
References Mantid::API::ISpectrum::getDetectorIDs(), getNumberHistograms(), getSpectrum(), and m_indexInfo.
Referenced by Mantid::Algorithms::CalculateEfficiency::maskComponent().
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.
spectraList | :: The list of spectrum numbers required |
Definition at line 579 of file MatrixWorkspace.cpp.
References getNumberHistograms(), getSpectrum(), and Mantid::API::ISpectrum::getSpectrumNo().
|
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!
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.
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.
runtime_error | if the log is not found; or if it is empty. |
invalid_argument | if 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().
|
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
start | :: coordinates of the start point of the line |
end | :: coordinates of the end point of the line |
normalize | :: how to normalize the signal |
Reimplemented from Mantid::API::IMDWorkspace.
Definition at line 1654 of file MatrixWorkspace.cpp.
References Mantid::API::IMDWorkspace::getLinePlot(), and Mantid::Kernel::normalize().
|
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().
|
overridevirtual |
Get the footprint in memory in bytes.
Return memory used by the workspace, in bytes.
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().
|
virtual |
Returns the memory used (in bytes) by the X axes, handling ragged bins.
Definition at line 1279 of file MatrixWorkspace.cpp.
References getNumberHistograms(), refX(), and Mantid::Geometry::X.
Referenced by Mantid::DataObjects::EventWorkspace::getMemorySize().
|
inlineoverridevirtual |
Get the number of points available on the workspace.
Implements Mantid::API::IMDWorkspace.
Definition at line 380 of file MatrixWorkspace.h.
|
overridevirtual |
Gets the number of points available on the workspace.
Implements Mantid::API::IMDWorkspace.
Definition at line 1416 of file MatrixWorkspace.cpp.
References size().
|
pure virtual |
Returns the number of bins for a given histogram index.
Implemented in Mantid::DataObjects::EventWorkspace, Mantid::DataObjects::Workspace2D, Mantid::DataObjects::WorkspaceSingleValue, and AxeslessWorkspaceTester.
Referenced by export_MatrixWorkspace().
|
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().
|
overridevirtual |
Reimplemented from Mantid::API::MDGeometry.
Reimplemented in Mantid::DataObjects::WorkspaceSingleValue.
Definition at line 1421 of file MatrixWorkspace.cpp.
|
overridevirtual |
Get the signal at a coordinate in the workspace.
Returns the (normalized) signal at a given coordinates.
coords | :: bare array, size 2, of coordinates. X, Y |
normalization | :: how to normalize the 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().
|
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.
coords | :: bare array, size 2, of coordinates. X, Y |
normalization | :: how to normalize the signal |
Implements Mantid::API::IMDWorkspace.
Definition at line 1740 of file MatrixWorkspace.cpp.
References getSignalAtCoord().
|
overridevirtual |
Implements Mantid::API::IMDWorkspace.
Reimplemented in AxeslessWorkspaceTester.
Definition at line 1763 of file MatrixWorkspace.cpp.
References Mantid::Kernel::None.
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!
detIdList | :: The list of detector IDs required |
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().
|
pure virtual |
Return the underlying ISpectrum ptr (const version) at the given workspace index.
Implemented in Mantid::DataObjects::EventWorkspace, Mantid::DataObjects::Workspace2D, AxeslessWorkspaceTester, Mantid::API::IEventWorkspace, and Mantid::DataObjects::WorkspaceSingleValue.
|
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().
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().
|
virtual |
Return a vector where: The index into the vector = spectrum number + offset The value at that index = the corresponding Workspace Index.
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.
|
protectedpure virtual |
|
overridevirtual |
Gets MatrixWorkspace title (same as Run object run_title property)
Get the workspace title.
Reimplemented from Mantid::API::Workspace.
Definition at line 332 of file MatrixWorkspace.cpp.
References Mantid::API::LogManager::getProperty(), Mantid::API::Workspace::getTitle(), Mantid::API::ExperimentInfo::run(), and Mantid::Kernel::Property::value().
Referenced by Mantid::API::WorkspaceFactoryImpl::initializeFromParent(), toString(), and Mantid::DataObjects::SpecialWorkspace2D::toString().
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.
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().
|
virtual |
Definition at line 684 of file MatrixWorkspace.cpp.
References getXMinMax().
Referenced by Mantid::MDAlgorithms::IntegrateFlux::createOutputWorkspace().
|
virtual |
Definition at line 677 of file MatrixWorkspace.cpp.
References getXMinMax().
Referenced by Mantid::MDAlgorithms::IntegrateFlux::createOutputWorkspace().
|
virtual |
Definition at line 691 of file MatrixWorkspace.cpp.
References dataX(), getNumberHistograms(), m_indexInfo, and Mantid::Geometry::x.
Referenced by getXMax(), getXMin(), Mantid::Algorithms::Rebin::rebinParamsFromInput(), and Mantid::Algorithms::SofQW::setUpOutputWorkspace().
bool Mantid::API::MatrixWorkspace::hasAnyMaskedBins | ( | ) | const |
Does this workspace contain any masked bins.
Definition at line 1195 of file MatrixWorkspace.cpp.
References m_masks.
Referenced by export_MatrixWorkspace().
|
inlinevirtual |
Probes if DX (X Error) values were set on a particular spectrum.
index | the workspace index |
Definition at line 298 of file MatrixWorkspace.h.
References index.
Referenced by Mantid::Algorithms::SortXAxis::copyXandDxToOutputWorkspace(), and export_MatrixWorkspace().
bool Mantid::API::MatrixWorkspace::hasGroupedDetectors | ( | ) | const |
Does the workspace has any grouped detectors?
Definition at line 461 of file MatrixWorkspace.cpp.
References Mantid::API::ISpectrum::getDetectorIDs(), getNumberHistograms(), and getSpectrum().
bool Mantid::API::MatrixWorkspace::hasMaskedBins | ( | const size_t & | workspaceIndex | ) | const |
Does this spectrum contain any masked bins.
workspaceIndex | :: The workspace index to test |
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().
|
overridevirtual |
Implements Mantid::API::IMDWorkspace.
Definition at line 1768 of file MatrixWorkspace.cpp.
References Mantid::API::Sample::hasOrientedLattice(), and Mantid::API::ExperimentInfo::sample().
|
inline |
Returns the Histogram at the given workspace index.
Definition at line 155 of file MatrixWorkspace.h.
References index.
Referenced by Mantid::Algorithms::SparseWorkspace::bilinearInterpolateFromDetectorGrid(), Mantid::Algorithms::MonteCarloAbsorption::doSimulation(), Mantid::Algorithms::SparseWorkspace::extremeWavelengths(), Mantid::DataObjects::EventWorkspace::init(), Mantid::DataObjects::RebinnedOutput::init(), Mantid::DataObjects::SpecialWorkspace2D::init(), Mantid::DataObjects::Workspace2D::init(), Mantid::DataObjects::WorkspaceSingleValue::init(), AxeslessWorkspaceTester::init(), WorkspaceTester::init(), initialize(), Mantid::Algorithms::SparseWorkspace::interpolateFromDetectorGrid(), Mantid::Algorithms::DiscusMultipleScatteringCorrection::interpolateFromSparse(), Mantid::Algorithms::MonteCarloAbsorption::interpolateFromSparse(), isHistogramDataByIndex(), Mantid::DataObjects::Workspace2D::isRaggedWorkspace(), and Mantid::Algorithms::DirectILLTubeBackground::peakExcludingAverage().
const Indexing::IndexInfo & Mantid::API::MatrixWorkspace::indexInfo | ( | ) | const |
Returns a const reference to the IndexInfo object of the workspace.
Used for access to spectrum number and detector ID information of spectra. Writing spectrum number or detector ID groupings of any spectrum in the workspace will invalidate this reference.
Definition at line 138 of file MatrixWorkspace.cpp.
References getNumberHistograms(), getSpectrum(), Mantid::API::ISpectrum::getSpectrumNo(), m_indexInfo, m_indexInfoMutex, m_indexInfoNeedsUpdate, and Mantid::API::ExperimentInfo::spectrumInfo().
Referenced by Mantid::DataHandling::bankOffsetsSpectrumNumbers(), Mantid::DataObjects::ScanningWorkspaceBuilder::createDetectorOrientedIndexInfo(), Mantid::DataObjects::ScanningWorkspaceBuilder::createTimeOrientedIndexInfo(), Mantid::DataObjects::detail::doInitializeFromParent< std::true_type >(), Mantid::Algorithms::AppendSpectra::fixSpectrumNumbers(), initialize(), Mantid::API::WorkspaceFactoryImpl::initializeFromParent(), Mantid::DataHandling::ParallelEventLoader::loadMPI(), setIndexInfo(), and setIndexInfoWithoutISpectrumUpdate().
|
protectedpure virtual |
|
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().
void Mantid::API::MatrixWorkspace::initialize | ( | const Indexing::IndexInfo & | indexInfo, |
const HistogramData::Histogram & | histogram | ||
) |
Definition at line 294 of file MatrixWorkspace.cpp.
References histogram(), indexInfo(), init(), m_isInitialized, setIndexInfo(), Mantid::API::ExperimentInfo::setNumberOfDetectorGroups(), and Mantid::API::Workspace::setStorageMode().
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().
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.
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().
void Mantid::API::MatrixWorkspace::invalidateCachedSpectrumNumbers | ( | ) |
Definition at line 2059 of file MatrixWorkspace.cpp.
References m_indexInfo, m_indexInfoNeedsUpdate, m_isInitialized, and Mantid::API::Workspace::storageMode().
Referenced by Mantid::API::ISpectrum::invalidateCachedSpectrumNumbers().
|
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().
|
virtual |
Returns true if the workspace contains common X bins.
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().
|
virtual |
Returns true if the workspace contains common X bins with log spacing.
Whether the workspace contains common X bins with logarithmic spacing.
Definition at line 904 of file MatrixWorkspace.cpp.
References EPSILON(), getNumberHistograms(), isCommonBins(), and Mantid::Geometry::x.
Referenced by export_MatrixWorkspace().
bool Mantid::API::MatrixWorkspace::isDistribution | ( | ) | const |
Are the Y-values dimensioned?
Are the Y-values in this workspace dimensioned? TODO: For example: ????
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().
|
virtual |
Returns true if the workspace contains data in histogram form (as opposed to point-like)
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().
|
privatevirtual |
Whether the specified histogram contains histogram data (ie bins)
index | :: Index of the histogram to be checked |
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().
|
virtual |
Returns true if the workspace has common, integer X bins.
Whether the workspace's bins are integers - and common.
Definition at line 1108 of file MatrixWorkspace.cpp.
References isCommonBins(), and Mantid::Geometry::x.
|
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().
void Mantid::API::MatrixWorkspace::loadInstrumentNexus | ( | ::NeXus::File * | file | ) |
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
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().
const MatrixWorkspace::MaskList & Mantid::API::MatrixWorkspace::maskedBins | ( | const size_t & | workspaceIndex | ) | const |
Returns the list of masked bins for a spectrum.
workspaceIndex |
Kernel::Exception::IndexError | if 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().
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().
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.
|
inline |
Definition at line 213 of file MatrixWorkspace.h.
References index.
Referenced by Mantid::Algorithms::SortXAxis::copyXandDxToOutputWorkspace().
|
inline |
Definition at line 217 of file MatrixWorkspace.h.
References index.
Referenced by Mantid::Algorithms::SortXAxis::copyYandEToOutputWorkspace(), Mantid::Algorithms::MonteCarloAbsorption::doSimulation(), Mantid::Algorithms::SolidAngle::initSpectrum(), Mantid::Algorithms::SofQWCentre::makeDistribution(), maskBin(), Mantid::DataObjects::FractionalRebinning::rebinToFractionalOutput(), and Mantid::DataObjects::FractionalRebinning::rebinToOutput().
|
inline |
Definition at line 212 of file MatrixWorkspace.h.
References index.
Referenced by Mantid::DataHandling::SinglePeriodLoadMuonStrategy::applyTimeZeroCorrection(), Mantid::Algorithms::SortXAxis::copyXandDxToOutputWorkspace(), Mantid::DataObjects::detail::initializeFromParent(), and Mantid::Algorithms::SolidAngle::initSpectrum().
|
inline |
Definition at line 216 of file MatrixWorkspace.h.
References index.
Referenced by Mantid::CurveFitting::Algorithms::SplineSmoothing::calculateDerivatives(), Mantid::CurveFitting::Algorithms::SplineSmoothing::calculateSmoothing(), Mantid::Algorithms::SortXAxis::copyYandEToOutputWorkspace(), Mantid::Algorithms::SolidAngle::initSpectrum(), Mantid::MDAlgorithms::IntegrateFlux::integrateSpectraEvents(), Mantid::MDAlgorithms::IntegrateFlux::integrateSpectraHistograms(), Mantid::MDAlgorithms::IntegrateFlux::integrateSpectraPointData(), Mantid::Algorithms::DiscusMultipleScatteringCorrection::interpolateFromSparse(), Mantid::Algorithms::MonteCarloAbsorption::interpolateFromSparse(), Mantid::Algorithms::SofQWCentre::makeDistribution(), maskBin(), Mantid::DataObjects::FractionalRebinning::rebinToFractionalOutput(), and Mantid::DataObjects::FractionalRebinning::rebinToOutput().
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.
Definition at line 944 of file MatrixWorkspace.cpp.
References m_axes.
|
delete |
|
inline |
Definition at line 162 of file MatrixWorkspace.h.
References index.
Referenced by Mantid::CurveFitting::Algorithms::SplineBackground::addWsDataToSpline(), Mantid::Algorithms::MonteCarloAbsorption::doSimulation(), Mantid::Algorithms::DiscusMultipleScatteringCorrection::exec(), and Mantid::Algorithms::DiscusMultipleScatteringCorrection::getXMinMax().
|
inline |
Definition at line 163 of file MatrixWorkspace.h.
References index.
|
inline |
Deprecated, use dx() instead.
Returns a read-only (i.e. const) reference to the specified X error array
index | :: workspace index to retrieve. |
Definition at line 253 of file MatrixWorkspace.h.
References index.
Referenced by export_MatrixWorkspace().
|
inline |
Deprecated, use e() instead.
Returns a read-only (i.e. const) reference to the specified E array
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().
|
inline |
Deprecated, use x() instead.
Returns a read-only (i.e. const) reference to the specified X array
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().
|
inline |
Deprecated, use y() instead.
Returns a read-only (i.e. const) reference to the specified Y array
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().
|
private |
Definition at line 2108 of file MatrixWorkspace.cpp.
References Mantid::API::ExperimentInfo::detectorInfo(), getSpectrum(), index, m_indexInfo, Mantid::Kernel::None, and size().
Referenced by setIndexInfo().
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.
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().
|
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().
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.
axisIndex | :: The index of the axis to replace |
newAxis | :: A Unique_ptr to the new axis. The class will take ownership. |
IndexError | If the axisIndex given is outside the range of axes held by this workspace |
std::runtime_error | If 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().
|
inline |
Definition at line 166 of file MatrixWorkspace.h.
References index.
|
inline |
Definition at line 190 of file MatrixWorkspace.h.
References index.
|
inline |
Definition at line 196 of file MatrixWorkspace.h.
References index.
|
inline |
Definition at line 193 of file MatrixWorkspace.h.
References index.
void Mantid::API::MatrixWorkspace::setDistribution | ( | bool | newValue | ) |
Set the flag for whether the Y-values are dimensioned.
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().
|
inline |
Definition at line 199 of file MatrixWorkspace.h.
References index.
|
inline |
Definition at line 205 of file MatrixWorkspace.h.
References index.
|
inline |
Definition at line 202 of file MatrixWorkspace.h.
References index.
|
inline |
Definition at line 156 of file MatrixWorkspace.h.
References index.
Referenced by Mantid::Algorithms::DiscusMultipleScatteringCorrection::interpolateFromSparse(), and Mantid::Algorithms::MonteCarloAbsorption::interpolateFromSparse().
|
private |
Copy data from an image.
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().
|
virtual |
Copy the data from an image to this workspace's errors.
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().
|
virtual |
Copy the data (Y's) from an image to this workspace.
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().
void Mantid::API::MatrixWorkspace::setIndexInfo | ( | const Indexing::IndexInfo & | indexInfo | ) |
Sets the IndexInfo object of the workspace.
Used for setting spectrum number and detector ID information of spectra
Definition at line 161 of file MatrixWorkspace.cpp.
References buildDefaultSpectrumDefinitions(), getNumberHistograms(), indexInfo(), m_indexInfo, m_indexInfoNeedsUpdate, rebuildDetectorIDGroupings(), Mantid::API::ExperimentInfo::setSpectrumDefinitions(), and Mantid::API::Workspace::storageMode().
Referenced by Mantid::DataObjects::ScanningWorkspaceBuilder::createDetectorOrientedIndexInfo(), Mantid::DataObjects::ScanningWorkspaceBuilder::createTimeOrientedIndexInfo(), Mantid::DataObjects::detail::doInitializeFromParent< std::true_type >(), Mantid::Algorithms::AppendSpectra::fixSpectrumNumbers(), and initialize().
|
private |
Variant of setIndexInfo, used by WorkspaceFactoryImpl.
Definition at line 198 of file MatrixWorkspace.cpp.
References getNumberHistograms(), indexInfo(), m_indexInfo, m_indexInfoNeedsUpdate, Mantid::API::ExperimentInfo::setSpectrumDefinitions(), and Mantid::API::Workspace::setStorageMode().
Referenced by Mantid::API::WorkspaceFactoryImpl::initializeFromParent().
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().
|
overridevirtual |
Apply masking.
Implements Mantid::API::IMDWorkspace.
Definition at line 1749 of file MatrixWorkspace.cpp.
|
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.
monitorWS | The workspace containing the monitor data. |
Definition at line 1256 of file MatrixWorkspace.cpp.
References m_monitorWorkspace.
|
inline |
Definition at line 169 of file MatrixWorkspace.h.
References index.
|
inline |
Definition at line 175 of file MatrixWorkspace.h.
References index.
|
inline |
Definition at line 172 of file MatrixWorkspace.h.
References index.
|
inline |
Definition at line 227 of file MatrixWorkspace.h.
References index.
|
inline |
Definition at line 233 of file MatrixWorkspace.h.
References index.
|
inline |
Definition at line 224 of file MatrixWorkspace.h.
References index, and Mantid::Geometry::x.
|
inline |
Definition at line 230 of file MatrixWorkspace.h.
References index, and Mantid::Geometry::y.
|
overridevirtual |
Sets MatrixWorkspace title.
Set the title of the workspace.
t | :: The title |
Reimplemented from Mantid::API::Workspace.
Definition at line 318 of file MatrixWorkspace.cpp.
References Mantid::API::LogManager::addProperty(), Mantid::API::ExperimentInfo::mutableRun(), Mantid::API::ExperimentInfo::run(), and Mantid::API::Workspace::setTitle().
Referenced by Mantid::API::WorkspaceFactoryImpl::initializeFromParent().
void Mantid::API::MatrixWorkspace::setUnmaskedBins | ( | const size_t | workspaceIndex | ) |
Removes the mask from an index.
Not thread safe.
workspaceIndex | workspace index to be unmasked |
Definition at line 1245 of file MatrixWorkspace.cpp.
References m_masks.
|
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().
|
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.
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().
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().
|
inline |
Definition at line 221 of file MatrixWorkspace.h.
References index.
|
inline |
Definition at line 220 of file MatrixWorkspace.h.
References index.
|
inline |
Definition at line 218 of file MatrixWorkspace.h.
References index.
|
inline |
Definition at line 219 of file MatrixWorkspace.h.
References index.
|
pure virtual |
Returns the number of single indexable items in the workspace.
Implemented in Mantid::DataObjects::EventWorkspace, Mantid::DataObjects::Workspace2D, Mantid::DataObjects::WorkspaceSingleValue, and AxeslessWorkspaceTester.
Referenced by MantidQt::MantidWidgets::LogValueFinder::getLogNames(), getMemorySize(), getNPoints(), isCommonBins(), maskBin(), Mantid::API::WorkspaceHelpers::matchingBins(), and rebuildDetectorIDGroupings().
|
privatevirtual |
Returns a string description of the object.
Reimplemented from Mantid::API::IMDWorkspace.
Definition at line 69 of file ExperimentInfo.cpp.
|
overridevirtual |
Serializes the object to a string.
Reimplemented from Mantid::API::IMDWorkspace.
Definition at line 137 of file IMDWorkspace.cpp.
|
overridevirtual |
String description of state.
Reimplemented from Mantid::API::IMDWorkspace.
Reimplemented in Mantid::DataObjects::MaskWorkspace, and Mantid::DataObjects::SpecialWorkspace2D.
Definition at line 215 of file MatrixWorkspace.cpp.
References axes(), blocksize(), getAxis(), getNumberHistograms(), getTitle(), Mantid::Kernel::DataItem::id(), isDistribution(), isHistogramData(), Mantid::API::ExperimentInfo::toString(), Mantid::API::Axis::unit(), and YUnitLabel().
|
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().
|
virtual |
Definition at line 340 of file MatrixWorkspace.cpp.
References Mantid::Kernel::Logger::debug(), e(), Mantid::API::g_log, Mantid::API::SpectrumDetectorMapping::getDetectorIDsForSpectrumIndex(), Mantid::API::SpectrumDetectorMapping::getDetectorIDsForSpectrumNo(), getNumberHistograms(), getSpectrum(), and Mantid::API::SpectrumDetectorMapping::indexIsSpecNumber().
|
inline |
Definition at line 208 of file MatrixWorkspace.h.
References index.
Referenced by Mantid::MDAlgorithms::MDNorm::calcIntegralsForIntersections(), Mantid::MDAlgorithms::MDNormSCD::calcIntegralsForIntersections(), Mantid::CurveFitting::Algorithms::SplineSmoothing::calculateDerivatives(), Mantid::CurveFitting::Algorithms::SplineSmoothing::calculateSmoothing(), Mantid::Algorithms::SortXAxis::copyXandDxToOutputWorkspace(), Mantid::Algorithms::SortXAxis::determineIfHistogramIsValid(), Mantid::Algorithms::WorkspaceJoiners::execWS2D(), Mantid::DataObjects::detail::initializeFromParent(), Mantid::Algorithms::SolidAngle::initSpectrum(), Mantid::MDAlgorithms::IntegrateFlux::integrateSpectraEvents(), Mantid::MDAlgorithms::IntegrateFlux::integrateSpectraHistograms(), Mantid::MDAlgorithms::IntegrateFlux::integrateSpectraPointData(), Mantid::Algorithms::isItSorted(), Mantid::API::RefAxis::length(), Mantid::API::WorkspaceHelpers::matchingBins(), Mantid::Algorithms::PolarizationEfficiencyCor::needInterpolation(), Mantid::API::RefAxis::operator()(), Mantid::DataObjects::FractionalRebinning::rebinToFractionalOutput(), Mantid::DataObjects::FractionalRebinning::rebinToOutput(), Mantid::CurveFitting::Algorithms::SplineSmoothing::selectSmoothingPoints(), and Mantid::API::WorkspaceHelpers::sharedXData().
|
private |
Returns the X index of the given X value.
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) |
Definition at line 1404 of file MatrixWorkspace.cpp.
References tolerance, and value.
Referenced by yIndexOfX().
|
inline |
Definition at line 209 of file MatrixWorkspace.h.
References index.
Referenced by Mantid::CurveFitting::Algorithms::SplineBackground::addWsDataToSpline(), Mantid::MDAlgorithms::MDNorm::calcIntegralsForIntersections(), Mantid::MDAlgorithms::MDNormSCD::calcIntegralsForIntersections(), Mantid::CurveFitting::Algorithms::SplineBackground::calculateNumBinsToProcess(), Mantid::Algorithms::SortXAxis::copyYandEToOutputWorkspace(), Mantid::Algorithms::SortXAxis::determineIfHistogramIsValid(), Mantid::Algorithms::WorkspaceJoiners::execWS2D(), Mantid::DataObjects::detail::initializeFromParent(), Mantid::MDAlgorithms::IntegrateFlux::integrateSpectraPointData(), and Mantid::CurveFitting::Algorithms::SplineSmoothing::selectSmoothingPoints().
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.
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. |
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().
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().
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.
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().
|
friend |
Definition at line 60 of file MatrixWorkspace.h.
|
protected |
A vector of pointers to the axes for this workspace.
Definition at line 463 of file MatrixWorkspace.h.
Referenced by axes(), getAxis(), getSpectrumToWorkspaceIndexMap(), getSpectrumToWorkspaceIndexVector(), WorkspaceTester::init(), Mantid::DataObjects::EventWorkspace::init(), Mantid::DataObjects::Workspace2D::init(), Mantid::API::WorkspaceFactoryImpl::initializeFromParent(), MatrixWorkspace(), numberOfAxis(), and replaceAxis().
|
private |
Definition at line 487 of file MatrixWorkspace.h.
Referenced by buildDefaultSpectrumDefinitions(), getIndicesFromDetectorIDs(), getXMinMax(), indexInfo(), initialize(), invalidateCachedSpectrumNumbers(), rebuildDetectorIDGroupings(), setIndexInfo(), and setIndexInfoWithoutISpectrumUpdate().
|
mutableprivate |
Definition at line 512 of file MatrixWorkspace.h.
Referenced by indexInfo().
|
mutableprivate |
Definition at line 511 of file MatrixWorkspace.h.
Referenced by indexInfo(), invalidateCachedSpectrumNumbers(), setIndexInfo(), and setIndexInfoWithoutISpectrumUpdate().
|
mutableprivate |
Flag indicating whether the data has common bins.
Definition at line 500 of file MatrixWorkspace.h.
Referenced by isCommonBins().
|
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().
|
mutableprivate |
A mutex protecting the update of m_isCommonBinsFlag.
Definition at line 502 of file MatrixWorkspace.h.
Referenced by isCommonBins().
|
private |
Has this workspace been initialised?
Definition at line 490 of file MatrixWorkspace.h.
Referenced by initialize(), Mantid::API::WorkspaceFactoryImpl::initializeFromParent(), and invalidateCachedSpectrumNumbers().
|
private |
The set of masked bins in a map keyed on workspace index.
Definition at line 505 of file MatrixWorkspace.h.
Referenced by flagMasked(), hasAnyMaskedBins(), hasMaskedBins(), Mantid::API::WorkspaceFactoryImpl::initializeFromParent(), maskedBins(), maskedBinsIndices(), setMaskedBins(), and setUnmaskedBins().
|
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().
|
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().
|
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().
|
static |
Dimension id for x-dimension.
Definition at line 382 of file MatrixWorkspace.h.
Referenced by getDimension(), and getDimensionIdFromAxis().
|
static |
Dimensin id for y-dimension.
Definition at line 384 of file MatrixWorkspace.h.
Referenced by getDimension(), and getDimensionIdFromAxis().