mantidproject / mslice

Source code for Mantid MSlice
http://mantidproject.github.io/mslice
1 stars 2 forks source link

Support saving of NXSPE files #896

Closed robertapplin closed 1 year ago

robertapplin commented 1 year ago

Description of work: This PR fixes an issue where the metadata for a workspace based off the NXSPE file format was not being saved correctly. Previously, we were using the SaveNexus file to save the NXSPE workspace, however we should have been using SaveNXSPE to ensure all the correct metadata gets saved.

It was decided that we would not add an explicit option to save NXSPE files via the interface. Instead, I added a check to see if the algorithm history says the file was loaded in from a .nxspe file or .nxs file. If it finds the file was loaded using the LoadNXSPE algorithm, then the corresponding save algorithm would be used to save it. Otherwise, the SaveNexus algorithm gets used.

This ensures the saved nxspe workspace can be loaded back into the MSlice interface without any problems.

To test: Load MARI28540_80meV.nxspe Scale the workspace Save the file as Nexus to a different name such as MARI28540_80meV_scaled There should be an error message displayed at the bottom suggesting that metadata will not be saved. Save the file as NXSPE to a different name such as MARI28540_80meV_scaled Load the MARI28540_80meV_scaled workspace back into MSlice There should be no error

Fixes #834 Fixes #540