Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch Time of Flight units in Spectrum Viewer #2151

Merged
merged 12 commits into from
Apr 10, 2024

Conversation

MikeSullivan7
Copy link
Collaborator

@MikeSullivan7 MikeSullivan7 commented Mar 26, 2024

Issue

Closes #2097.

Description

In the Spectrum Viewer, the spectrum plot can be used in different Time of Flight related units, i.e. Neutron Energy, Neutron Wavelength via a right click menu. This menu is greyed out and the "Image Index" unit is selected with no viable sprectra.txt loaded.

image

Testing

make check

Acceptance Criteria

  • Load data in MI with a spectra file (e.g. Brass dataset)
  • Right click the spectrum plot and switch to the various units and check that the data displays correctly.
  • Move the range window around to check that the "Image index range" label under the plot responds appropriately. Also check that the averaged image in the image view behaves as expected.
  • Move the range window from its default position and change the selected unit, check that the range window resizes to the new unit range.
  • With the appropriate data loaded, check the Normalise to open beam checkbox and see if the plots display correctly.
  • Load any data without a spectra file and switch to that data via the Sample dropdown menu in the SV.
  • Check that the spectrum plot displays with the image index selected as the unit in the right click menu,. The right click menu should also be greyed out to prevent bugs.

Documentation

Added release notes

@coveralls
Copy link

coveralls commented Mar 26, 2024

Coverage Status

coverage: 73.956% (-0.3%) from 74.286%
when pulling 4eb97a0 on 2097_Tof_wavelength_plot
into b6087e8 on main.

@MikeSullivan7
Copy link
Collaborator Author

Comparing the results of MI to those published for the FE Powder:

Mantid Imaging

image

image

image

Published Data

image

image

Note: The position of the Bragg Peaks can move to higher or lower wavelength depending on the temperature of the sample. I dont know what temperature this example data was taken but the positions of the peaks look reasonable

@MikeSullivan7 MikeSullivan7 marked this pull request as ready for review April 5, 2024 14:20
@samtygier-stfc samtygier-stfc self-requested a review April 5, 2024 16:14
Copy link
Collaborator

@samtygier-stfc samtygier-stfc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. A few small code things.

mantidimaging/gui/windows/spectrum_viewer/model.py Outdated Show resolved Hide resolved
mantidimaging/gui/windows/spectrum_viewer/presenter.py Outdated Show resolved Hide resolved
mantidimaging/gui/windows/spectrum_viewer/view.py Outdated Show resolved Hide resolved
mantidimaging/core/utility/unit_conversion.py Show resolved Hide resolved
Copy link
Collaborator

@samtygier-stfc samtygier-stfc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small thing:
If I load 2 datasets, one with and one without spectra values, open the spectrum viewer, select an image stack with spectra, change to wavelength, then change the image stack to the one without. The axis label still says "Wave length"

Copy link
Collaborator

@samtygier-stfc samtygier-stfc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks

@samtygier-stfc samtygier-stfc added this pull request to the merge queue Apr 10, 2024
Merged via the queue into main with commit 5b827de Apr 10, 2024
8 checks passed
@samtygier-stfc samtygier-stfc deleted the 2097_Tof_wavelength_plot branch April 10, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Spectrum Viewer: Toggle Axis From ToF to Wavelength
3 participants