Ticket #967 (closed: fixed)

Opened 11 years ago

Last modified 5 years ago

Instrument Parameter functions including simple formulas

Reported by: Nick Draper Owned by: Anders Markvardsen
Priority: critical Milestone: Iteration 22
Component: Keywords:
Cc: Blocked By:
Blocking: Tester:

Description (last modified by Nick Draper) (diff)

Target Date: 06/01/2010

Allow users to specify instrument level parameters (for things such as sigma in ikeda carpenter) as a function that can be evaluated when it is required. The user should be able to provide a single value or a function that will be used as a default value.

They should be able to enter the following:

  • Function
  • Parameter
  • formula (accept a single value as well)
  • Fixed (boolean default to false)
  • Max (use as a bounded constraint if entered)
  • Min (use as a bounded constraint if entered)
  • PenaltyFactor (use as a bounded constraint if entered)

The steps involved here are (with estimates)

  • define xml file format (2h)
  • LoadInstrument Changes (8h)
  • Calculate defaults for parameters in Function base class (8h)
  • Muparser function evaulation (4h)

Change History

comment:1 Changed 11 years ago by Nick Draper

  • Description modified (diff)
  • Summary changed from Instrument Parameter functions including unit conversion to Instrument Parameter functions including simple formulas

comment:2 Changed 11 years ago by Anders Markvardsen

(In [3757]) Adopt populateInstrumentParameters method across all the raw data file readers including also reading in values from the parameter 'value' tag. Refs #967.

comment:3 Changed 11 years ago by Anders Markvardsen

(In [3775]) Allow parameters of components to be looked up recursively. I.e. if parameter is not defined for component look up to see if defined for parent etc. Refs #967.

comment:4 Changed 11 years ago by Anders Markvardsen

(In [3781]) In previous commit to this ticket forgot to update test instrument definition file. Refs #967.

comment:5 Changed 11 years ago by Anders Markvardsen

(In [3783]) Change <parameter> notation from

<parameter name="x" logfile-id="trolley2_x_displacement" extract-single-value-as="position 1" />

to

<parameter name="x"> <logfile id="trolley2_x_displacement" extract-single-value-as="position 1" /> </parameter>

and e.g.

<parameter name="x" value="7.2" />

to

<parameter name="x"> <value= val="7.2" /> </parameter>

Refs #967.

comment:6 Changed 11 years ago by Martyn Gigg

(In [3787]) Revert last changes to SANS IDF as the file won't load and RKH needs it. Re #967

comment:7 Changed 11 years ago by Anders Markvardsen

(In [3790]) Corrected mistake added to POLREF_Definition (and SANS2D_Definition) and additional test to avoid a similar mistake in the future. Refs #967.

comment:8 Changed 11 years ago by Anders Markvardsen

(In [3796]) Removed code for old parameter notation, added code to handled reserved keywords, added further tests, and updated www.mantidproject.org/InstrumentDefinitionFile with description of updated parameter notation. Refs #967.

comment:9 Changed 11 years ago by Anders Markvardsen

(In [3818]) Added additional Ikeda Carpenter test on focussed data in preparation to adding value parameters to GEM instrument definition file. Refs #967.

comment:10 Changed 11 years ago by Nick Draper

  • Priority changed from major to critical

comment:11 Changed 11 years ago by Anders Markvardsen

(In [3905]) Modified Ikeda Carpenter test and corrected nexus file which was loaded with the wrong calibration file. Refs #967.

comment:12 Changed 11 years ago by Anders Markvardsen

(In [3912]) Tests to see that Ikeda Carpenter parameters specified in GEM IDF are read in. Refs #967.

comment:13 Changed 11 years ago by Anders Markvardsen

(In [3926]) Got Fit to 'speak to' parameters specified in IDF. Thanks to Roman and Russell for help in getting this to work. Refs #967.

comment:14 Changed 11 years ago by Anders Markvardsen

(In [3954]) Introduce the concept of FitParameter 'type' to workspace parameter map, which can hold information other than the value of the a fitting parameter. Refs #967.

comment:15 Changed 11 years ago by Anders Markvardsen

(In [3956]) Update Load tests in accordance with previous commit to this ticket. Refs #967.

comment:16 Changed 11 years ago by Anders Markvardsen

(In [3969]) Added the ability to fix fitting parameters specified in instrument definition files. Added tests to FitParameters. Tested this works params defined in GEM IDF. Refs #967.

comment:17 Changed 11 years ago by Anders Markvardsen

(In [3976]) When specifying fitting parameter now can associate fitting parameter with fitting function using notation

<parameter name="IkedaCarpenterPV:Alpha0" type="fitting"> <value val="0.734079"/> <fixed /> </parameter>

where IkedaCarpenterPV is the function the parameter is associated with. Wiki not updated yet. Refs #967.

comment:18 Changed 11 years ago by Anders Markvardsen

(In [3984]) Updated http://www.mantidproject.org/InstrumentDefinitionFile in connection with previous commit to this ticket. Allow parameter to be specified at instrument level and done this for the GEM instrument. Added more tests. Refs #967.

comment:19 Changed 11 years ago by Anders Markvardsen

(In [3994]) Allow <min> <max> to be specified for fitting parameters. Refs #967.

comment:20 Changed 11 years ago by Martyn Gigg

(In [3995]) Fix linux build and clear a few warnings regarding unused parameters. Re #967

comment:21 Changed 11 years ago by Anders Markvardsen

(In [4016]) Added interpolation class in preparation to read in tables from IDF. Added working Nexus test in IkedaCarpenterTest (possible now that workspace parameter map is loaded at the end of LoadInstrument). Refs #967.

comment:22 Changed 11 years ago by Anders Markvardsen

(In [4034]) The following look up table syntax now gets populated in the workspace parameter map

<parameter name="somefunction:toplevel2" type="fitting">

<lookuptable interpolation="linear" x-unit="TOF">

<point x="1" y="1" /> <point x="3" y="100" /> <point x="5" y="1120" /> <point x="10" y="1140" />

</lookuptable>

</parameter>

Refs #967.

comment:23 Changed 11 years ago by Anders Markvardsen

(In [4041]) Changed IFunction to update parameters also from look-up-table and for constraints defined in IDF. Put all UNIT TESTING instrument definition files into subdirectory of test/instrument.

Refs #967.

comment:24 Changed 11 years ago by Roman Tolchenov

(In [4043]) Modified Installer build script to ignore directories which names contain "UNIT_TESTING". re #967

comment:25 Changed 11 years ago by Anders Markvardsen

(In [4060]) More unit tests for fitting parameters in IDFs. Fixed problem with constraints not being added to parameter map.

Refs #967.

comment:26 Changed 11 years ago by Anders Markvardsen

(In [4072]) Code for unit conversion when look up table specified.

Refs #967.

comment:27 Changed 11 years ago by Anders Markvardsen

(In [4073]) Update broken test in connection with previous commit to this ticket.

Refs #967.

comment:28 Changed 11 years ago by Russell Taylor

(In [4074]) Fix test. Re #967.

comment:29 Changed 11 years ago by Anders Markvardsen

(In [4090]) Added more realistic test which test the unit conversion of look up tables. Start on allowing formula to IDF.

Refs #967.

comment:30 Changed 11 years ago by Anders Markvardsen

(In [4103]) Allow formula to be specified using notation:

<parameter name="somefunction:formula" type="fitting">

<formula eq="100.0+10*value+value2" unit="TOF"/>

</parameter>

Refs #967.

comment:31 Changed 11 years ago by Anders Markvardsen

(In [4112]) Added code which makes use of the optional formula unit attribute. Refs #967.

comment:32 Changed 11 years ago by Anders Markvardsen

(In [4131]) Fixed bug (located by Russell) when Nexus file is loaded containing fitting parameters. Refs #967.

comment:33 Changed 11 years ago by Anders Markvardsen

(In [4141]) Code in preparation for allowing percentage constraints and further unit testing of formulas. Refs #967.

comment:34 Changed 11 years ago by Anders Markvardsen

(In [4143]) Allow the following percentage notation

<parameter name="somefunction:Alpha" type="fitting">

<value val="250.0" /> <min val="80%"/> <max val="120%"/>

</parameter>

results in Alpha being constrained to sit between 250*0.8=200 and 250*1.20=300.

Wiki http://www.mantidproject.org/InstrumentDefinitionFile updated.

Refs #967.

comment:35 Changed 11 years ago by Anders Markvardsen

(In [4152]) Updated GEM_Definition.xml with Ikeda-Carpenter fitting parameter values according to values in IRF file generated 11/2003 by L. Chapon. Refs #967.

comment:36 Changed 11 years ago by Anders Markvardsen

  • Status changed from new to accepted

comment:37 Changed 11 years ago by Anders Markvardsen

  • Status changed from accepted to testing
  • Resolution set to fixed

comment:38 Changed 11 years ago by Anders Markvardsen

  • Status changed from testing to reopened
  • Resolution fixed deleted

comment:39 Changed 11 years ago by Anders Markvardsen

(In [4153]) In formula changed 'value' to 'centre' and updated wiki accordingly. In Interpolation when outside table interpolate linearly instead of then taking endpoints. Refs #967.

comment:40 Changed 11 years ago by Anders Markvardsen

(In [4156]) Fix test broken in previous commit to this ticket. Refs #967.

comment:41 Changed 11 years ago by Anders Markvardsen

  • Status changed from reopened to testing
  • Resolution set to fixed

comment:42 Changed 11 years ago by Roman Tolchenov

  • Status changed from testing to closed

comment:43 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 1815

Note: See TracTickets for help on using tickets.