Ticket #7734 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Extend FitMethod option for CalculateTransmission

Reported by: Gesner Passos Owned by: Gesner Passos
Priority: blocker Milestone: Release 3.0
Component: SANS Keywords:
Cc: Blocked By:
Blocking: #7733 Tester: Jay Rainey

Description

Current FitMethod can be Linear or Log.

Extend the list to: Linear, Log, Poly2, Poly3, Poly4, Poly5, Poly6.

Use the polynomial fit to fit for these options.

Change History

comment:1 Changed 7 years ago by Gesner Passos

  • Status changed from new to inprogress

Introduction of PolyX fit function to CalculateTransmission

re #7734

Changeset: 74c420da807498e1c1f371b347ac36d60739a607

comment:2 Changed 7 years ago by Russell Taylor

Re #7734. Resolve overload ambiguity on the Mac.

Changeset: b297661008f981a70dd1e7c534911bb202c8b8f3

comment:3 Changed 7 years ago by Gesner Passos

Change the CalculateTransmission parameter

Instead of having the FitMethod with PolyX, change it to Polinomial and add a new parameter PolynomialOrder to set up the order.

It may solve the building tests problem in mac os

re #7734

Changeset: e3d8fbe89facf52ae353367bd9ec1dd10effda1e

comment:4 Changed 7 years ago by Gesner Passos

Fix CalculateTransmission in mac os

Adding Levenberg-MarquardtMD minimizer to polynomial fit solves the issue of breaking the unit test inside mac os - snow leopard.

re #7734

Changeset: ccea205f4ffd3250fc30da96dd6ecc6f67dc6f4a

comment:5 Changed 7 years ago by Gesner Passos

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

Tester

Below you have a code that allows you to test CalculateTransmission. Change the FitMethod and PolynomialOrder as you like and check that the result is nice (plot out and out_fitted).

from mantid.simpleapi import * 
#prepare data to the input of CalculateTransmission
ws = LoadRaw("LOQ48097.raw", SpectrumMin=1, SpectrumMax=2);
ws = ConvertUnits(ws, Target="Wavelength")
m_dirWS = Rebin(ws, "6, 0.01, 7.5",OutputWorkspace="CalculateTransmissionTest_direct")
m_transWS = Rebin(ws, "7.5, 0.01, 9",OutputWorkspace="CalculateTransmissionTest_trans")
m_dirWS.setX(0, m_transWS.dataX(0))
m_dirWS.setX(1, m_transWS.dataX(0))
out = CalculateTransmission(m_transWS, m_dirWS, 1, 2, RebinParams="7.5, 0.1, 9",FitMethod='Polynomial', PolynomialOrder=4,OutputUnfittedData=True)

comment:6 Changed 7 years ago by Jay Rainey

  • Status changed from verify to verifying
  • Tester set to Jay Rainey

comment:7 Changed 7 years ago by Jay Rainey

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/feature/7734_polyn_trans_fit'

comment:8 Changed 7 years ago by Jay Rainey

Testing

  • The Fit method can now be a Polynomial as expected.
  • Tested using the above script (comment:5) by switching parameters of FitMethod and PolynomialOrder to ensure it works for all possible cases (and doesn't work for erroneous cases).
  • Tested on Ubuntu 12.04

Code review

  • Well written code and comments.

comment:9 Changed 7 years ago by Nick Draper

  • Component changed from Framework to SANS

comment:10 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8579

Note: See TracTickets for help on using tickets.