Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
mdoucet committed Oct 10, 2023
1 parent 41a095c commit 9454177
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions reduction/test/test_reduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
import mantid
import mantid.simpleapi as mtd_api
import numpy as np
mtd_api.config.appendDataSearchDir('tests/data/liquidsreflectometer-data/nexus/')
mtd_api.config["default.facility"] = "SNS"
mtd_api.config["default.instrument"] = "REF_L"

mantid.kernel.config.setLogLevel(7)
mantid.kernel.config.setLogLevel(3)

from lr_reduction import event_reduction, template, workflow

Expand All @@ -22,7 +21,7 @@ def test_full_reduction():
d_refl_all = []
first_run = None
for run_number in range(198409, 198417):
ws_sc = mtd_api.Load("REF_L_%s.nxs.h5" % run_number)
ws_sc = mtd_api.Load("REF_L_%s" % run_number)
qz_mid, refl, d_refl = template.process_from_template_ws(ws_sc, template_path)

if first_run is None:
Expand Down Expand Up @@ -51,7 +50,7 @@ def test_full_reduction():

def test_reduce_workflow():
template_path = 'data/template.xml'
output_dir = '/tmp'
output_dir = 'data/'
reduced_path = os.path.join(output_dir, 'REFL_198409_combined_data_auto.txt')
if os.path.isfile(reduced_path):
os.remove(reduced_path)
Expand Down Expand Up @@ -81,9 +80,10 @@ def test_reduce_workflow_201282():
Test to reproduce autoreduction output
"""
template_path = 'data/template_201282.xml'
output_dir = '/tmp'
output_dir = 'data/'
reduced_path = os.path.join(output_dir, 'REFL_201282_combined_data_auto.txt')
os.remove(reduced_path)
if os.path.isfile(reduced_path):
os.remove(reduced_path)

for i in range(201282, 201289):
ws = mtd_api.Load("REF_L_%s" % i)
Expand All @@ -110,9 +110,10 @@ def test_background_subtraction():
Test with background subtraction off for the data and on for the normalization
"""
template_path = 'data/template_short_nobck.xml'
output_dir = '/tmp'
output_dir = 'data/'
reduced_path = os.path.join(output_dir, 'REFL_198382_combined_data_auto.txt')
os.remove(reduced_path)
if os.path.isfile(reduced_path):
os.remove(reduced_path)

for i in range(198388, 198390):
ws = mtd_api.Load("REF_L_%s" % i)
Expand Down

0 comments on commit 9454177

Please sign in to comment.