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 editting 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 in exactly the same way as described in the parameters section of the IDF Page. 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’.
<?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">
<value val="2.082" />
</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