mantidproject / mantid

Main repository for Mantid code
https://www.mantidproject.org
GNU General Public License v3.0
211 stars 123 forks source link

Auto Switching in save options is not working as expected in ISIS SANS Reduction GUI #36115

Closed warunawickramasingha closed 9 months ago

warunawickramasingha commented 1 year ago

Describe the bug Please read this comment for the change required by this issue.

In ISIS SANS Reduction GUI, when switching the reduction options between 1D and 2D, the save options are expected to automatically switch between CanSAS and NXcanSAS. However after ticking and unticking RKH (1D/2D) option, the above behaviour is not observed

To Reproduce Steps to reproduce the behavior:

  1. Get the Training data from the downloads page on the Mantid Project website.
  2. Open Interfaces > SANS > ISIS SANS.
  3. Click Manage Directories. This opens Mantid’s main dialog for managing search paths. Ensure the Training data directory is in the search directories.
  4. If you haven’t set one up yet, add a folder to save test data into later.
  5. Set the default save directory in Manage Directories
  6. Click OK on the manage-directories dialog and ensure the Save Path on the SANS GUI (below batch file) displays the correct save path.
  7. Click Load User File; from the Training data in the loqdemo folder, choose MaskFile.toml.
  8. Click Load Batch File; from the Training data in the loqdemo folder, choose batch_mode_reduction.csv.
  9. Switch between 1D and 2D at the bottom of the screen, it should automatically switch between CanSAS and NXcanSAS
  10. tick and untick RKH option and observe step 9.

Expected behavior Switch between 1D and 2D, it should automatically switch between CanSAS and NXcanSAS

Platform/Version (please complete the following information):

rbauststfc commented 10 months ago

We should discuss this with SANS to confirm the expected behaviour before starting work on this.

warunawickramasingha commented 10 months ago

We should discuss this with SANS to confirm the expected behaviour before starting work on this.

This issue was raised while following the test instructions for https://developer.mantidproject.org/Testing/SANSGUI/ISISSANSGUITests.html#id4

rbauststfc commented 10 months ago

Note that it doesn't seem to be just selecting the RKH option that is the issue, but instead ticking and unticking any save file format option prevents the automatic selection of the default save file format. The current philosophy seems to be:

We have discussed this with SANS and the following approach is preferred in order to encourage users to take their data away in the most meaningful format:

The correct default file formats should be:

Select 1D: CanSAS1D & NXCanSAS Select 2D: NXcanSAS

After making these changes, we should update the manual testing instructions accordingly. I think that the existing instructions are actually quite open to interpretation (I would have assumed they were saying that ticking RKH meant that the correct behaviour was to stop automatic selection of the save file format), so we should be careful to ensure there isn't scope for confusion in the new instructions.

Additionally, we've been asked to update the documentation for the three save algorithms to help users select the correct one for their data. The following changes have been requested (suggestions highlighted using code markup):

SaveCanSAS1D Summary: “Save a MatrixWorkspace to a file in the canSAS1D XML format (for 1D data)Description: “Saves the given Matrix Workspace to a file in the canSAS1D XML format. This format is only intended to save 1D workspaces. If the workspace contains several spectra, two options are available: • if OneSpectrumPerFile if false (default value), all spectra will be appended into the same file (into different entries) • if OneSpectrumPerFile is true, each spectrum will be written in a separate file. The name of the file will be created as follows: ... The created file can be reloaded using the [LoadCanSAS1D v2](https://docs.mantidproject.org/nightly/algorithms/LoadCanSAS1D-v2.html#algm-loadcansas1d) algorithm.“

SaveNXcanSAS Summary: “Save a MatrixWorkspace to a file in the NXcanSAS format (for 1D/2D data)Description: “Saves a workspace with momentum transfer units into a file adhering to the NXcanSAS format specified by NXcanSAS Data Formats Working Group schema. 1D or 2D workspaces may be saved. If the input workspace is 2D then the vertical axis needs to be a numeric axis in momentum transfer units. The created file can be reloaded using the LoadNXcanSAS v1 algorithm.“

SaveRKH Summary: “Save a Matrix Workspace to a file in the ISIS RKH format (for 1D/2D data)Description: “Saves the given workspace to a file which will be formatted in one of the historic ISIS SANS (‘COLETTE’/‘FISH’) [data formats](https://www.isis.stfc.ac.uk/Pages/colette-ascii-file-format-descriptions.pdf) devised by Richard K Heenan. 1D or 2D workspaces may be saved. If a 1D workspace is ‘horizontal’ (a single spectrum) then the first column in the three column output will contain the X values of the spectrum (giving the bin centre if histogram data). For a ‘vertical’ (single column) 1D workspace, the first column of the file will contain the spectrum number. The created file can be reloaded using the LoadRKH v1 algorithm.

We could also consider adding to the InputWorkspace parameter descriptions in the documentation to make it clear what type of data should be in the input workspace.