Mantid
|
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 |
Class containing static and member methods to work with calibration table workspaces.
Definition at line 47 of file CorelliCalibrationDatabase.h.
Mantid::Algorithms::CorelliCalibration::CalibrationTableHandler::CalibrationTableHandler | ( | ) |
Constructor.
CalibrationTableHandler constructor.
Definition at line 48 of file CorelliCalibrationDatabase.cpp.
|
static |
Append a new row to single component calibration table.
Append a new dated position to the table of history of positions.
tablews | table workspace |
datestamp | a day-stamp with format YYYYMMDD |
pos | location and orientation of the component |
Definition at line 142 of file CorelliCalibrationDatabase.cpp.
References Mantid::Algorithms::CorelliCalibration::calibrationTableColumnNames, Mantid::Algorithms::CorelliCalibration::ComponentPosition::rotAngle, Mantid::Algorithms::CorelliCalibration::ComponentPosition::x, Mantid::Algorithms::CorelliCalibration::ComponentPosition::xCosine, Mantid::Algorithms::CorelliCalibration::ComponentPosition::y, Mantid::Algorithms::CorelliCalibration::ComponentPosition::yCosine, Mantid::Algorithms::CorelliCalibration::ComponentPosition::z, and Mantid::Algorithms::CorelliCalibration::ComponentPosition::zCosine.
Referenced by Mantid::Algorithms::CorelliCalibrationDatabase::createOutputCalibrationTable(), and saveCompomentDatabase().
|
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.
wsname | workspace name. If we pass a name, then register the table in the Analysis Data Service |
iscomponent | if True, then create a history-of-compoment-positions table, otherwise a calibration table |
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().
|
static |
Get the calibration position in the table (component table or full calibration table)
Definition at line 342 of file CorelliCalibrationDatabase.cpp.
References Mantid::Algorithms::CorelliCalibration::ComponentPosition::rotAngle, Mantid::Algorithms::CorelliCalibration::ComponentPosition::x, Mantid::Algorithms::CorelliCalibration::ComponentPosition::xCosine, Mantid::Algorithms::CorelliCalibration::ComponentPosition::y, Mantid::Algorithms::CorelliCalibration::ComponentPosition::yCosine, Mantid::Algorithms::CorelliCalibration::ComponentPosition::z, and Mantid::Algorithms::CorelliCalibration::ComponentPosition::zCosine.
Referenced by getLatestCalibratedPosition().
|
inline |
Get calibration workspace.
Definition at line 85 of file CorelliCalibrationDatabase.h.
ComponentPosition Mantid::Algorithms::CorelliCalibration::CalibrationTableHandler::getComponentCalibratedPosition | ( | const std::string & | component | ) |
Get the calibration of a component.
extract the location and orientation for one of the components in a calibration table
component |
Definition at line 198 of file CorelliCalibrationDatabase.cpp.
References mCalibWS, Mantid::Algorithms::CorelliCalibration::ComponentPosition::rotAngle, Mantid::Algorithms::CorelliCalibration::ComponentPosition::x, Mantid::Algorithms::CorelliCalibration::ComponentPosition::xCosine, Mantid::Algorithms::CorelliCalibration::ComponentPosition::y, Mantid::Algorithms::CorelliCalibration::ComponentPosition::yCosine, Mantid::Algorithms::CorelliCalibration::ComponentPosition::z, and Mantid::Algorithms::CorelliCalibration::ComponentPosition::zCosine.
Referenced by saveCompomentDatabase().
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
std::runtime_error | for single-component tables |
Definition at line 180 of file CorelliCalibrationDatabase.cpp.
References isSingleComponentTable, and mCalibWS.
|
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().
|
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
calibws | Calibration table workspace |
errormsg | (output) error message |
Definition at line 101 of file CorelliCalibrationDatabase.cpp.
References Mantid::Algorithms::CorelliCalibration::calibrationTableColumnNames.
Referenced by setCalibrationTable(), and Mantid::Algorithms::CorelliCalibrationDatabase::validateInputs().
|
static |
Load a single-component calibration table.
Definition at line 240 of file CorelliCalibrationDatabase.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance().
Referenced by Mantid::Algorithms::CorelliCalibrationDatabase::loadNonCalibratedComponentDatabase(), and saveCompomentDatabase().
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.
filename |
Definition at line 317 of file CorelliCalibrationDatabase.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance(), and mCalibWS.
Referenced by Mantid::Algorithms::CorelliCalibrationDatabase::saveCalibrationTable().
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.
datestamp | YYYYMMDD date stamp |
component | component name |
filename | full path of the database file 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().
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.
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().
|
private |
Definition at line 95 of file CorelliCalibrationDatabase.h.
Referenced by getComponentNames().
|
private |
Definition at line 94 of file CorelliCalibrationDatabase.h.
Referenced by getComponentCalibratedPosition(), getComponentNames(), saveCalibrationTable(), and setCalibrationTable().