Ticket #1308 (closed: fixed)

Opened 10 years ago

Last modified 5 years ago

Handle units in return types of functions + lookups for parameters

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

Description

Add a result_unit parameter to the xml and if it is specified then we need to use it and the ConvertUnits code to convert the value through to the fitting unit.

we need to be able to handle these at least

  • TOF and other units
  • 1/TOF

Posibilities

  1. possibly use muparser to evaulate the math string, but first work out the conversion factor between the base units. That way we should even be able to handle 1/(TOF)2
  2. Handle the parsing yourself (not as good).

Change History

comment:1 Changed 10 years ago by Anders Markvardsen

(In [4952]) Code for processing result-unit in LoadInstrument and added boost build flag to VS. Refs #1308

comment:2 Changed 10 years ago by Anders Markvardsen

(In [4953]) Add processing for result-unit to FitParameter and add tests. Refs #1308

comment:3 Changed 10 years ago by Anders Markvardsen

(In [5007]) Allow y-unit syntax for interpolation elements of IDF. Add this concept to Interpolation and testing this. Added additional user warnings in case users do not specify units recognisable by mantid Updated result-units in HRPD_Parameters.xml.

Refs #1308

comment:4 Changed 10 years ago by Russell Taylor

(In [5009]) Revert qtiplot.pro changes, presumably checked-in in error. Re #1308.

comment:5 Changed 10 years ago by Anders Markvardsen

(In [5721]) Simplification in preparation to handle parameter unit conversion. re #1308

comment:6 Changed 10 years ago by Anders Markvardsen

(In [5789]) Implement rest for handling unit conversion for parameters. Added test and fitting BackToBackExponential to HRPD in different units gives the same result. Also updated wiki.

re #1308

comment:7 Changed 10 years ago by Anders Markvardsen

(In [5790]) This might make it build on the build server (removing an API::). re #1308

comment:8 Changed 10 years ago by Anders Markvardsen

(In [5793]) changed const double& to double (same or int) in argument list. maybe this will get the build to work?? re #1308.

comment:9 Changed 10 years ago by Roman Tolchenov

(In [5795]) Linux build fix. re #1308

comment:10 Changed 10 years ago by Anders Markvardsen

  • Status changed from new to accepted

comment:11 Changed 10 years ago by Anders Markvardsen

  • Status changed from accepted to verify

comment:12 Changed 10 years ago by Martyn Gigg

  • Status changed from verify to verifying
  • Tester set to Martyn Gigg

comment:13 Changed 10 years ago by Nick Draper

  • Resolution set to fixed

fill in missing resolution

comment:14 Changed 10 years ago by Martyn Gigg

  • Status changed from verifying to reopened
  • Resolution fixed deleted

comment:15 Changed 10 years ago by Anders Markvardsen

  • Status changed from reopened to accepted

comment:16 Changed 10 years ago by Anders Markvardsen

(In [5931]) Added unit to parameters for IkedaCarpenter function in GEM_Definition.xml.

Note that unit conversion is a bit more complicated for this function because we in that function calculate lambda values for each x-axis values. Hence in specifying the units for the IC parameters I have ignored units that refers to this lambda. This applies to two parameters. The true unit of Kappa is 1/[dSpacing2] however it is treated as dimensionless. The true unit of alpha1 is [TOF/dSpacing] however treated as it has unit TOF....

Tested that I could fit IC function for a peak in workspace index 1 of Test/Nexus/focussedGEM38370_TOF.nxs and same starting width when fitting in both d-spacing and TOF.

Also changed warning "IkedaCarpenterPV function should ONLY be used when working with x-axis unit = TOF" to information: "IkedaCarpenterPV function is perhaps best used when working with x-axis unit = TOF"

(Further work on IC needed. Tickets will be generated.)

Refs #1308.

comment:17 Changed 10 years ago by Anders Markvardsen

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

comment:18 Changed 10 years ago by Anders Markvardsen

(In [5933]) Fix broken test. Refs #1308.

comment:19 Changed 10 years ago by Anders Markvardsen

With reference to 3rd comment above and "(Further work on IC needed. Tickets will be generated.)". Tickets generated for this are #1546 and #1547.

comment:20 Changed 10 years ago by Martyn Gigg

  • Status changed from verify to verifying

comment:21 Changed 10 years ago by Martyn Gigg

  • Status changed from verifying to closed

Verified in [5943]

Confirmed for GEM and IkedaCarpenter that fit works when in units other than TOF.

comment:22 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 2155

Note: See TracTickets for help on using tickets.