Skip to content
Snippets Groups Projects
Commit ca307ef0 authored by Campbell, Stuart's avatar Campbell, Stuart
Browse files

Fixed logic with fixing Ei and actually retrieve T0 from GetEi algorithm now. fixes #1861 & #1647

parent afa255ad
No related branches found
No related tags found
No related merge requests found
...@@ -179,24 +179,27 @@ class DirectEnergyConversion(object): ...@@ -179,24 +179,27 @@ class DirectEnergyConversion(object):
self.apply_detector_eff = True self.apply_detector_eff = True
elif (self.instr_name == "ARCS" or self.instr_name == "SEQUOIA"): elif (self.instr_name == "ARCS" or self.instr_name == "SEQUOIA"):
mono_run = common.loaded_file('mono-sample') mono_run = common.loaded_file('mono-sample')
if mono_run.endswith("_event.nxs"):
loader=LoadNexusMonitors(Filename=mono_run, OutputWorkspace="monitor_ws")
elif mono_run.endswith("_event.dat"):
InfoFilename = mono_run.replace("_neutron_event.dat", "_runinfo.xml")
loader=LoadPreNeXusMonitors(RunInfoFilename=InfoFilename,OutputWorkspace="monitor_ws")
monitor_ws = loader.workspace()
alg = GetEi(monitor_ws, int(self.ei_mon_spectra[0]), int(self.ei_mon_spectra[1]), ei_guess, False)
Tzero = float(alg.getPropertyValue("Tzero"))
if (self.fix_ei): if (self.fix_ei):
if mono_run.endswith("_event.nxs"): ei_value = ei_guess
loader=LoadNexusMonitors(Filename=mono_run, OutputWorkspace="monitor_ws")
elif mono_run.endswith("_event.dat"):
InfoFilename = mono_run.replace("_neutron_event.dat", "_runinfo.xml")
loader=LoadPreNeXusMonitors(RunInfoFilename=InfoFilename,OutputWorkspace="monitor_ws")
monitor_ws = loader.workspace()
alg = GetEi(monitor_ws, int(self.ei_mon_spectra[0]), int(self.ei_mon_spectra[1]), ei_guess, False)
ei_value = monitor_ws.getRun().getLogData("Ei").value
else: else:
ei_value = ei_guess ei_value = monitor_ws.getRun().getLogData("Ei").value
if (Tzero is None): if (Tzero is None):
# TODO: Calculate T0
#tzero = float(alg.getPropertyValue("Tzero"))
tzero = 0.0 tzero = 0.0
else: else:
tzero = Tzero tzero = Tzero
mon1_peak = 0.0 mon1_peak = 0.0
# apply T0 shift # apply T0 shift
ChangeBinOffset(data_ws, result_name, -tzero) ChangeBinOffset(data_ws, result_name, -tzero)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment