Mantid
|
Basic MD Workspace Abstract Class. More...
#include <IMDWorkspace.h>
Classes | |
struct | LinePlot |
Holds X, Y, E for a line plot. More... | |
Public Member Functions | |
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... | |
Protected Member Functions | |
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... | |
Private Member Functions | |
IMDWorkspace * | doClone () const override=0 |
Virtual clone method. Not implemented to force implementation in children. More... | |
IMDWorkspace * | doCloneEmpty () const override=0 |
Virtual cloneEmpty method. More... | |
Private Attributes | |
std::string | m_convention |
Additional Inherited Members | |
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... | |
Basic MD Workspace Abstract Class.
This defines the interface that allows one to iterate through several types of workspaces:
- The regularly gridded MDHistoWorkspace - The recursively binned MDEventWorkspace - The regular (2D) MatrixWorkspace.
Definition at line 40 of file IMDWorkspace.h.
Mantid::API::IMDWorkspace::IMDWorkspace | ( | const Parallel::StorageMode | storageMode = Parallel::StorageMode::Cloned | ) |
Default constructor.
Definition at line 22 of file IMDWorkspace.cpp.
|
protecteddefault |
Protected copy constructor. May be used by childs for cloning.
std::string Mantid::API::IMDWorkspace::changeQConvention | ( | ) |
Definition at line 57 of file IMDWorkspace.cpp.
References getConvention(), and m_convention.
|
inlinevirtual |
if a workspace was filebacked, this should clear file-based status, delete file-based information and close related files.
Reimplemented in Mantid::DataObjects::MDEventWorkspace.
Definition at line 112 of file IMDWorkspace.h.
|
pure virtual |
Clear existing masks.
Implemented in Mantid::API::MatrixWorkspace, Mantid::DataObjects::MDEventWorkspace, Mantid::DataObjects::MDHistoWorkspace, and MDHistoWorkspaceTester.
|
inline |
Returns a clone of the workspace.
Definition at line 55 of file IMDWorkspace.h.
|
inline |
Returns a default-initialized clone of the workspace.
Definition at line 58 of file IMDWorkspace.h.
std::unique_ptr< IMDIterator > Mantid::API::IMDWorkspace::createIterator | ( | Mantid::Geometry::MDImplicitFunction * | function = nullptr | ) | const |
Creates a single iterator and returns it.
This calls createIterators(), a pure virtual method on IMDWorkspace which has custom implementations for other workspaces.
function | :: Implicit function limiting space to look at |
Definition at line 34 of file IMDWorkspace.cpp.
References createIterators().
Referenced by Mantid::MDAlgorithms::FitMD::createEventOutputWorkspace().
|
pure virtual |
Creates a new iterator pointing to the first cell in the workspace.
Implemented in Mantid::API::MatrixWorkspace, Mantid::DataObjects::MDEventWorkspace, Mantid::DataObjects::MDHistoWorkspace, and MDHistoWorkspaceTester.
Referenced by createIterator().
|
virtual |
Reimplemented in Mantid::DataObjects::MDEventWorkspace, Mantid::DataObjects::MDHistoWorkspace, and Mantid::API::IMDEventWorkspace.
Definition at line 176 of file IMDWorkspace.cpp.
References Mantid::API::NoNormalization.
Referenced by export_IMDWorkspace().
|
virtual |
Reimplemented in Mantid::DataObjects::MDEventWorkspace, Mantid::DataObjects::MDHistoWorkspace, and Mantid::API::IMDEventWorkspace.
Definition at line 182 of file IMDWorkspace.cpp.
References Mantid::API::NoNormalization.
Referenced by export_IMDWorkspace().
|
overrideprivatepure virtual |
Virtual clone method. Not implemented to force implementation in children.
Implements Mantid::API::Workspace.
Implemented in Mantid::Algorithms::SparseWorkspace, Mantid::DataObjects::EventWorkspace, Mantid::DataObjects::GroupingWorkspace, Mantid::DataObjects::MaskWorkspace, Mantid::DataObjects::MDEventWorkspace, Mantid::DataObjects::MDHistoWorkspace, Mantid::DataObjects::OffsetsWorkspace, Mantid::DataObjects::RebinnedOutput, Mantid::DataObjects::SpecialWorkspace2D, Mantid::DataObjects::Workspace2D, Mantid::DataObjects::WorkspaceSingleValue, AxeslessWorkspaceTester, WorkspaceTester, MDHistoWorkspaceTester, Mantid::API::HistoWorkspace, Mantid::API::IEventWorkspace, Mantid::API::IMDEventWorkspace, Mantid::API::IMDHistoWorkspace, and Mantid::API::MatrixWorkspace.
|
overrideprivatepure virtual |
Virtual cloneEmpty method.
Not implemented to force implementation in children.
Implements Mantid::API::Workspace.
Implemented in Mantid::DataObjects::EventWorkspace, Mantid::DataObjects::GroupingWorkspace, Mantid::DataObjects::MaskWorkspace, Mantid::DataObjects::MDEventWorkspace, Mantid::DataObjects::MDHistoWorkspace, Mantid::DataObjects::OffsetsWorkspace, Mantid::DataObjects::RebinnedOutput, Mantid::DataObjects::SpecialWorkspace2D, Mantid::DataObjects::Workspace2D, Mantid::DataObjects::WorkspaceSingleValue, AxeslessWorkspaceTester, WorkspaceTester, MDHistoWorkspaceTester, Mantid::API::HistoWorkspace, Mantid::API::IEventWorkspace, Mantid::API::IMDEventWorkspace, Mantid::API::IMDHistoWorkspace, and Mantid::API::MatrixWorkspace.
std::string Mantid::API::IMDWorkspace::getConvention | ( | ) | const |
Definition at line 47 of file IMDWorkspace.cpp.
References m_convention.
Referenced by changeQConvention(), and toString().
|
virtual |
Method to generate a line plot through a MD-workspace.
Obtain coordinates for a line plot through a IMDWorkspace.
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 in Mantid::DataObjects::MDEventWorkspace, Mantid::API::MatrixWorkspace, and Mantid::DataObjects::MDHistoWorkspace.
Definition at line 147 of file IMDWorkspace.cpp.
References Mantid::API::IMDWorkspace::LinePlot::e, Mantid::Kernel::VMDBase< TYPE >::getBareArray(), getSignalAtCoord(), Mantid::Kernel::VMDBase< TYPE >::norm(), Mantid::Kernel::normalize(), Mantid::API::IMDWorkspace::LinePlot::x, and Mantid::API::IMDWorkspace::LinePlot::y.
Referenced by Mantid::API::MatrixWorkspace::getLinePlot().
|
pure virtual |
Implemented in Mantid::API::MatrixWorkspace, Mantid::DataObjects::MDEventWorkspace, Mantid::DataObjects::MDHistoWorkspace, and MDHistoWorkspaceTester.
Referenced by export_IMDWorkspace().
|
pure virtual |
Get the number of points associated with the workspace.
For MDEvenWorkspace it is the number of events contributing into the workspace For regularly gridded workspace (MDHistoWorkspace and MatrixWorkspace), it is the number of bins.
Implemented in Mantid::API::MatrixWorkspace, Mantid::DataObjects::MDEventWorkspace, Mantid::DataObjects::MDHistoWorkspace, and MDHistoWorkspaceTester.
Referenced by export_IMDWorkspace(), and Mantid::API::IMDEventWorkspace::toString().
|
pure virtual |
Returns the (normalized) signal at a given coordinates.
Implemented in Mantid::API::MatrixWorkspace, Mantid::DataObjects::MDEventWorkspace, and Mantid::DataObjects::MDHistoWorkspace.
Referenced by getLinePlot(), and getSignalAtVMD().
signal_t Mantid::API::IMDWorkspace::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.
coords | :: coordinate as a VMD vector |
normalization | :: how to normalize the signal returned |
Definition at line 72 of file IMDWorkspace.cpp.
References Mantid::Kernel::VMDBase< TYPE >::getBareArray(), and getSignalAtCoord().
|
pure virtual |
Returns the (normalized) signal at a given coordinates or 0 if the value.
Implemented in Mantid::API::MatrixWorkspace, Mantid::DataObjects::MDEventWorkspace, and Mantid::DataObjects::MDHistoWorkspace.
Referenced by getSignalWithMaskAtVMD().
signal_t Mantid::API::IMDWorkspace::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.
coords | :: coordinate as a VMD vector |
normalization | :: how to normalize the signal returned |
Definition at line 85 of file IMDWorkspace.cpp.
References Mantid::Kernel::VMDBase< TYPE >::getBareArray(), and getSignalWithMaskAtCoord().
|
pure virtual |
|
pure virtual |
|
inlinevirtual |
Reimplemented in Mantid::DataObjects::MDHistoWorkspace.
Definition at line 126 of file IMDWorkspace.h.
Referenced by export_IMDWorkspace().
|
inlinevirtual |
this is the method to build table workspace from any workspace.
It does not have much sence and may be placed here erroneously
Reimplemented in Mantid::DataObjects::MDEventWorkspace.
Definition at line 115 of file IMDWorkspace.h.
|
protected |
Make a single point with NaN as the signal and error This can be returned when there would otherwise be nothing to plot.
x | :: position on the line |
y | :: signal value |
e | :: error value |
Definition at line 126 of file IMDWorkspace.cpp.
References Mantid::Geometry::x, and Mantid::Geometry::y.
Referenced by Mantid::DataObjects::MDHistoWorkspace::getLinePoints().
|
delete |
void Mantid::API::IMDWorkspace::setConvention | ( | std::string | convention | ) |
|
pure virtual |
Setter for the masking region.
Implemented in Mantid::API::MatrixWorkspace, Mantid::DataObjects::MDEventWorkspace, Mantid::DataObjects::MDHistoWorkspace, and MDHistoWorkspaceTester.
|
overrideprotectedvirtual |
Serializes the object to a string.
Implements Mantid::Kernel::DataItem.
Reimplemented in Mantid::API::MatrixWorkspace, Mantid::API::MatrixWorkspace, Mantid::API::MatrixWorkspace, Mantid::DataObjects::MaskWorkspace, Mantid::DataObjects::SpecialWorkspace2D, and MDHistoWorkspaceTester.
Definition at line 92 of file IMDWorkspace.cpp.
References getConvention(), Mantid::API::MDGeometry::getDimension(), Mantid::API::MDGeometry::getNumDims(), Mantid::API::MDGeometry::getOriginalWorkspace(), Mantid::API::Workspace::getTitle(), Mantid::API::MDGeometry::hasOriginalWorkspace(), and Mantid::Kernel::DataItem::id().
Referenced by Mantid::API::IMDEventWorkspace::toString(), and Mantid::API::IMDHistoWorkspace::toString().
|
private |
Definition at line 140 of file IMDWorkspace.h.
Referenced by changeQConvention(), getConvention(), and setConvention().