Sorry, the first issue (MSlice just saves first cut plotted) is a bug. I’ve open an issue for it: Bug: saving cut only works for first cut plotted to that window · Issue #472 · mantidproject/mslice · GitHub - I’ll try to fix it asap and hopefully get it into the next Mantid release (due mid-July).
the data are averaged over the integration range instead
You’re right - sort of: Behind the scenes, MSlice uses this algorithm: SofQWNormalisedPolygon v1 internally for both cuts and slices - so both operations are in effect a rebinning, where the output counts are scaled to the output area - that is, the output intensity and errors are:
Y_i’ = sum_i (Y_i * F_i) / sum_i F_i
E_i’ = sqrt( sum_i (E_i^2 * F_i) ) / sum_i F_i
where F_i are the fractional areas of the ith bin used in the rebinned output.
I’ll amend the documentation.
The reason we do this is because at the edges of the detectors, the rebinned fractional area is small, so we don’t want the counts in these areas to give an outsized contribution to the cut. For the pure integration option, this would just mean removing the denominator [sum_i F_i] but that might give you quite a strange output.
is there a way to save datasets using the command line?
Yes, but not so straightforward - we’re going to fix it in the next version of Mantid ( Add file I/O commands to mslice.cli namespace · Issue #468 · mantidproject/mslice · GitHub ) but for now, you can use something like:
import mslice.cli as mc
import mslice.models.workspacemanager.file_io as mio
ws = mc.Load('file')
cut_ws = mc.Cut(ws, CutAxis="DeltaE,5.0,55.0,0.3", IntegrationAxis="|Q|,0.0,9.0,0.0", NormToOne=False)
slice_ws = mc.Slice(ws, Axis1="|Q|,0.27356,11.0351,0.04671", Axis2="DeltaE,-241.97,469.41,2.42,cm-1", NormToOne=False)
mio.save_ascii(cut_ws, '/tmp/cut.txt', is_slice=False)
mio.save_ascii(slice_ws, '/tmp/slice.txt', is_slice=True)
Hope this helps,