\(\renewcommand\AA{\unicode{x212B}}\)
IMDHistoWorkspace¶
This is a Python binding to the C++ class Mantid::API::IMDHistoWorkspace.
bases: mantid.api.IMDWorkspace
, mantid.api.MultipleExperimentInfos
- class mantid.api.IMDHistoWorkspace¶
- addExperimentInfo((MultipleExperimentInfos)self, (object)ExperimentalInfo) None : ¶
Add a new
ExperimentInfo
to thisIMDWorkspace
- clearOriginalWorkspaces((MDGeometry)self) None : ¶
Clear any attached original workspaces
- clone(InputWorkspace)¶
Copies an existing workspace into a new one.
Property descriptions:
InputWorkspace(Input:req) Workspace Name of the input workspace. Must be a MatrixWorkspace (2D or EventWorkspace), a PeaksWorkspace or a MDEventWorkspace.
OutputWorkspace(Output:req) Workspace Name of the newly created cloned workspace.
- convertUnits(InputWorkspace, Target, EMode=None, EFixed=None, AlignBins=None, ConvertFromPointData=None)¶
Performs a unit change on the X values of a workspace
Property descriptions:
InputWorkspace(Input:req) MatrixWorkspace Name of the input workspace
OutputWorkspace(Output:req) MatrixWorkspace Name of the output workspace, can be the same as the input
Target(Input:req) string The name of the units to convert to (must be one of those registered in the Unit Factory)[DeltaE, DeltaE_inFrequency, DeltaE_inWavenumber, dSpacing, dSpacingPerpendicular, Energy, Energy_inWavenumber, Momentum, MomentumTransfer, QSquared, SpinEchoLength, SpinEchoTime, TOF, Wavelength]
EMode(Input) string The energy mode (default: elastic)[Elastic, Direct, Indirect]
EFixed(Input) number Value of fixed energy in meV : EI (EMode=’Direct’) or EF (EMode=’Indirect’) . Must be set if the target unit requires it (e.g. DeltaE)
AlignBins(Input) boolean If true (default is false), rebins after conversion to ensure that all spectra in the output workspace have identical bin boundaries. This option is not recommended (see http://docs.mantidproject.org/algorithms/ConvertUnits).
ConvertFromPointData(Input) boolean When checked, if the Input Workspace contains Points the algorithm ConvertToHistogram will be run to convert the Points to Bins. The Output Workspace will contains Bins.
- copyExperimentInfos((MultipleExperimentInfos)self, (MultipleExperimentInfos)MultipleExperimentInfos) None : ¶
Copy the
ExperimentInfo
from another
- delete(Workspace)¶
Removes a workspace from memory.
Property descriptions:
Workspace(Input:req) Workspace Name of the workspace to delete.
- displayNormalization((IMDWorkspace)self) MDNormalization : ¶
Returns the visual
MDNormalization
of the workspace.
- displayNormalizationHisto((IMDWorkspace)self) MDNormalization : ¶
For MDEventWorkspaces returns the visual
MDNormalization
of derived MDHistoWorkspaces. For all others returns the same as displayNormalization.
- errorSquaredAt((IMDHistoWorkspace)self, (int)index) float : ¶
Return the squared-errors at the linear index
- estimateResolution((MDGeometry)self) numpy.ndarray : ¶
Returns a numpy array containing the width of the smallest bin in each dimension
- getBasisVector((MDGeometry)self, (int)index) VMD : ¶
Returns a
VMD
object defining the basis vector for the specified dimension
- getCenter((IMDHistoWorkspace)self, (int)linear_index) VMD : ¶
Return the position of the center of a bin at a given position
- getComment((Workspace)self) str : ¶
Returns the comment field on the workspace
- getDimension((MDGeometry)self, (int)index) IMDDimension : ¶
Returns the description of the
IMDDimension
at the given index (starts from 0). Raises RuntimeError if index is out of range.
- getDimensionIndexById((MDGeometry)self, (str)id) int : ¶
Returns the index of the
IMDDimension
with the given ID. Raises RuntimeError if the name does not exist.
- getDimensionIndexByName((MDGeometry)self, (str)name) int : ¶
Returns the index of the dimension with the given name. Raises RuntimeError if the name does not exist.
- getDimensionWithId((MDGeometry)self, (str)id) IMDDimension : ¶
Returns the description of the
IMDDimension
with the given id string. Raises ValueError if the string is not a known id.
- getErrorSquaredArray((IMDHistoWorkspace)self) object : ¶
Returns a read-only numpy array containing the square of the error values
- getExperimentInfo((MultipleExperimentInfos)self, (int)expInfoIndex) ExperimentInfo : ¶
Return the experiment info at the given index.
- getGeometryXML((MDGeometry)self) str : ¶
Returns an XML representation, as a string, of the geometry of the workspace
- getHistory((Workspace)self) WorkspaceHistory : ¶
Return read-only access to the
WorkspaceHistory
- getInverseVolume((IMDHistoWorkspace)self) float : ¶
Return the inverse of volume of EACH cell in the workspace.
- getLinearIndex((IMDHistoWorkspace)self, (int)index1, (int)index2) int : ¶
Get the 1D linear index from the 2D array
- getLinearIndex( (IMDHistoWorkspace)self, (int)index1, (int)index2, (int)index3) -> int :
Get the 1D linear index from the 3D array
- getLinearIndex( (IMDHistoWorkspace)self, (int)index1, (int)index2, (int)index3, (int)index4) -> int :
Get the 1D linear index from the 4D array
- getMemorySize((Workspace)self) int : ¶
Returns the memory footprint of the workspace in KB
- getNEvents((IMDWorkspace)self) int : ¶
Returns the total number of events, contributed to the workspace
- getNPoints((IMDWorkspace)self) int : ¶
Returns the total number of points within the workspace
- getName((Workspace)self) str : ¶
Returns the name of the workspace. This could be an empty string
- getNonIntegratedDimensions((MDGeometry)self) list : ¶
Returns the description objects of the non-integrated dimension as a python list of
IMDDimension
.
- getNumDims((MDGeometry)self) int : ¶
Returns the number of dimensions present
- getNumEventsArray((IMDHistoWorkspace)self) object : ¶
Returns a read-only numpy array containing the number of MD events in each bin
- getNumExperimentInfo((MultipleExperimentInfos)self) int : ¶
Return the number of
ExperimentInfo
objects,
- getNumNonIntegratedDims((MDGeometry)self) int : ¶
Returns the number of non-integrated dimensions present
- getNumberTransformsFromOriginal((MDGeometry)self) int : ¶
Returns the number of transformations from original workspace coordinate systems
- getNumberTransformsToOriginal((MDGeometry)self) int : ¶
Returns the number of transformations to original workspace coordinate systems
- getOrigin((MDGeometry)self) VMD : ¶
Returns the vector of the origin (in the original workspace) that corresponds to 0,0,0… in this workspace
- getOriginalWorkspace((MDGeometry)self, (int)index) Workspace : ¶
Returns the source workspace attached at the given index
- getSignalArray((IMDHistoWorkspace)self) object : ¶
Returns a read-only numpy array containing the signal values
- getSpecialCoordinateSystem((IMDWorkspace)self) SpecialCoordinateSystem : ¶
Returns the special coordinate system of the workspace
- getTDimension((MDGeometry)self) IMDDimension : ¶
Returns the
IMDDimension
description mapped to time
- getTitle((Workspace)self) str : ¶
Returns the title of the workspace
- getXDimension((MDGeometry)self) IMDDimension : ¶
Returns the
IMDDimension
description mapped to X
- getYDimension((MDGeometry)self) IMDDimension : ¶
Returns the
IMDDimension
description mapped to Y
- getZDimension((MDGeometry)self) IMDDimension : ¶
Returns the
IMDDimension
description mapped to Z
- hasOriginalWorkspace((MDGeometry)self, (int)index) bool : ¶
Returns True if there is a source workspace at the given index
- id((DataItem)self) str : ¶
The string ID of the class
- isDirty((Workspace)self[, (int)n]) bool : ¶
True if the workspace has run more than n algorithms (Default=1)
- isGroup((Workspace)self) bool : ¶
Returns if it is a group workspace
- isMDHistoWorkspace((IMDWorkspace)self) bool : ¶
Returns True if this is considered to be binned data.
- maskDetectors(Workspace, SpectraList=None, DetectorList=None, WorkspaceIndexList=None, MaskedWorkspace=None, ForceInstrumentMasking=None, StartWorkspaceIndex=None, EndWorkspaceIndex=None, ComponentList=None)¶
An algorithm to mask a detector, or set of detectors, as not to be used. The workspace spectra associated with those detectors are zeroed.
Property descriptions:
Workspace(InOut:req) Workspace The name of the input and output workspace on which to perform the algorithm.
SpectraList(Input) int list A list of spectra to mask
DetectorList(Input) int list A list of detector ID’s to mask
WorkspaceIndexList(Input) unsigned int list A list of the workspace indices to mask
MaskedWorkspace(Input) MatrixWorkspace If given but not as a SpecialWorkspace2D, the masking from this workspace will be copied. If given as a SpecialWorkspace2D, the masking is read from its Y values.[]
ForceInstrumentMasking(Input) boolean Works when ‘MaskedWorkspace’ is provided and forces to use spectra-detector mapping even in case when number of spectra in ‘Workspace’ and ‘MaskedWorkspace’ are equal
StartWorkspaceIndex(Input) number If other masks fields are provided, it’s the first index of the target workspace to be allowed to be masked from by these masks, if not, its the first index of the target workspace to mask. Default value is 0 if other masking is present or ignored if not.
EndWorkspaceIndex(Input) number If other masks are provided, it’s the last index of the target workspace allowed to be masked to by these masks, if not, its the last index of the target workspace to mask. Default is number of histograms in target workspace if other masks are present or ignored if not.
ComponentList(Input) str list A list names of components to mask
- name((DataItem)self) str : ¶
The name of the object
- numOriginalWorkspaces((MDGeometry)self) int : ¶
Returns the number of source workspaces attached
- readLock((DataItem)self) None : ¶
Acquires a read lock on the data item.
- setComment((Workspace)self, (str)comment) None : ¶
Set the comment field of the workspace
- setDisplayNormalization((IMDHistoWorkspace)self, (MDNormalization)normalization) None : ¶
Sets the visual normalization of the workspace.
- setErrorSquaredArray((IMDHistoWorkspace)self, (object)errorSquared) None : ¶
Sets the square of the errors from a numpy array. The sizes must match the current workspace sizes. A ValueError is thrown if not
- setErrorSquaredAt((IMDHistoWorkspace)self, (int)index, (float)value) None : ¶
Sets the squared-error at the specified index.
- setSignalArray((IMDHistoWorkspace)self, (object)signalValues) None : ¶
Sets the signal from a numpy array. The sizes must match the current workspace sizes. A ValueError is thrown if not
- setSignalAt((IMDHistoWorkspace)self, (int)index, (float)value) None : ¶
Sets the signal at the specified index.
- setTitle((Workspace)self, (str)title) None : ¶
Set the title of the workspace
- setTo((IMDHistoWorkspace)self, (float)signal, (float)error_squared, (float)num_events) None : ¶
Sets all signals/errors in the workspace to the given values
- signalAt((IMDHistoWorkspace)self, (int)index) float : ¶
Return a reference to the signal at the linear index
- threadSafe((DataItem)self) bool : ¶
Returns true if the object can be accessed safely from multiple threads
- unlock((DataItem)self) None : ¶
Unlocks a read or write lock on the data item.