Ticket #6716 (closed: fixed)
ThermalNuetronBk2BkExpConvPV throws unexpected exception when used among fit functions
Reported by: | Alex Buts | Owned by: | Wenduo Zhou |
---|---|---|---|
Priority: | major | Milestone: | Release 2.5 |
Component: | Mantid | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Tester: | Alex Buts |
Description (last modified by Alex Buts) (diff)
If one tries to look at ThermalNuetronBk2BkExpConvPV using fit functions interface:
1)View->fit function
2)Load WB vanadium and look at monitor spectra (do not think it is essential but who knows) The WB spectra on monitor looks similar to the one, described in the wiki.
3)Functions->Add Function ->ThermalNuetronBk2BkExpConvPVogit
4) Set up ws fitting ranges and ws spectra
5) Setup-> find peak.
Throws scary exception:
Unexpected exception: ThermalNuetronBk2BkExpConvPV: do not allow to set peak's centre
is thrown.
The function should either accept setting peaks (preferably) or handle unexpected situation more gently
Unexpected exception: ThermalNuetronBk2BkExpConvPV: do not allow to set peak's centre
Apparently this function needs a method, which allows to set pulse centre
It may be wiki is confusing but working with this function from fitting interface generates the range of problems
1) needed -- safeguards for fitting interface. 2) sample of parameters, which would allow to see something on the plot. 3) some modifications of the wiki page, which allows to relate the parameters from the table to the parameters from the formula. In addition, there is "Sigma and Gamma " statements under the formula, but only Sigma can be identified from the formula.
Change History
comment:3 Changed 8 years ago by Wenduo Zhou
ThermalNeutronBk2BkExpConvPVoigt is implemented for fitting all peaks in one diffraction pattern by one peak function. Therefore, it is not practical to use it to fit a single function.
I modified the wiki page of this function in order to prevent confusion. http://www.mantidproject.org/ThermalNeutronBk2BkExpConvPVoigt
As peak position is a function of a subset of this peak's parameters, it is not allowed to set peak centre explicitly. Therefore, the virtual function setCentr() is set to private.
If you want to test this function in MantidPlot's fit GUI, you can get the data and parameters value from its unit test.
comment:4 Changed 8 years ago by Wenduo Zhou
- Status changed from accepted to verify
- Resolution set to fixed
comment:5 Changed 8 years ago by Alex Buts
- Status changed from verify to verifying
- Tester set to Alex Buts
comment:6 Changed 8 years ago by Alex Buts
- Status changed from verifying to reopened
- Resolution fixed deleted
The Wiki is much better and have a lot of information, though the code has not been changed.
The function is available in GUI and throws Unexpected exception which it should not do.
E.G.: Error in execution of algorithm Fit: Levenberg-Marquardt minimizer failed to initialize. 16 data points, 24 fitting parameters. Unexpected exception: ThermalNuetronBk2BkExpConvPV: do not allow to set peak's centre close mantid/Continue working. -> Continue working Unexpected exception: Unable to set FWHM close mantid/Continue working. -> Continue working
I have discussion with the group and the management and they say it should not do it. If one does not want to use peak function methods one should inherit from background.
The function should be either inaccessible or report errors without throwing top level exception. Just telling in wiki that people should not use it from Fit interface is not enough. People do not read wiki without a reason.
comment:8 Changed 8 years ago by Wenduo Zhou
Make function not to inherit from IPeakFunction. Refs #6716.
Changeset: a0a76f5b1c618bbc25e36701f81049ab8ebfea97
comment:9 Changed 8 years ago by Wenduo Zhou
Make function not to inherit from IPeakFunction. Refs #6716.
Changeset: a0a76f5b1c618bbc25e36701f81049ab8ebfea97
comment:10 Changed 8 years ago by Wenduo Zhou
Change category to general. Refs #6716.
Changeset: 7521ce7b3d2b0f046c4c1fab0ef7659af8dd922b
comment:11 Changed 8 years ago by Wenduo Zhou
Change category to general. Refs #6716.
Changeset: 7521ce7b3d2b0f046c4c1fab0ef7659af8dd922b
comment:12 Changed 8 years ago by Wenduo Zhou
ThermalNeutronBk2BkExpConvPVoigt is not a regular peak function to be used in Mantid fit GUI. Therefore, it is not an IPeakFunction. To solve the issue reported by this ticket, the best solution is to make it not to inherit from IPeakFunction.
comment:13 Changed 8 years ago by Wenduo Zhou
- Status changed from accepted to verify
- Resolution set to fixed
comment:15 Changed 8 years ago by Alex Buts
- Status changed from verifying to closed
works fine. No problem with unexpected exception experienced.
comment:16 Changed 8 years ago by Wenduo Zhou
Make function not to inherit from IPeakFunction. Refs #6716.
Changeset: 194253a2ea00b1f82bdf1e5f8217db03a606c029
comment:17 Changed 8 years ago by Wenduo Zhou
Change category to general. Refs #6716.
Changeset: bf3ba171090ed3299a52f253e776348146125197
comment:18 Changed 8 years ago by Wenduo Zhou
Make function not to inherit from IPeakFunction. Refs #6716.
Changeset: 194253a2ea00b1f82bdf1e5f8217db03a606c029
comment:19 Changed 8 years ago by Wenduo Zhou
Change category to general. Refs #6716.
Changeset: bf3ba171090ed3299a52f253e776348146125197
comment:20 Changed 8 years ago by Wenduo Zhou
Make function not to inherit from IPeakFunction. Refs #6716.
Changeset: 194253a2ea00b1f82bdf1e5f8217db03a606c029
comment:21 Changed 8 years ago by Wenduo Zhou
Change category to general. Refs #6716.
Changeset: bf3ba171090ed3299a52f253e776348146125197
comment:22 Changed 7 years ago by Wenduo Zhou
Make function not to inherit from IPeakFunction. Refs #6716.
Changeset: 194253a2ea00b1f82bdf1e5f8217db03a606c029
comment:23 Changed 7 years ago by Wenduo Zhou
Change category to general. Refs #6716.
Changeset: bf3ba171090ed3299a52f253e776348146125197
comment:24 Changed 7 years ago by Wenduo Zhou
Make function not to inherit from IPeakFunction. Refs #6716.
Changeset: 194253a2ea00b1f82bdf1e5f8217db03a606c029
comment:25 Changed 7 years ago by Wenduo Zhou
Change category to general. Refs #6716.
Changeset: bf3ba171090ed3299a52f253e776348146125197
comment:26 Changed 5 years ago by Stuart Campbell
This ticket has been transferred to github issue 7562