Mantid
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Mantid::Geometry::XMLInstrumentParameter Class Reference

This class is used to store information about parameters in XML instrument definition files and instrument parameter files, so that such parameters can be added to a workspace when appropriate. More...

#include <XMLInstrumentParameter.h>

Public Member Functions

double createParamValue (Mantid::Kernel::TimeSeriesProperty< double > *logData) const
 Returns parameter value as generated using possibly equation expression etc. More...
 
 XMLInstrumentParameter (std::string logfileID, std::string value, std::shared_ptr< Kernel::Interpolation > interpolation, std::string formula, std::string formulaUnit, std::string resultUnit, std::string paramName, std::string type, std::string tie, std::vector< std::string > constraint, std::string &penaltyFactor, std::string fitFunc, std::string extractSingleValueAs, std::string eq, const Geometry::IComponent *comp, double angleConvertConst, const std::string &description, std::string visible)
 Default constructor. More...
 

Public Attributes

double m_angleConvertConst
 when this const equals 1 it means that angle=degree (default) is set in IDF otherwise if this const equals 180/pi it means that angle=radian is set in IDF More...
 
const Geometry::IComponentm_component
 value from the log value More...
 
const std::vector< std::string > m_constraint
 specific to fitting More...
 
const std::string m_description
 if present, contains help string, describing the parameter More...
 
const std::string m_eq
 single value from the log file( average, first number, etc) More...
 
const std::string m_extractSingleValueAs
 describes the way to extract a More...
 
const std::string m_fittingFunction
 specific to fitting parameter More...
 
const std::string m_formula
 specify fitting function More...
 
const std::string m_formulaUnit
 formula to use for setting this parameter More...
 
std::shared_ptr< Kernel::Interpolationm_interpolation
 evaluating the formula More...
 
const std::string m_logfileID
 logfile id More...
 
const std::string m_paramName
 specify a value directly More...
 
std::string m_penaltyFactor
 parameter specify lower and upper bound in that order More...
 
const std::string m_resultUnit
 expected result (output) unit from More...
 
const std::string m_tie
 specific to fitting parameter specify any tie More...
 
const std::string m_type
 type of the data, e.g. int, double or string More...
 
const std::string m_value
 rather then extracting value from logfile, More...
 
const std::string m_visible
 if present, describes whether the parameter shall be visible in InstrumentViewer More...
 

Detailed Description

This class is used to store information about parameters in XML instrument definition files and instrument parameter files, so that such parameters can be added to a workspace when appropriate.

For example log file parameters make reference to log file entry values in raw data, and such parameters needs raw data to be loaded first.

Author
Anders Markvardsen, ISIS, RAL
Date
12/1/2009

Definition at line 40 of file XMLInstrumentParameter.h.

Constructor & Destructor Documentation

◆ XMLInstrumentParameter()

Mantid::Geometry::XMLInstrumentParameter::XMLInstrumentParameter ( std::string  logfileID,
std::string  value,
std::shared_ptr< Kernel::Interpolation interpolation,
std::string  formula,
std::string  formulaUnit,
std::string  resultUnit,
std::string  paramName,
std::string  type,
std::string  tie,
std::vector< std::string >  constraint,
std::string &  penaltyFactor,
std::string  fitFunc,
std::string  extractSingleValueAs,
std::string  eq,
const Geometry::IComponent comp,
double  angleConvertConst,
const std::string &  description,
std::string  visible 
)

Default constructor.

Constructor.

Parameters
logfileID:: The logfile id – the part of the file name which identifies the log
value:: Rather then extracting value from logfile, specify a value directly
paramName:: The name of the parameter which will be created based on the log values
type:: The type
extractSingleValueAs:: Describes the way to extract a single value from the log file( average, first number, etc)
eq:: muParser equation to calculate the parameter value from the log value
comp:: The pointer to the instrument component
interpolation:: The pointer to the interpolation class
formula:: The string formula to apply
formulaUnit:: The unit that the formula requires the input value in
resultUnit:: The unit of the result of the formula
tie:: What to tie the value to
constraint:: The constraint associated with this parameter
penaltyFactor:: The level of penalty associated with the constraint
fitFunc:: What fit function this applies to
angleConvertConst:: angle conversion constant?????
description:: text description of the parameter
visible:: whether the parameter should be visible in InstrumentViewer

Definition at line 54 of file XMLInstrumentParameter.cpp.

References m_description.

Member Function Documentation

◆ createParamValue()

double Mantid::Geometry::XMLInstrumentParameter::createParamValue ( Mantid::Kernel::TimeSeriesProperty< double > *  logData) const

Returns parameter value as generated using possibly equation expression etc.

Returns the parameter value.

This interprets the XML parameter specification in order to do one of these things:

  • Calculate an equation result, if specified
  • Interpolate the value, if desired.
  • Just extract the value (perhaps the man or just the n-th position) and return that.
Parameters
logData:: Data in logfile
Returns
parameter value
Exceptions
InstrumentDefinitionErrorThrown if issues with the content of XML instrument definition file

Definition at line 90 of file XMLInstrumentParameter.cpp.

References Mantid::Kernel::Logger::error(), Mantid::Kernel::filterByStatistic(), Mantid::Kernel::Math::FirstValue, Mantid::Geometry::g_log, Mantid::Kernel::Math::LastValue, m_eq, m_extractSingleValueAs, m_formula, m_interpolation, m_logfileID, m_paramName, m_type, m_value, Mantid::Kernel::Math::Maximum, Mantid::Kernel::Math::Median, Mantid::Kernel::Math::Minimum, Mantid::Kernel::TimeSeriesProperty< TYPE >::nthValue(), position, and Mantid::Kernel::timeMean().

Member Data Documentation

◆ m_angleConvertConst

double Mantid::Geometry::XMLInstrumentParameter::m_angleConvertConst

when this const equals 1 it means that angle=degree (default) is set in IDF otherwise if this const equals 180/pi it means that angle=radian is set in IDF

Definition at line 84 of file XMLInstrumentParameter.h.

◆ m_component

const Geometry::IComponent* Mantid::Geometry::XMLInstrumentParameter::m_component

value from the log value

the component address

Definition at line 74 of file XMLInstrumentParameter.h.

Referenced by Mantid::API::ExperimentInfo::populateWithParameter().

◆ m_constraint

const std::vector<std::string> Mantid::Geometry::XMLInstrumentParameter::m_constraint

specific to fitting

Definition at line 57 of file XMLInstrumentParameter.h.

Referenced by Mantid::API::ExperimentInfo::populateWithParameter().

◆ m_description

const std::string Mantid::Geometry::XMLInstrumentParameter::m_description

if present, contains help string, describing the parameter

Definition at line 86 of file XMLInstrumentParameter.h.

Referenced by Mantid::API::ExperimentInfo::populateWithParameter(), and XMLInstrumentParameter().

◆ m_eq

const std::string Mantid::Geometry::XMLInstrumentParameter::m_eq

single value from the log file( average, first number, etc)

muParser equation to calculate the parameter

Definition at line 72 of file XMLInstrumentParameter.h.

Referenced by createParamValue().

◆ m_extractSingleValueAs

const std::string Mantid::Geometry::XMLInstrumentParameter::m_extractSingleValueAs

describes the way to extract a

Definition at line 69 of file XMLInstrumentParameter.h.

Referenced by createParamValue().

◆ m_fittingFunction

const std::string Mantid::Geometry::XMLInstrumentParameter::m_fittingFunction

specific to fitting parameter

Definition at line 61 of file XMLInstrumentParameter.h.

Referenced by Mantid::API::ExperimentInfo::populateWithParameter().

◆ m_formula

const std::string Mantid::Geometry::XMLInstrumentParameter::m_formula

specify fitting function

specific to fitting parameter. Specify

Definition at line 63 of file XMLInstrumentParameter.h.

Referenced by createParamValue(), and Mantid::API::ExperimentInfo::populateWithParameter().

◆ m_formulaUnit

const std::string Mantid::Geometry::XMLInstrumentParameter::m_formulaUnit

formula to use for setting this parameter

unit for formula (i.e. for Centre in formula)

Definition at line 65 of file XMLInstrumentParameter.h.

Referenced by Mantid::API::ExperimentInfo::populateWithParameter().

◆ m_interpolation

std::shared_ptr<Kernel::Interpolation> Mantid::Geometry::XMLInstrumentParameter::m_interpolation

evaluating the formula

specific to fitting parameter

Definition at line 68 of file XMLInstrumentParameter.h.

Referenced by createParamValue(), and Mantid::API::ExperimentInfo::populateWithParameter().

◆ m_logfileID

const std::string Mantid::Geometry::XMLInstrumentParameter::m_logfileID

logfile id

Definition at line 51 of file XMLInstrumentParameter.h.

Referenced by createParamValue().

◆ m_paramName

const std::string Mantid::Geometry::XMLInstrumentParameter::m_paramName

specify a value directly

parameter name

Definition at line 54 of file XMLInstrumentParameter.h.

Referenced by createParamValue().

◆ m_penaltyFactor

std::string Mantid::Geometry::XMLInstrumentParameter::m_penaltyFactor

parameter specify lower and upper bound in that order

specific to fitting parameter specify penalty factor

Definition at line 60 of file XMLInstrumentParameter.h.

Referenced by Mantid::API::ExperimentInfo::populateWithParameter().

◆ m_resultUnit

const std::string Mantid::Geometry::XMLInstrumentParameter::m_resultUnit

expected result (output) unit from

Definition at line 66 of file XMLInstrumentParameter.h.

Referenced by Mantid::API::ExperimentInfo::populateWithParameter().

◆ m_tie

const std::string Mantid::Geometry::XMLInstrumentParameter::m_tie

specific to fitting parameter specify any tie

Definition at line 56 of file XMLInstrumentParameter.h.

Referenced by Mantid::API::ExperimentInfo::populateWithParameter().

◆ m_type

const std::string Mantid::Geometry::XMLInstrumentParameter::m_type

type of the data, e.g. int, double or string

Definition at line 55 of file XMLInstrumentParameter.h.

Referenced by createParamValue(), and Mantid::API::ExperimentInfo::populateWithParameter().

◆ m_value

const std::string Mantid::Geometry::XMLInstrumentParameter::m_value

rather then extracting value from logfile,

Definition at line 52 of file XMLInstrumentParameter.h.

Referenced by createParamValue(), and Mantid::API::ExperimentInfo::populateWithParameter().

◆ m_visible

const std::string Mantid::Geometry::XMLInstrumentParameter::m_visible

if present, describes whether the parameter shall be visible in InstrumentViewer

Definition at line 88 of file XMLInstrumentParameter.h.

Referenced by Mantid::API::ExperimentInfo::populateWithParameter().


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