Commit 53be8e17 authored by Mathieu Tillet's avatar Mathieu Tillet
Browse files

Tidying and small improvements of the code and doc

parent 00768187
......@@ -46,7 +46,7 @@ private:
void loadData();
void loadMetaData();
void loadInstrument(API::MatrixWorkspace_sptr, std::string);
void loadInstrument(API::MatrixWorkspace_sptr, const std::string &);
std::vector<double> loadTwoThetaDetectors(const API::MatrixWorkspace_sptr,
const NeXus::NXEntry &, const int);
std::vector<double> loadBankParameters(const API::MatrixWorkspace_sptr,
......
......@@ -326,7 +326,7 @@ LoadILLPolarizedDiffraction::initStaticWorkspace(const NXEntry &entry) {
* @param startTime :: the date the run started, in ISO compliant format
*/
void LoadILLPolarizedDiffraction::loadInstrument(
API::MatrixWorkspace_sptr workspace, std::string startTime) {
API::MatrixWorkspace_sptr workspace, const std::string &startTime) {
// the start time is needed in the workspace when loading the parameter file
workspace->mutableRun().addProperty("start_time", startTime);
......
......@@ -2298,7 +2298,7 @@ void InstrumentDefinitionParser::setLogfile(
if (numberValueEle >= 1) {
bool hasValue = false;
for (unsigned long i = 0; i < numberValueEle; i++) {
for (unsigned long i = 0; i < numberValueEle; ++i) {
pValueElem = static_cast<Element *>(pNLvalue->item(i));
if (!pValueElem->hasAttribute(("val")))
......@@ -2528,8 +2528,8 @@ void InstrumentDefinitionParser::setLogfile(
*\<component-link\> elements
* @param progress :: Optional progress object for reporting progress to an
*algorithm
* @param requestedDate :: Date against which to check the validity of an IPF
*parameter
* @param requestedDate :: Optional Date against which to check the validity of
*an IPF parameter
*/
void InstrumentDefinitionParser::setComponentLinks(
std::shared_ptr<Geometry::Instrument> &instrument,
......
......@@ -23,8 +23,8 @@ General Structure
~~~~~~~~~~~~~~~~~
The Instrument parameter files, like the :ref:`IDFs<InstrumentDefinitionFile>`, are written in XML. They must contain a root element <parameter-file> with an attribute 'name' equal to the name of the instrument. Within the <parameter-file> element, goes all the rest of the information. To specify a parameter for a component defined the :ref:`IDF<InstrumentDefinitionFile>`, use a <component-link> element with attribute 'name' equal to the name of the component. Within the <component-link> element, the various parameters can be defined mostly in the same way as described in the parameters section of the IDF Page.
The only difference is that it is possible to set multiple values for a parameter, each one with a defined time range, using the format "<value val="" valid-from="YYYY-MM-DDTHH:mm:SS" valid-to="YYYY-MM-DDTHH:mm:SS"\>".
The below example shows some of the elements featured in IN10_silicon_111_Parameters.xml. It defines a parameter 'analysis-type' for the component IN10 i.e. the whole instrument. The component link is closed and then a new one is opened to define parameters for the component 'silicon'.
It is possible to set multiple values for a parameter, each one with a defined time range.
The below example shows some of the elements featured in IN10_silicon_111_Parameters.xml, slightly modified. It defines a parameter 'analysis-type' for the component IN10 i.e. the whole instrument. The component link is closed and then a new one is opened to define parameters for the component 'silicon'.
.. code-block:: xml
......@@ -40,7 +40,9 @@ The below example shows some of the elements featured in IN10_silicon_111_Parame
<component-link name="silicon">
<parameter name="Efixed">
<value val="2.082" />
<value val="2.0" valid-to="2011-12-31T23:59:59"/>
<value val="2.082" valid-from="2012-01-01T00:00:00" valid-to="2012-12-31T23:59:59"/>
<value val="3.0" valid-from="2013-01-01T00:00:00"/>
</parameter>
</component-link>
......
......@@ -12,6 +12,11 @@ Framework Changes
Concepts
--------
Improvements
############
- Added a feature allowing time-dependent values for individual instrument parameters.
Algorithms
----------
......
......@@ -22,7 +22,6 @@ Improvements
- Add the possibility to copy and paste shapes in the instrument viewer using Ctrl + C and Ctrl + V.
- Powder diffraction support (instruments D2B and D20) has been added to DrILL interface. See
:ref:`DrILL documentation <DrILL-ref>` for more information.
- Allow to set multiple values for a parameter in an instrument parameter file, and to define a time validity range for each one.
Bugfixes
......
<?xml version="1.0" encoding="UTF-8" ?>
<parameter-file instrument="IDF_for_UNIT_TESTING2" valid-from="blah...">
<parameter-file instrument="IDF_for_UNIT_TESTING2">
<component-link name="IDF_for_UNIT_TESTING2.xml/combined translation6" >
<parameter name="date-most-recent">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment