|
Mantid
|
Stores numeric values that are assumed to be bin edge values. More...
#include <BinEdgeAxis.h>
Public Member Functions | |
| BinEdgeAxis (const std::size_t &length) | |
| Constructor taking a length. | |
| BinEdgeAxis (const std::vector< double > &edges) | |
| Constructor taking a list of edge values. | |
| Axis * | clone (const MatrixWorkspace *const parentWorkspace) override |
| Virtual constructor. | |
| Axis * | clone (const std::size_t length, const MatrixWorkspace *const parentWorkspace) override |
| Virtual constructor. | |
| std::vector< double > | createBinBoundaries () const override |
| Return the values axis as they are. | |
| size_t | indexOfValue (const double value) const override |
| Treats values as bin edges and returns the index of the bin, which the value falls into. | |
| std::string | label (const std::size_t &index) const override |
| Returns a text label which shows the value at the given bin index. | |
| void | setValue (const std::size_t &index, const double &value) override |
| Sets the axis value at a given position. | |
Public Member Functions inherited from Mantid::API::NumericAxis | |
| Axis * | clone (const MatrixWorkspace *const parentWorkspace) override |
| Virtual constructor. | |
| Axis * | clone (const std::size_t length, const MatrixWorkspace *const parentWorkspace) override |
| Virtual constructor for axis of different length. | |
| virtual bool | equalWithinTolerance (const Axis &axis2, const double tolerance) const |
| Check if two numeric axis are equivalent to a given tolerance. | |
| double | getMax () const override |
| returns max value defined on axis | |
| double | getMin () const override |
| returns min value defined on axis | |
| virtual const std::vector< double > & | getValues () const |
| Return a const reference to the values. | |
| size_t | indexOfValue (const double value) const override |
| Returns the index of the value wrt bin edge representation of the axis. | |
| bool | isNumeric () const override |
| Is the axis numeric - always true for this class. | |
| std::string | label (const std::size_t &index) const override |
| Returns a text label which shows the value corresponding to a bin index. | |
| std::size_t | length () const override |
| Get the length of the axis. | |
| NumericAxis (const std::size_t &length) | |
| Constructor. | |
| NumericAxis (std::vector< double > centres) | |
| Constructor taking a set of centre point values. | |
| double | operator() (const std::size_t &index, const std::size_t &verticalIndex=0) const override |
| Get a value at the specified index. | |
| bool | operator== (const Axis &) const override |
| Check if two axis defined as spectra or numeric axis are equivalent. | |
| bool | operator== (const NumericAxis &) const |
| Check if two NumericAxis are equivalent. | |
| void | setValue (const std::size_t &index, const double &value) override |
| Set the value at a specific index. | |
Public Member Functions inherited from Mantid::API::Axis | |
| Axis () | |
| Constructor. | |
| double | getValue (const std::size_t &index, const std::size_t &verticalIndex=0) const |
| Gets the value at the specified index. | |
| virtual bool | isSpectra () const |
| Returns true is the axis is a Spectra axis. | |
| virtual bool | isText () const |
| Returns true if the axis is Text. | |
| virtual const std::shared_ptr< Kernel::Unit > & | setUnit (const std::string &unitName) |
| Set the unit on the Axis. | |
| virtual specnum_t | spectraNo (const std::size_t &index) const |
| Get the spectrum number. | |
| std::string & | title () |
| Returns a reference to the user-defined title for this axis. | |
| const std::string & | title () const |
| Returns the user-defined title for this axis. | |
| std::shared_ptr< Kernel::Unit > & | unit () |
| The unit object for this workspace (non const version) | |
| const std::shared_ptr< Kernel::Unit > & | unit () const |
| The unit for this axis. | |
| virtual | ~Axis ()=default |
Additional Inherited Members | |
Protected Member Functions inherited from Mantid::API::NumericAxis | |
| std::string | formatLabel (const double value) const |
| Get number label. | |
| NumericAxis () | |
| Default constructor. | |
Protected Member Functions inherited from Mantid::API::Axis | |
| Axis (const Axis &)=default | |
| Axis & | operator= (const Axis &)=default |
Protected Attributes inherited from Mantid::API::NumericAxis | |
| std::vector< double > | m_values |
| A vector holding the centre values. | |
Stores numeric values that are assumed to be bin edge values.
It overrides indexOfValue to search using the values as bin edges are than centre points
Definition at line 20 of file BinEdgeAxis.h.
| Mantid::API::BinEdgeAxis::BinEdgeAxis | ( | const std::size_t & | length | ) |
Constructor taking a length.
| length | The length of the axis |
Definition at line 18 of file BinEdgeAxis.cpp.
References Mantid::API::NumericAxis::length(), and Mantid::API::NumericAxis::m_values.
| Mantid::API::BinEdgeAxis::BinEdgeAxis | ( | const std::vector< double > & | edges | ) |
Constructor taking a list of edge values.
| edges | A list of bin boundaries |
Definition at line 28 of file BinEdgeAxis.cpp.
References Mantid::API::NumericAxis::m_values.
|
overridevirtual |
Virtual constructor.
| parentWorkspace | :: The workspace is not used in this implementation |
Implements Mantid::API::Axis.
Definition at line 39 of file BinEdgeAxis.cpp.
References UNUSED_ARG.
|
overridevirtual |
Virtual constructor.
| length | A new length for the axis. The values are cleared. |
| parentWorkspace | The workspace is not used in this implementation |
Implements Mantid::API::Axis.
Definition at line 49 of file BinEdgeAxis.cpp.
References Mantid::API::NumericAxis::length(), and UNUSED_ARG.
|
overridevirtual |
Return the values axis as they are.
Reimplemented from Mantid::API::NumericAxis.
Definition at line 61 of file BinEdgeAxis.cpp.
References Mantid::API::NumericAxis::getValues().
|
overridevirtual |
Treats values as bin edges and returns the index of the bin, which the value falls into.
The maximum value will always be length() - 1
| value | A value on the axis |
Implements Mantid::API::Axis.
Definition at line 82 of file BinEdgeAxis.cpp.
References Mantid::Kernel::VectorHelper::indexOfValueFromEdges(), Mantid::API::NumericAxis::m_values, and value.
|
overridevirtual |
Returns a text label which shows the value at the given bin index.
Note that the bin index doesn't match the index in the value array for this type of axis. The value array has one more element than number of bins.
| index | :: The bin index of the bin edge axis |
| IndexError | if the bin index is out of range |
Implements Mantid::API::Axis.
Definition at line 93 of file BinEdgeAxis.cpp.
References Mantid::API::NumericAxis::formatLabel(), index, and Mantid::API::NumericAxis::length().
Referenced by Mantid::DataHandling::SaveAscii2::createSpectrumFilename(), and Mantid::DataHandling::SaveCanSAS1D2::exec().
|
overridevirtual |
Sets the axis value at a given position.
| index | :: The position along the axis for which to set the value |
| value | :: The new value |
| IndexError | If the index requested is not in the range of this axis |
Implements Mantid::API::Axis.
Definition at line 68 of file BinEdgeAxis.cpp.
References index, Mantid::API::NumericAxis::length(), Mantid::API::NumericAxis::m_values, and value.