\(\renewcommand\AA{\unicode{x212B}}\)
Instrument parameter files are files complimentary to Instrument Definition Files (IDFs) that are used to store information about an instrument that may change on a regular basis i.e. parameters not related to the geometry of an instrument. By storing the data outside of the IDF, it makes it easier to locate and change parameters, as well as keeping the length of the IDF to a minimum.
To create a parameters file it is advisable to consult the parameter file schema, located in your mantid directory at mantidcodeinstrumentSchemaParameterFileSchema.xsd. Set up your editing program to validate your XML file against this schema following these instructions. Once set up, the schema can be used to find any errors in the structure of your parameter file and suggest auto-fill options to help write your parameter file.
The Instrument parameter files, like the IDFs, 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 IDF, 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. It is possible to also specify ‘visible’ attribute, which can used to define whether the parameter specified for the component is printed in the pick tab of the InstrumentViewer. 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’.
<?xml version="1.0" encoding="UTF-8" ?>
<parameter-file instrument="IN10" date="2010-07-15 00:00:00">
<component-link name="IN10">
<parameter name="analysis-type" type="string">
<value val="spectroscopy" />
</parameter>
</component-link>
<component-link name="silicon">
<parameter name="Efixed" visible="true">
<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>
</parameter-file>
There may be just one parameter file per instrument that is automatically included with name the form XXX_Parameters.xml, for instrument XXX in the instrument folder.
One can have several parameter files for an instrument:
Also one can use a any parameter file by executing the LoadParameterFile algorithm.
Work is planned to enable a parameter file to import one other parameter file. This will then enable duplication to be avoided in the parameter files.
Since version 3.2 of Mantid the algorithm SetInstrumentParameter allows you to create or replace instrument parameters for a particular workspace at run time.
Category: Concepts