Mantid
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
Mantid::Algorithms::CorelliCalibration::CalibrationTableHandler Class Reference

Class containing static and member methods to work with calibration table workspaces. More...

#include <CorelliCalibrationDatabase.h>

Public Member Functions

 CalibrationTableHandler ()
 Constructor. More...
 
DataObjects::TableWorkspace_sptr getCalibrationWorkspace ()
 Get calibration workspace. More...
 
ComponentPosition getComponentCalibratedPosition (const std::string &component)
 Get the calibration of a component. More...
 
std::vector< std::string > getComponentNames ()
 Get component name from the table. More...
 
void saveCalibrationTable (const std::string &filename)
 Save the calibration table (of a single date) More...
 
DataObjects::TableWorkspace_sptr saveCompomentDatabase (const std::string &datestamp, const std::string &component, const std::string &filename)
 Save a single component in the calibration workspace. More...
 
void setCalibrationTable (const DataObjects::TableWorkspace_sptr &calibws)
 Set calibration table file. More...
 

Static Public Member Functions

static void appendCalibration (const DataObjects::TableWorkspace_sptr &tablews, const std::string &datestamp, const ComponentPosition &pos)
 Append a new row to single component calibration table. More...
 
static DataObjects::TableWorkspace_sptr createCalibrationTableWorkspace (const std::string &wsname, bool iscomponent)
 Create a calibration TableWorkspace from scratch for either single component or full set of components. More...
 
static ComponentPosition getCalibratedPosition (const DataObjects::TableWorkspace_sptr &componentcaltable, size_t rownumber)
 Get the calibration position in the table (component table or full calibration table) More...
 
static ComponentPosition getLatestCalibratedPosition (const DataObjects::TableWorkspace_sptr &componentcaltable)
 Get the last entry (latest update) of a compoent calibrated position. More...
 
static bool isValidCalibrationTableWorkspace (const DataObjects::TableWorkspace_sptr &calibws, std::string &errormsg)
 Check whether a TableWorkspace is a valid Corelli geometry calibration table for all components. More...
 
static DataObjects::TableWorkspace_sptr loadComponentCalibrationTable (const std::string &filename, const std::string &tablewsname)
 Load a single-component calibration table. More...
 

Private Attributes

bool isSingleComponentTable
 
DataObjects::TableWorkspace_sptr mCalibWS
 

Detailed Description

Class containing static and member methods to work with calibration table workspaces.

Definition at line 47 of file CorelliCalibrationDatabase.h.

Constructor & Destructor Documentation

◆ CalibrationTableHandler()

Mantid::Algorithms::CorelliCalibration::CalibrationTableHandler::CalibrationTableHandler ( )

Constructor.

CalibrationTableHandler constructor.

Definition at line 48 of file CorelliCalibrationDatabase.cpp.

Member Function Documentation

◆ appendCalibration()

void Mantid::Algorithms::CorelliCalibration::CalibrationTableHandler::appendCalibration ( const DataObjects::TableWorkspace_sptr tablews,
const std::string &  datestamp,
const ComponentPosition pos 
)
static

◆ createCalibrationTableWorkspace()

DataObjects::TableWorkspace_sptr Mantid::Algorithms::CorelliCalibration::CalibrationTableHandler::createCalibrationTableWorkspace ( const std::string &  wsname,
bool  iscomponent 
)
static

Create a calibration TableWorkspace from scratch for either single component or full set of components.

Create an empty calibration table (multi-component) or an emtpy history-of-compoment-positions table.

Parameters
wsnameworkspace name. If we pass a name, then register the table in the Analysis Data Service
iscomponentif True, then create a history-of-compoment-positions table, otherwise a calibration table
Returns
shared pointer to the table workspace

Definition at line 62 of file CorelliCalibrationDatabase.cpp.

References Mantid::Algorithms::CorelliCalibration::calibrationTableColumnNames, Mantid::Algorithms::CorelliCalibration::calibrationTableColumnTypes, and Mantid::Kernel::SingletonHolder< T >::Instance().

Referenced by Mantid::Algorithms::CorelliCalibrationDatabase::createOutputCalibrationTable(), and saveCompomentDatabase().

◆ getCalibratedPosition()

ComponentPosition Mantid::Algorithms::CorelliCalibration::CalibrationTableHandler::getCalibratedPosition ( const DataObjects::TableWorkspace_sptr componentcaltable,
size_t  rownumber 
)
static

◆ getCalibrationWorkspace()

DataObjects::TableWorkspace_sptr Mantid::Algorithms::CorelliCalibration::CalibrationTableHandler::getCalibrationWorkspace ( )
inline

Get calibration workspace.

Definition at line 85 of file CorelliCalibrationDatabase.h.

◆ getComponentCalibratedPosition()

ComponentPosition Mantid::Algorithms::CorelliCalibration::CalibrationTableHandler::getComponentCalibratedPosition ( const std::string &  component)

◆ getComponentNames()

std::vector< std::string > Mantid::Algorithms::CorelliCalibration::CalibrationTableHandler::getComponentNames ( )

Get component name from the table.

Get component names of the table workspace.

the component names are the first column of the table

Exceptions
std::runtime_errorfor single-component tables
Returns
names as a vector or strings

Definition at line 180 of file CorelliCalibrationDatabase.cpp.

References isSingleComponentTable, and mCalibWS.

◆ getLatestCalibratedPosition()

ComponentPosition Mantid::Algorithms::CorelliCalibration::CalibrationTableHandler::getLatestCalibratedPosition ( const DataObjects::TableWorkspace_sptr componentcaltable)
static

Get the last entry (latest update) of a compoent calibrated position.

Definition at line 332 of file CorelliCalibrationDatabase.cpp.

References getCalibratedPosition().

Referenced by Mantid::Algorithms::CorelliCalibrationDatabase::createOutputCalibrationTable().

◆ isValidCalibrationTableWorkspace()

bool Mantid::Algorithms::CorelliCalibration::CalibrationTableHandler::isValidCalibrationTableWorkspace ( const DataObjects::TableWorkspace_sptr calibws,
std::string &  errormsg 
)
static

Check whether a TableWorkspace is a valid Corelli geometry calibration table for all components.

Check whether a TableWorkspace is a valid Corelli calibration table for all components.

Cheks performed are correct number of columns and columns names

Parameters
calibwsCalibration table workspace
errormsg(output) error message
Returns

Definition at line 101 of file CorelliCalibrationDatabase.cpp.

References Mantid::Algorithms::CorelliCalibration::calibrationTableColumnNames.

Referenced by setCalibrationTable(), and Mantid::Algorithms::CorelliCalibrationDatabase::validateInputs().

◆ loadComponentCalibrationTable()

DataObjects::TableWorkspace_sptr Mantid::Algorithms::CorelliCalibration::CalibrationTableHandler::loadComponentCalibrationTable ( const std::string &  filename,
const std::string &  tablewsname 
)
static

◆ saveCalibrationTable()

void Mantid::Algorithms::CorelliCalibration::CalibrationTableHandler::saveCalibrationTable ( const std::string &  filename)

Save the calibration table (of a single date)

Save full calibration table to a database (CSV) file.

Parameters
filename

Definition at line 317 of file CorelliCalibrationDatabase.cpp.

References Mantid::Kernel::SingletonHolder< T >::Instance(), and mCalibWS.

Referenced by Mantid::Algorithms::CorelliCalibrationDatabase::saveCalibrationTable().

◆ saveCompomentDatabase()

TableWorkspace_sptr Mantid::Algorithms::CorelliCalibration::CalibrationTableHandler::saveCompomentDatabase ( const std::string &  datestamp,
const std::string &  component,
const std::string &  filename 
)

Save a single component in the calibration workspace.

Save a specific component to database (csv) file.

Extract the position of a specific component from the full calibration table, and append to a database file. If the database file does not exits, then create it.

Parameters
datestampYYYYMMDD date stamp
componentcomponent name
filenamefull path of the database file for the specific component
Returns
table of history of positions for the specific component

Definition at line 274 of file CorelliCalibrationDatabase.cpp.

References appendCalibration(), createCalibrationTableWorkspace(), getComponentCalibratedPosition(), Mantid::Kernel::SingletonHolder< T >::Instance(), and loadComponentCalibrationTable().

Referenced by Mantid::Algorithms::CorelliCalibrationDatabase::updateComponentDatabaseFiles().

◆ setCalibrationTable()

void Mantid::Algorithms::CorelliCalibration::CalibrationTableHandler::setCalibrationTable ( const DataObjects::TableWorkspace_sptr calibws)

Set calibration table file.

Set a valid calibration table to the handler.

This cannot be a table for history-of-component-positions, but a calibration table.

Parameters
calibws

Definition at line 160 of file CorelliCalibrationDatabase.cpp.

References isValidCalibrationTableWorkspace(), and mCalibWS.

Referenced by Mantid::Algorithms::CorelliCalibrationDatabase::createOutputCalibrationTable(), Mantid::Algorithms::CorelliCalibrationDatabase::saveCalibrationTable(), and Mantid::Algorithms::CorelliCalibrationDatabase::updateComponentDatabaseFiles().

Member Data Documentation

◆ isSingleComponentTable

bool Mantid::Algorithms::CorelliCalibration::CalibrationTableHandler::isSingleComponentTable
private

Definition at line 95 of file CorelliCalibrationDatabase.h.

Referenced by getComponentNames().

◆ mCalibWS

DataObjects::TableWorkspace_sptr Mantid::Algorithms::CorelliCalibration::CalibrationTableHandler::mCalibWS
private

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