diff --git a/docs/source/algorithms/LoadSESANS-v1.rst b/docs/source/algorithms/LoadSESANS-v1.rst new file mode 100644 index 0000000000000000000000000000000000000000..509408862b42005ef3122a5f77a197e8ed559c6e --- /dev/null +++ b/docs/source/algorithms/LoadSESANS-v1.rst @@ -0,0 +1,56 @@ +.. algorithm:: + +.. summary:: + +.. alias:: + +.. properties:: + +Description +----------- + +Loads the given file in the SESANS text format. The file begins with a +number of compulsory headers, the first of which must be +'FileFormatVersion'. There are four compulsory data columns - +SpinEchoLength, Depolarisation, Depolarisation_error and +Wavelength. The output workspace has X values of SpinEchoLength and Y +values of depolarisation. + +Note that LoadSESANS and SaveSESANS are not symmetric. Save expects a +workspace with X values of wavelength and Y values of TODO + +Usage +----- + +**Example - Loading a file** + +.. testcode:: LoadSESANSRoundTrip + + import os + + # Create dummy workspace + dataX = [1,2,3,4,5] + dataY = [6,1,9,14] + dataE = [1,1,4,5] + out_ws = CreateWorkspace(dataX, dataY, dataE) + out_ws.setTitle("Dummy workspace") + + file_path = os.path.join(config["defaultsave.directory"], "example.ses") + + # Do a 'roundtrip' of the data + SaveSESANS(InputWorkspace=out_ws, Filename=file_path, ThetaZMax=1,ThetaYMax=1, EchoConstant=1, Sample="Sample") + LoadSESANS(Filename=file_path, OutputWorkspace="in_ws") + + # Retrieve loaded workspace from ADS + in_ws = mtd["in_ws"] + print("Y values of loaded workspace = " + str(in_ws.readY(0))) + +.. testcleanup:: LoadSESANSRoundTrip + + os.remove(file_path) + +Output: + +.. testoutput:: LoadSESANSRoundTrip + + Y values of loaded workspace = [0.796338, 0., 0.179365, 0.130324] diff --git a/docs/source/algorithms/SaveSESANS-v1.rst b/docs/source/algorithms/SaveSESANS-v1.rst new file mode 100644 index 0000000000000000000000000000000000000000..bb3adfd840299a3fdca62000d207a7ff0dcb9c9a --- /dev/null +++ b/docs/source/algorithms/SaveSESANS-v1.rst @@ -0,0 +1,53 @@ +.. algorithm:: + +.. summary:: + +.. alias:: + +.. properties:: + +Description +----------- + +Saves the given workspace to a file which will be formatted in the +SESANS data format. A workspace with a single spectrum is expected, +where the X values are wavelength and the Y values are TODO. + +Note that LoadSESANS and SaveSESANS are not symmetric. Save expects a +workspace with X values of wavelength and Y values of TODO + +Usage +----- + +**Example - Loading a file** + +.. testcode:: LoadSESANSRoundTrip + + import os + + # Create dummy workspace + dataX = [1,2,3,4,5] + dataY = [6,1,9,14] + dataE = [1,1,4,5] + out_ws = CreateWorkspace(dataX, dataY, dataE) + out_ws.setTitle("Dummy workspace") + + file_path = os.path.join(config["defaultsave.directory"], "example.ses") + + # Do a 'roundtrip' of the data + SaveSESANS(InputWorkspace=out_ws, Filename=file_path, ThetaZMax=1,ThetaYMax=1, EchoConstant=1, Sample="Sample") + LoadSESANS(Filename=file_path, OutputWorkspace="in_ws") + + # Retrieve loaded workspace from ADS + in_ws = mtd["in_ws"] + print("Y values of loaded workspace = " + str(in_ws.readY(0))) + +.. testcleanup:: LoadSESANSRoundTrip + + os.remove(file_path) + +Output: + +.. testoutput:: LoadSESANSRoundTrip + + Y values of loaded workspace = [0.796338, 0., 0.179365, 0.130324] diff --git a/docs/source/release/v3.11.0/framework.rst b/docs/source/release/v3.11.0/framework.rst index ec482ae68a7f0c8457401a03df8028831a8c1c3b..286f82e377c09bb778d7c1b9a20ac5d2ce58d279 100644 --- a/docs/source/release/v3.11.0/framework.rst +++ b/docs/source/release/v3.11.0/framework.rst @@ -21,8 +21,8 @@ New ### - :ref:`ConjoinXRuns <algm-ConjoinXRuns>` performs concatenation of the workspaces into a single one by handling the sample logs merging as in :ref:`MergeRuns <algm-MergeRuns>`. -- :ref:`LoadSESANS <algm-LoadSESANS>` Loading SESANS data to a MatrixWorkspace is now supported. -- :ref:`SaveSESANS <algm-SaveSESANS>` Saving a workspace using the SESANS format is now supported. +- :ref:`LoadSESANS <algm-LoadSESANS-v1>` Loading SESANS data to a MatrixWorkspace is now supported. +- :ref:`SaveSESANS <algm-SaveSESANS-v1>` Saving a workspace using the SESANS format is now supported. Improved