Mantid
|
Class to represent the axis of a workspace. More...
#include <Axis.h>
Public Member Functions | |
Axis () | |
Constructor. More... | |
virtual Axis * | clone (const MatrixWorkspace *const parentWorkspace)=0 |
Virtual constructor. More... | |
virtual Axis * | clone (const std::size_t length, const MatrixWorkspace *const parentWorkspace)=0 |
Virtual constructor for axis of different length. More... | |
virtual double | getMax () const =0 |
returns max value defined on axis More... | |
virtual double | getMin () const =0 |
returns min value defined on axis More... | |
double | getValue (const std::size_t &index, const std::size_t &verticalIndex=0) const |
Gets the value at the specified index. More... | |
virtual size_t | indexOfValue (const double value) const =0 |
Find the index of the given double value. More... | |
virtual bool | isNumeric () const |
Returns true if the axis is numeric. More... | |
virtual bool | isSpectra () const |
Returns true is the axis is a Spectra axis. More... | |
virtual bool | isText () const |
Returns true if the axis is Text. More... | |
virtual std::string | label (const std::size_t &index) const =0 |
Returns a text label of for a value Note that the index here is not the index of a value, but the effective index of the bin. More... | |
virtual std::size_t | length () const =0 |
Get the length of the axis. More... | |
virtual double | operator() (const std::size_t &index, const std::size_t &verticalIndex=0) const =0 |
Returns the value at a specified index. More... | |
virtual bool | operator== (const Axis &) const =0 |
Check whether two axis are the same, i.e same length and same spectra_values for all elements in the axis. More... | |
virtual const std::shared_ptr< Kernel::Unit > & | setUnit (const std::string &unitName) |
Set the unit on the Axis. More... | |
virtual void | setValue (const std::size_t &index, const double &value)=0 |
Sets the value at the specified index. More... | |
virtual specnum_t | spectraNo (const std::size_t &index) const |
Get the spectrum number. More... | |
std::string & | title () |
Returns a reference to the user-defined title for this axis. More... | |
const std::string & | title () const |
Returns the user-defined title for this axis. More... | |
std::shared_ptr< Kernel::Unit > & | unit () |
The unit object for this workspace (non const version) More... | |
const std::shared_ptr< Kernel::Unit > & | unit () const |
The unit for this axis. More... | |
virtual | ~Axis ()=default |
Protected Member Functions | |
Axis (const Axis &)=default | |
Axis & | operator= (const Axis &)=default |
Private Attributes | |
std::string | m_title |
The user-defined title for this axis. More... | |
std::shared_ptr< Kernel::Unit > | m_unit |
The unit for this axis. More... | |
Mantid::API::Axis::Axis | ( | ) |
|
virtualdefault |
|
protecteddefault |
|
pure virtual |
Virtual constructor.
Implemented in Mantid::API::BinEdgeAxis, Mantid::API::NumericAxis, Mantid::API::RefAxis, Mantid::API::SpectraAxis, and Mantid::API::TextAxis.
|
pure virtual |
Virtual constructor for axis of different length.
Implemented in Mantid::API::BinEdgeAxis, Mantid::API::NumericAxis, Mantid::API::RefAxis, Mantid::API::SpectraAxis, and Mantid::API::TextAxis.
|
pure virtual |
returns max value defined on axis
Implemented in Mantid::API::NumericAxis, Mantid::API::RefAxis, Mantid::API::SpectraAxis, and Mantid::API::TextAxis.
Referenced by export_Axis(), and Mantid::API::MWDimension::getMaximum().
|
pure virtual |
returns min value defined on axis
Implemented in Mantid::API::NumericAxis, Mantid::API::RefAxis, Mantid::API::SpectraAxis, and Mantid::API::TextAxis.
Referenced by export_Axis(), and Mantid::API::MWDimension::getMinimum().
double Mantid::API::Axis::getValue | ( | const std::size_t & | index, |
const std::size_t & | verticalIndex = 0 |
||
) | const |
Gets the value at the specified index.
Just calls operator() but is easier to use with Axis pointers
Easier to use with pointers than the operator()
index | :: The index along the axis direction |
verticalIndex | :: The verticalIndex (used in RefAxis) |
Definition at line 51 of file Axis.cpp.
References index.
Referenced by Mantid::Algorithms::ConvertAxisByFormula::exec(), Mantid::Algorithms::MagFormFactorCorrection::exec(), Mantid::MDAlgorithms::ConvertToDetectorFaceMD::exec(), export_Axis(), Mantid::Algorithms::GetQsInQENSData::extractQValues(), Mantid::DataHandling::AxisHelper::AxisProxy::getCentre(), Mantid::DataHandling::AxisHelper::BinEdgeAxisProxy::getCentre(), and Mantid::API::SpectraAxis::indexOfValue().
|
pure virtual |
Find the index of the given double value.
Implemented in Mantid::API::BinEdgeAxis, Mantid::API::NumericAxis, Mantid::API::RefAxis, Mantid::API::SpectraAxis, and Mantid::API::TextAxis.
Referenced by export_Axis(), and Mantid::API::MatrixWorkspace::getSignalAtCoord().
|
inlinevirtual |
Returns true if the axis is numeric.
Reimplemented in Mantid::API::NumericAxis.
Definition at line 52 of file Axis.h.
Referenced by Mantid::Algorithms::CompareWorkspaces::checkAxes(), Mantid::API::NumericAxisValidator::checkValidity(), Mantid::Algorithms::ConvertAxisByFormula::exec(), export_Axis(), Mantid::API::MatrixWorkspace::getSignalAtCoord(), and Mantid::DataHandling::LoadNexusProcessed::loadNonSpectraAxis().
|
inlinevirtual |
Returns true is the axis is a Spectra axis.
Reimplemented in Mantid::API::SpectraAxis.
Definition at line 50 of file Axis.h.
Referenced by Mantid::Algorithms::CompareWorkspaces::checkAxes(), Mantid::API::SpectraAxisValidator::checkValidity(), export_Axis(), Mantid::CurveFitting::Algorithms::getWorkspaceIndicesFromAxes(), Mantid::DataHandling::LoadNexusProcessed::readInstrumentGroup(), and Mantid::NeXus::NexusFileIO::writeNexusProcessedData2D().
|
inlinevirtual |
Returns true if the axis is Text.
Reimplemented in Mantid::API::TextAxis.
Definition at line 54 of file Axis.h.
Referenced by export_Axis(), Mantid::Algorithms::Transpose::getVerticalAxis(), Mantid::DataHandling::LoadNexusProcessed::loadNonSpectraAxis(), and Mantid::NeXus::NexusFileIO::writeNexusProcessedData2D().
|
pure virtual |
Returns a text label of for a value Note that the index here is not the index of a value, but the effective index of the bin.
Implemented in Mantid::API::BinEdgeAxis, Mantid::API::NumericAxis, Mantid::API::SpectraAxis, and Mantid::API::TextAxis.
Referenced by Mantid::Algorithms::ExtractSpectra2::exec(), export_Axis(), and Mantid::NeXus::NexusFileIO::writeNexusProcessedData2D().
|
pure virtual |
Get the length of the axis.
Implemented in Mantid::API::NumericAxis, Mantid::API::RefAxis, Mantid::API::SpectraAxis, and Mantid::API::TextAxis.
Referenced by Mantid::Algorithms::Transpose::createOutputWorkspace(), Mantid::API::NumericAxis::equalWithinTolerance(), Mantid::Algorithms::ConvertAxisByFormula::exec(), Mantid::Algorithms::MagFormFactorCorrection::exec(), Mantid::DataHandling::SaveNISTDAT::exec(), Mantid::MDAlgorithms::ConvertToDetectorFaceMD::exec(), export_Axis(), Mantid::Algorithms::GetQsInQENSData::extractQValues(), Mantid::API::MWDimension::getIsIntegrated(), Mantid::API::MWDimension::getNBins(), Mantid::API::MWDimension::getNBoundaries(), Mantid::CurveFitting::Algorithms::getWorkspaceIndicesFromAxes(), Mantid::DataHandling::LoadNexusProcessed::loadNonSpectraAxis(), Mantid::API::RefAxis::operator==(), Mantid::API::SpectraAxis::operator==(), Mantid::API::TextAxis::operator==(), Mantid::NeXus::NexusFileIO::writeNexusProcessedData2D(), and Mantid::DataHandling::SaveSPE::writeSPEFile().
|
pure virtual |
Returns the value at a specified index.
index | :: the index |
verticalIndex | :: The verticalIndex |
Implemented in Mantid::API::RefAxis, Mantid::API::NumericAxis, Mantid::API::SpectraAxis, and Mantid::API::TextAxis.
|
pure virtual |
Check whether two axis are the same, i.e same length and same spectra_values for all elements in the axis.
Implemented in Mantid::API::NumericAxis, Mantid::API::RefAxis, Mantid::API::SpectraAxis, and Mantid::API::TextAxis.
|
virtual |
Set the unit on the Axis.
Sets the Unit that is in use on this axis.
unitName | :: name of the unit as known to the UnitFactory |
Definition at line 39 of file Axis.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance(), m_unit, and unit().
Referenced by export_Axis(), and Mantid::Algorithms::ExportTimeSeriesLog::setupWorkspace2D().
|
pure virtual |
Sets the value at the specified index.
index | :: The index |
value | :: The new value |
Implemented in Mantid::API::BinEdgeAxis, Mantid::API::NumericAxis, Mantid::API::RefAxis, Mantid::API::SpectraAxis, and Mantid::API::TextAxis.
Referenced by Mantid::Algorithms::ConvertAxisByFormula::exec(), export_Axis(), and Mantid::DataHandling::LoadNexusProcessed::loadNonSpectraAxis().
|
virtual |
Get the spectrum number.
Returns the spectrum number at the position given (Spectra axis only)
index | The position for which the value is required |
domain_error | If this method is called on a numeric axis |
Reimplemented in Mantid::API::SpectraAxis.
Definition at line 60 of file Axis.cpp.
References index, and UNUSED_ARG.
Referenced by Mantid::Algorithms::DiffractionFocussing::exec(), Mantid::CurveFitting::Algorithms::getWorkspaceIndicesFromAxes(), and Mantid::API::SpectraAxis::operator==().
std::string & Mantid::API::Axis::title | ( | ) |
const std::string & Mantid::API::Axis::title | ( | ) | const |
Returns the user-defined title for this axis.
Definition at line 20 of file Axis.cpp.
References m_title.
Referenced by Mantid::Algorithms::CompareWorkspaces::checkAxes(), Mantid::API::SpectraAxis::clone(), Mantid::DataHandling::LoadMcStasNexus::exec(), Mantid::MDAlgorithms::ConvertToDetectorFaceMD::exec(), export_Axis(), Mantid::API::MWDimension::getName(), and Mantid::DataHandling::LoadMcStas::readHistogramData().
Kernel::Unit_sptr & Mantid::API::Axis::unit | ( | ) |
const Kernel::Unit_sptr & Mantid::API::Axis::unit | ( | ) | const |
The unit for this axis.
Definition at line 28 of file Axis.cpp.
References m_unit.
Referenced by Mantid::DataHandling::LoadMuonNexusV2::applyTimeAxisUnitCorrection(), Mantid::Algorithms::CompareWorkspaces::checkAxes(), Mantid::Algorithms::WorkspaceJoiners::checkCompatibility(), Mantid::API::SpectraAxis::clone(), Mantid::Algorithms::CompareWorkspaces::compareEventWorkspaces(), Mantid::Algorithms::ConvertAxisByFormula::exec(), Mantid::Algorithms::DiffractionFocussing2::exec(), Mantid::Algorithms::MagFormFactorCorrection::exec(), Mantid::CurveFitting::Algorithms::PawleyFit::exec(), Mantid::DataHandling::LoadMcStasNexus::exec(), Mantid::MDAlgorithms::ConvertToDetectorFaceMD::exec(), export_Axis(), Mantid::CurveFitting::Functions::FunctionQDepends::extractQValues(), Mantid::Algorithms::GetQsInQENSData::extractQValues(), Mantid::API::MWDimension::getName(), Mantid::API::MWXDimension::getName(), Mantid::API::MWDimension::getUnits(), Mantid::API::MWXDimension::getUnits(), Mantid::MDAlgorithms::UnitsConversionHelper::initialize(), Mantid::MDAlgorithms::MDTransfNoQ::inputUnitID(), Mantid::MDAlgorithms::MDTransfNoQ::outputUnitID(), Mantid::DataHandling::LoadMcStas::readHistogramData(), Mantid::CurveFitting::Functions::PawleyFunction::setMatrixWorkspace(), setUnit(), Mantid::API::SpectraAxis::SpectraAxis(), Mantid::API::MatrixWorkspace::toString(), Mantid::NeXus::NexusFileIO::writeNexusProcessedData2D(), and Mantid::DataHandling::SaveSPE::writeSPEFile().
|
private |
|
private |