Mantid
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Mantid::Kernel::Units::Wavelength Class Reference

Wavelength in Angstrom. More...

Inheritance diagram for Mantid::Kernel::Units::Wavelength:
Mantid::Kernel::Unit Mantid::Kernel::Units::SpinEchoLength Mantid::Kernel::Units::SpinEchoTime

Public Member Functions

const std::string caption () const override
 The full name of the unit.
 
Unitclone () const override
 
double conversionTOFMax () const override
 
double conversionTOFMin () const override
 
void init () override
 Finalize the initialization.
 
const UnitLabel label () const override
 A label for the unit to be printed on axes,.
 
double singleFromTOF (const double tof) const override
 Convert a single tof value to this unit.
 
double singleToTOF (const double x) const override
 Convert a single X value to TOF.
 
const std::string unitID () const override
 "Wavelength"
 
 Wavelength ()
 Constructor.
 
- Public Member Functions inherited from Mantid::Kernel::Unit
virtual std::pair< double, double > conversionRange () const
 The range where conversion to TOF from given units is monotonic and reversible.
 
double convertSingleFromTOF (const double xvalue, const double &l1, const int &emode, const UnitParametersMap &params)
 Convert from the time-of-flight to the concrete unit. TOF is in microseconds.
 
double convertSingleToTOF (const double xvalue, const double &l1, const int &emode, const UnitParametersMap &params)
 Convert from the concrete unit to time-of-flight. TOF is in microseconds.
 
void fromTOF (std::vector< double > &xdata, std::vector< double > const &ydata, const double &_l1, const int &_emode, const UnitParametersMap &params)
 
void fromTOF (std::vector< double > &xdata, std::vector< double > const &ydata, const double &_l1, const int &_emode, std::initializer_list< std::pair< const UnitParams, double > > params)
 Convert from time-of-flight to the concrete unit.
 
void initialize (const double &_l1, const int &_emode, const UnitParametersMap &params)
 Initialize the unit to perform conversion using singleToTof() and singleFromTof()
 
virtual bool isConvertible () const
 Returns if the unit can be used in conversions.
 
bool isInitialized () const
 
bool operator!= (const Unit &u) const
 
bool operator== (const Unit &u) const
 
bool quickConversion (const Unit &destination, double &factor, double &power) const
 Is conversion by constant multiplication possible?
 
bool quickConversion (std::string destUnitName, double &factor, double &power) const
 Is conversion by constant multiplication possible?
 
void toTOF (std::vector< double > &xdata, std::vector< double > const &ydata, const double &_l1, const int &_emode, const UnitParametersMap &params)
 
void toTOF (std::vector< double > &xdata, std::vector< double > const &ydata, const double &_l1, const int &_emode, std::initializer_list< std::pair< const UnitParams, double > > params)
 Convert from the concrete unit to time-of-flight.
 
 Unit ()
 (Empty) Constructor
 
virtual ~Unit ()=default
 Virtual destructor.
 

Protected Member Functions

void validateUnitParams (const int emode, const UnitParametersMap &params) override
 
- Protected Member Functions inherited from Mantid::Kernel::Unit
void addConversion (std::string to, const double &factor, const double &power=1.0) const
 Add a 'quick conversion' from the unit class on which this method is called.
 

Protected Attributes

bool do_sfpFrom
 Apply the sfpFrom value.
 
double efixed
 
double factorFrom
 Constant factor for from conversion.
 
double factorTo
 Constant factor for to conversion.
 
double sfpFrom
 Extra correction factor in from conversion.
 
double sfpTo
 Extra correction factor in to conversion.
 
- Protected Attributes inherited from Mantid::Kernel::Unit
int emode
 emode :: The energy mode (0=elastic, 1=direct geometry, 2=indirect geometry)
 
bool initialized
 The unit values have been initialized.
 
double l1
 l1 :: The source-sample distance (in metres)
 
const UnitParametersMapm_params
 additional parameters l2 :: distance from sample to detector (in metres) twoTheta :: scattering angle in radians efixed :: Value of fixed energy: EI (emode=1) or EF (emode=2) (in meV) difc :: diffractometer constant DIFC
 

Detailed Description

Wavelength in Angstrom.

Definition at line 267 of file Unit.h.

Constructor & Destructor Documentation

◆ Wavelength()

Mantid::Kernel::Units::Wavelength::Wavelength ( )

Member Function Documentation

◆ caption()

const std::string Mantid::Kernel::Units::Wavelength::caption ( ) const
inlineoverridevirtual

The full name of the unit.

Returns
The unit caption

Implements Mantid::Kernel::Unit.

Definition at line 270 of file Unit.h.

◆ clone()

Unit * Mantid::Kernel::Units::Wavelength::clone ( ) const
overridevirtual
Returns
a cloned instance of the other

Implements Mantid::Kernel::Unit.

Definition at line 421 of file Unit.cpp.

References Wavelength().

◆ conversionTOFMax()

double Mantid::Kernel::Units::Wavelength::conversionTOFMax ( ) const
overridevirtual
Returns
Maximal time of flight, which can be reversively converted into wavelength

Implements Mantid::Kernel::Unit.

Definition at line 411 of file Unit.cpp.

References factorTo, and sfpTo.

◆ conversionTOFMin()

double Mantid::Kernel::Units::Wavelength::conversionTOFMin ( ) const
overridevirtual
Returns
Minimal time of flight, which can be reversively converted into wavelength

Implements Mantid::Kernel::Unit.

Definition at line 403 of file Unit.cpp.

References Mantid::Kernel::Unit::emode, and sfpTo.

Referenced by Mantid::Kernel::Units::SpinEchoLength::conversionTOFMin().

◆ init()

void Mantid::Kernel::Units::Wavelength::init ( )
overridevirtual

◆ label()

const UnitLabel Mantid::Kernel::Units::Wavelength::label ( ) const
overridevirtual

A label for the unit to be printed on axes,.

See also
UnitLabel
Returns
The unit label

Implements Mantid::Kernel::Unit.

Definition at line 318 of file Unit.cpp.

References Mantid::Kernel::Units::Symbol::Angstrom.

◆ singleFromTOF()

double Mantid::Kernel::Units::Wavelength::singleFromTOF ( const double  tof) const
overridevirtual

Convert a single tof value to this unit.

Parameters
tofvalue to convert
Returns
the value in this unit as converted.

Implements Mantid::Kernel::Unit.

Definition at line 394 of file Unit.cpp.

References do_sfpFrom, factorFrom, sfpFrom, and Mantid::Geometry::x.

Referenced by Mantid::Crystal::PeakHKLErrors::createNewPeak(), Mantid::Crystal::SCDCalibratePanels::findT0(), Mantid::Kernel::Units::SpinEchoLength::singleFromTOF(), and Mantid::Kernel::Units::SpinEchoTime::singleFromTOF().

◆ singleToTOF()

double Mantid::Kernel::Units::Wavelength::singleToTOF ( const double  x) const
overridevirtual

Convert a single X value to TOF.

Parameters
xvalue to convert
Returns
the TOF as converted.

Implements Mantid::Kernel::Unit.

Definition at line 387 of file Unit.cpp.

References Mantid::Kernel::Unit::emode, factorTo, sfpTo, and Mantid::Geometry::x.

Referenced by Mantid::Kernel::Units::SpinEchoLength::singleToTOF(), and Mantid::Kernel::Units::SpinEchoTime::singleToTOF().

◆ unitID()

const std::string Mantid::Kernel::Units::Wavelength::unitID ( ) const
overridevirtual

"Wavelength"

Implements Mantid::Kernel::Unit.

Referenced by validateUnitParams().

◆ validateUnitParams()

void Mantid::Kernel::Units::Wavelength::validateUnitParams ( const int  emode,
const UnitParametersMap params 
)
overrideprotectedvirtual

Reimplemented from Mantid::Kernel::Unit.

Definition at line 320 of file Unit.cpp.

References Mantid::Kernel::efixed, Mantid::Kernel::l2, and unitID().

Member Data Documentation

◆ do_sfpFrom

bool Mantid::Kernel::Units::Wavelength::do_sfpFrom
protected

Apply the sfpFrom value.

Definition at line 291 of file Unit.h.

Referenced by init(), and singleFromTOF().

◆ efixed

double Mantid::Kernel::Units::Wavelength::efixed
protected

Definition at line 286 of file Unit.h.

Referenced by init().

◆ factorFrom

double Mantid::Kernel::Units::Wavelength::factorFrom
protected

Constant factor for from conversion.

Definition at line 290 of file Unit.h.

Referenced by init(), and singleFromTOF().

◆ factorTo

double Mantid::Kernel::Units::Wavelength::factorTo
protected

Constant factor for to conversion.

Definition at line 288 of file Unit.h.

Referenced by conversionTOFMax(), init(), and singleToTOF().

◆ sfpFrom

double Mantid::Kernel::Units::Wavelength::sfpFrom
protected

Extra correction factor in from conversion.

Definition at line 289 of file Unit.h.

Referenced by init(), and singleFromTOF().

◆ sfpTo

double Mantid::Kernel::Units::Wavelength::sfpTo
protected

Extra correction factor in to conversion.

Definition at line 287 of file Unit.h.

Referenced by conversionTOFMax(), conversionTOFMin(), init(), and singleToTOF().


The documentation for this class was generated from the following files: