Skip to content

Commit

Permalink
Re #5031 exposing set_wavelength command
Browse files Browse the repository at this point in the history
  • Loading branch information
mdoucet committed Mar 27, 2012
1 parent 5a33cf1 commit 9970e3b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Code/Mantid/scripts/reduction/instruments/sans/eqsans_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ def __init__(self, datafile=None, keep_events=False):
self._low_TOF_cut = 0
self._high_TOF_cut = 0

# Wavelength step
self._wavelength_step = None

# TOF flight path correction
self._correct_for_flight_path = False

Expand Down Expand Up @@ -57,8 +60,14 @@ def clone(self, data_file=None, keep_events=None):
loader._correct_for_flight_path = self._correct_for_flight_path
loader._use_config_mask = self._use_config_mask
loader._use_config = self._use_config
loader._wavelength_step = self._wavelength_step
return loader

def set_wavelength_step(self, step):
if step is not None and type(step) != int and type(step) != float:
raise RuntimeError, "LoadRun._wavelength_step expects a float: %s" % str(step)
self._wavelength_step = step

def set_sample_detector_distance(self, distance):
# Check that the distance given is either None of a float
if distance is not None and type(distance) != int and type(distance) != float:
Expand Down Expand Up @@ -163,6 +172,7 @@ def _load_data_file(file_name, wks_name):
UseConfigTOFCuts=self._use_config_cutoff,
LowTOFCut=self._low_TOF_cut,
HighTOFCut=self._high_TOF_cut,
WavelengthStep=self._wavelength_step,
UseConfigMask=self._use_config_mask,
UseConfig=self._use_config,
CorrectForFlightPath=self._correct_for_flight_path,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ def UseConfigTOFTailsCutoff(use_config=True):
def UseConfigMask(use_config=True):
ReductionSingleton().get_data_loader().use_config_mask(use_config)

def SetWavelengthStep(step=0.1):
ReductionSingleton().get_data_loader().set_wavelength_step(step)

def UseConfig(use_config=True):
ReductionSingleton().get_data_loader().use_config(use_config)

Expand Down

0 comments on commit 9970e3b

Please sign in to comment.