diff --git a/docs/drtsans/drtsans.tof.eqsans.rst b/docs/drtsans/drtsans.tof.eqsans.rst index 04df272f8..3de18f1c6 100644 --- a/docs/drtsans/drtsans.tof.eqsans.rst +++ b/docs/drtsans/drtsans.tof.eqsans.rst @@ -140,14 +140,6 @@ drtsans.tof.eqsans.prepare module :undoc-members: :show-inheritance: -drtsans.tof.eqsans.reduce module --------------------------------- - -.. automodule:: drtsans.tof.eqsans.reduce - :members: - :undoc-members: - :show-inheritance: - drtsans.tof.eqsans.reduction\_api module ---------------------------------------- diff --git a/docs/release_notes.rst b/docs/release_notes.rst index b889eb3cf..a74eebd47 100644 --- a/docs/release_notes.rst +++ b/docs/release_notes.rst @@ -23,6 +23,7 @@ Release Notes **Of interest to the User**: +- PR #994: Remove unused module `drtsans/tof/eqsans/reduce.py` - PR #993: Skip slices with too high transmission error when using time sliced sample transmission run - PR #325: Migrates repository from GitLab to GitHub - MR #1185: Rename output directory for coherent and incoherent-inelastic corrections as "info" diff --git a/src/drtsans/tof/eqsans/reduce.py b/src/drtsans/tof/eqsans/reduce.py deleted file mode 100644 index bafa76183..000000000 --- a/src/drtsans/tof/eqsans/reduce.py +++ /dev/null @@ -1,42 +0,0 @@ -from mantid.simpleapi import mtd, LoadEventNexus -from mantid.kernel import amend_config - -from drtsans import geometry -from drtsans.tof.eqsans import geometry as e_geometry, correct_frame - - -def load_w(run, low_tof_clip=0, high_tof_clip=0, dw=0.1, data_dir=None, output_workspace=None): - r""" - Load a run, correct the TOF frame, and convert to wavelength - - Parameters - ---------- - run: str - Run number or filename. Passed onto Mantid's `Load` algorithm - low_tof_clip: float - Lower TOF clipping - high_tof_clip: float - Upper TOF clipping - data_dir: str, list - Additional one or more data search directories - dw: float - Wavelength bin width - - Returns - ------- - MatrixWorkspace - """ - if output_workspace is None: - output_workspace = mtd.unique_hidden_name() # unique hidden name - - with amend_config(data_dir=data_dir, **{"instrumentName": "EQSANS"}): - LoadEventNexus(Filename=run, OutputWorkspace=output_workspace) - e_geometry.translate_detector_by_z(output_workspace) # inplace - correct_frame.correct_detector_frame(output_workspace) - sdd = geometry.source_detector_distance(output_workspace, unit="m") - bands = correct_frame.transmitted_bands_clipped( - output_workspace, sdd, low_tof_clip, high_tof_clip, interior_clip=True - ) - correct_frame.convert_to_wavelength(output_workspace, bands, dw, events=False) - correct_frame.log_tof_structure(output_workspace, low_tof_clip, high_tof_clip, interior_clip=True) - return mtd[output_workspace] diff --git a/tests/integration/drtsans/tof/eqsans/test_reduce.py b/tests/integration/drtsans/tof/eqsans/test_reduce.py deleted file mode 100644 index 9302cc22e..000000000 --- a/tests/integration/drtsans/tof/eqsans/test_reduce.py +++ /dev/null @@ -1,27 +0,0 @@ -import pytest -from os.path import join as pj -from mantid.simpleapi import LoadNexus, SumSpectra, CompareWorkspaces, mtd -from mantid.kernel import amend_config - -from drtsans.tof.eqsans import reduce - - -@pytest.mark.datarepo -def test_load_w(datarepo_dir, clean_workspace, temp_workspace_name): - with amend_config(facility="SNS", instrument="EQSANS", data_dir=datarepo_dir.eqsans): - _w0 = reduce.load_w( - "EQSANS_92353", - output_workspace=mtd.unique_hidden_name(), - low_tof_clip=500, - high_tof_clip=2000, - dw=0.1, - ) - _w1 = SumSpectra(_w0, OutputWorkspace=_w0.name()) - clean_workspace(_w1) - fn = pj(datarepo_dir.eqsans, "test_reduce", "compare", "ref_load_w.nxs") - _w2 = LoadNexus(fn, OutputWorkspace=temp_workspace_name()) - assert CompareWorkspaces(_w1, _w2) - - -if __name__ == "__main__": - pytest.main([__file__])