Ticket #9492 (closed: fixed)

Opened 6 years ago

Last modified 5 years ago

Complain about units when fitting

Reported by: Anders Markvardsen Owned by: Arturs Bekasovs
Priority: major Milestone: Release 3.2
Component: Muon Keywords:
Cc: adrian.hillier@… Blocked By:
Blocking: Tester: Anders Markvardsen

Description

  1. Open MuonAnalysis interface
  1. Browse and plot AutoTestData\MUSR00015189.nxs
  1. Go to Data Analysis tab and fit anything to this data

and you get the warning

You are overlaying plots from data having differing units!

Hence something appear not right with the units for the muonanalysis interface produced plots. Tested this and this is only for plots produced by this interface.

Perhaps the fix to #9491 will also fix this bug

Attachments

9492.py (203 bytes) - added by Arturs Bekasovs 6 years ago.
Script to create test workspaces

Change History

comment:1 Changed 6 years ago by Nick Draper

  • Status changed from new to assigned

comment:2 Changed 6 years ago by Arturs Bekasovs

  • Owner changed from Anders Markvardsen to Arturs Bekasovs

comment:3 Changed 6 years ago by Arturs Bekasovs

  • Status changed from assigned to inprogress

Refs #9492. Set set correct Y unit for the MantidMatrixCurve

It was being set to getAxis(1)->unit() before, which isn't really a Y axis, but rather "Z" axis, used in 2D plots. "Z" axis was actually different in a fitted ws (hence the warning), but it isn't used for 1D plots, so it shouldn't matter.

Changeset: fc80bf6f93c20bfac9ef7eb04af03965cdc9380e

comment:4 Changed 6 years ago by Arturs Bekasovs

Tester:

First, check that there is no warning any more.

Then try the following:

  1. Run the attached script. 4 workspaces should be created:
    • tof_counts - Counts against Time of Flight
    • tof_count_2 - Same as previous, but different file
    • tof_myunits - Custom units against Time of Flight
    • dspacing_counts - Counts against dSpacing
  1. Create a plot of any spectrum for each one of those workspaces. Verify that all the axis titles are set correctly according to what is shown in the Workspace dock.
  1. By dragging and dropping spectra from workspaces to different plots, verify that the warning is shown only when at least one of the axis of the new curve is different to the one of the plot.

The change looks pretty core, but in reality the only place where units of MantidMatrixCurve are used is for that comparison. The actual plot unit setting is done using either PlotAxis or QwtWorkspace[Spectrum|Bin]Data which both use the correct methods for getting the units. Please do a code-review to make sure I am correct about this. In particular, plotting methods of MantidUI.

Last edited 6 years ago by Arturs Bekasovs (previous) (diff)

comment:5 Changed 6 years ago by Arturs Bekasovs

Refs #9492. Add a few comments

Changeset: 15fe471d6f78386f0602f4e9f14a5e86689a0a00

comment:6 Changed 6 years ago by Arturs Bekasovs

Refs #9492. Compare Y units by caption instead of unitID

Y units are always of type Label, hence unitID will always be the same

Changeset: c888f5ca3b3832e05c8b26208e934d8531ae3998

Changed 6 years ago by Arturs Bekasovs

Script to create test workspaces

comment:7 Changed 6 years ago by Arturs Bekasovs

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

comment:8 Changed 6 years ago by Anders Markvardsen

  • Status changed from verify to verifying
  • Tester set to Anders Markvardsen

comment:9 Changed 6 years ago by Anders Markvardsen

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/bugfix/9492_fit_units_warning'

Full changeset: b6c9236da4d1fc6d5ca81d7044f1842919e2dfbd

comment:10 Changed 6 years ago by Anders Markvardsen

Warning presented when units different only. Addtional comment added in general and to explain code changes made

comment:11 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 10335

Note: See TracTickets for help on using tickets.