Ticket #966 (closed: fixed)

Opened 11 years ago

Last modified 5 years ago

Single peak and multi BG (multiple workspace) Fitting

Reported by: Nick Draper Owned by: Roman Tolchenov
Priority: major Milestone: Iteration 30
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Martyn Gigg

Description

Need to get more detail from Toby on this but this appears to be when you have several datasets and you want to optimise a single peak on each simultaneously while allowing separate background functions.

Change History

comment:1 Changed 11 years ago by Roman Tolchenov

  • Milestone changed from Iteration 21 to Iteration 22

comment:2 Changed 10 years ago by Nick Draper

  • Milestone changed from Iteration 26 to Iteration 27

Bulk move of tickets to iteration 27, if your ticket is essential for Iteration 26 then move it back.

comment:3 Changed 10 years ago by Nick Draper

  • Milestone changed from Iteration 27 to Iteration 28

Bulk move of tickets at the end of iteration 27

comment:4 Changed 9 years ago by Nick Draper

  • Milestone changed from Iteration 28 to Iteration 29

Bulk move of tickets at the end of iteration 28

comment:5 Changed 9 years ago by Nick Draper

  • Milestone changed from Iteration 29 to Iteration 30

"New" tickets moved at the code freeze of iteration 29

comment:6 Changed 9 years ago by Roman Tolchenov

  • Status changed from new to accepted
  • Component set to Mantid

comment:7 Changed 9 years ago by Roman Tolchenov

In [14319]:

Added MultiBG function for doing a multispectral fit. Updated FitPropertyBrowser to be able to use it. re #966

comment:8 Changed 9 years ago by Roman Tolchenov

In [14320]:

Trying to make rhel5 and macs happy. re #966

comment:9 Changed 9 years ago by Roman Tolchenov

In [14327]:

Trying to fix the tests. re #966

comment:10 Changed 9 years ago by Roman Tolchenov

In [14410]:

Implemented derivative calculation for MultiBG, changed many int to size_t in functions. re #966. Removed references to Workspace2D from API/CompositFunctionTest and API/FunctionTest, fixes #3653.

comment:2 Changed 9 years ago by Roman Tolchenov

In [14411]:

Fixing the linux. re #966

comment:3 Changed 9 years ago by Roman Tolchenov

In [14416]:

Hide the workspace index property if a function is fitted to all workspaces, re #966

comment:4 Changed 9 years ago by Mathieu Doucet

In [14430]:

Fixing warnings Re #966 and #3653

comment:3 Changed 9 years ago by Mathieu Doucet

In [14431]:

Fixing warnings Re #966 and #3653

comment:4 Changed 9 years ago by Mathieu Doucet

In [14432]:

Fixing warnings Re #966 and #3653

comment:5 Changed 9 years ago by Mathieu Doucet

In [14433]:

Fixing warnings Re #966 and #3653

comment:6 Changed 9 years ago by Mathieu Doucet

In [14435]:

Fixing warnings Re #966 and #3653

comment:7 Changed 9 years ago by Mathieu Doucet

In [14437]:

Fixing warnings Re #966 and #3653

comment:8 Changed 9 years ago by Mathieu Doucet

In [14439]:

Fixing warnings Re #966 and #3653

comment:9 Changed 9 years ago by Roman Tolchenov

In [14443]:

Fixed parameter tying in MultiBG. re #966

comment:10 Changed 9 years ago by Mathieu Doucet

In [14448]:

Fixing warnings Re #966 and #3653

comment:11 Changed 9 years ago by Roman Tolchenov

In [14521]:

Added a dialog for easier function creation. re #966

comment:12 Changed 9 years ago by Roman Tolchenov

In [14522]:

Fixing the test. re #966

comment:13 Changed 9 years ago by Mathieu Doucet

In [14559]:

Fix warnings... Re #966

comment:14 Changed 9 years ago by Mathieu Doucet

In [14560]:

Fix warnings... Re #966

comment:15 Changed 9 years ago by Roman Tolchenov

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

comment:16 Changed 9 years ago by Russell Taylor

In [14641]:

Remove member variable (and calls to it) as it wasn't doing anything anyway and was causing Mac compiler warnings. Re #966.

comment:17 Changed 9 years ago by Russell Taylor

In [14642]:

Clear Mac compiler warnings. Re #966.

comment:18 Changed 9 years ago by Vickie Lynch

  • Status changed from verify to verifying
  • Tester set to Vickie Lynch

comment:19 Changed 9 years ago by Vickie Lynch

  • Status changed from verifying to verify
  • Tester Vickie Lynch deleted

Can't get this to work

comment:20 Changed 9 years ago by Roman Tolchenov

To testers. It's easy:

  1. Load ~10 spectra from MUSR00015189.nxs
  2. Rebin to MUSR00015189_1 0,0.1,29
  3. Open the fit browser in MantidPlot.
  4. Select MUSR00015189_1 for fitting.
  5. Change function type from CompositeFunctionMW to MultiBG
  6. Add ExpDecay to Functions.
  7. Set the initial values: Height=400, Lifetime=2
  8. Right click on Functions and select Setup multifit
  9. Check the box against Lifetime in the dialog. This parameter will be global - the same for all spectra
  10. Press OK. The fit browser will be populated with copies of ExpDecay, one for each spectrum in the WS. All Lifetimes will be tied to f0.Lifetime.
  11. Click on Fit. Created output: MUSR00015189_1_NormalisedCovarianceMatrix, MUSR00015189_1_Parameters, MUSR00015189_1_Workspace, MUSR00015189_1_Param_series.

MUSR00015189_1_Workspace is a WorkspaceGroup, each member is similar to an output from a simple Fit

comment:21 Changed 9 years ago by Martyn Gigg

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

comment:22 Changed 9 years ago by Martyn Gigg

  • Status changed from verifying to reopened
  • Resolution fixed deleted

Observed a crash after following the above instructions which is related to the the algorithm notifications and threading issues.

comment:23 Changed 9 years ago by Roman Tolchenov

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

In [14845]:

Process multifit results in gui thread. fixes #966

comment:24 Changed 9 years ago by Martyn Gigg

  • Status changed from verify to verifying

comment:25 Changed 9 years ago by Martyn Gigg

Tried the same again and that looks much better and more responsive.

Also tried with larger and smaller data sets and it looked good.

I saw another crash though:

  • If you perform steps 1-5
  • Click addFunction and select MultiBG as the function type instead of ExpDecay
  • When you click okay you get a crash. Unfortunately it is the default so this is probably worth looking at. The stack trace is below. Basically it seems to be a problem in Mantid::CurveFitting::MultiBG::getWorkspace
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6d71b04 in shared_ptr<Mantid::API::MatrixWorkspace const> (this=0x7fffffffbf20, r=...)
    at /usr/include/boost/smart_ptr/shared_ptr.hpp:238
238	    : px( r.px ), pn( r.pn ) // never throws
(gdb) bt
#0  0x00007ffff6d71b04 in shared_ptr<Mantid::API::MatrixWorkspace const> (this=0x7fffffffbf20, r=...)
    at /usr/include/boost/smart_ptr/shared_ptr.hpp:238
#1  0x00007fffd56f5961 in Mantid::CurveFitting::MultiBG::getWorkspace (this=0x279b480)
    at /home/dmn58364/mantidproject/svn/trunk/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/MultiBG.h:62
#2  0x00007ffff65dccf4 in MantidQt::MantidWidgets::PropertyHandler::initWorkspace (this=0x29d45a0)
    at /home/dmn58364/mantidproject/svn/trunk/Code/Mantid/MantidQt/MantidWidgets/src/PropertyHandler.cpp:311
#3  0x00007ffff65db9cd in MantidQt::MantidWidgets::PropertyHandler::init (this=0x29d45a0)
    at /home/dmn58364/mantidproject/svn/trunk/Code/Mantid/MantidQt/MantidWidgets/src/PropertyHandler.cpp:127
#4  0x00007ffff6d5f683 in Mantid::API::IFitFunction::setHandler (this=0x279b590, handler=0x29d45b0)
    at /home/dmn58364/mantidproject/svn/trunk/Code/Mantid/Framework/API/src/IFitFunction.cpp:261
#5  0x00007ffff65dd927 in MantidQt::MantidWidgets::PropertyHandler::addFunction (this=0x174aa00, fnName=...)
    at /home/dmn58364/mantidproject/svn/trunk/Code/Mantid/MantidQt/MantidWidgets/src/PropertyHandler.cpp:435
#6  0x00007ffff65b2881 in MantidQt::MantidWidgets::FitPropertyBrowser::addFunction (this=0x1442040)
    at /home/dmn58364/mantidproject/svn/trunk/Code/Mantid/MantidQt/MantidWidgets/src/FitPropertyBrowser.cpp:539

comment:26 Changed 9 years ago by Martyn Gigg

  • Status changed from verifying to reopened
  • Resolution fixed deleted

comment:27 Changed 9 years ago by Roman Tolchenov

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

In [14848]:

Removed MultiBG from the function lists. fixes #966

comment:28 Changed 9 years ago by Martyn Gigg

  • Status changed from verify to verifying

comment:29 Changed 9 years ago by Martyn Gigg

  • Status changed from verifying to closed

Confirmed that the function has been removed, as it wasn't supposed to be there anyway, so the crash can no longer occur.

comment:30 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 1814

Note: See TracTickets for help on using tickets.