Skip to content
Snippets Groups Projects
Commit 1580f5a1 authored by Harry Jeffery's avatar Harry Jeffery
Browse files

Merge pull request #506 from mantidproject/11464_elwinmulti_fix_failure_on_no_logs

ElasticWindowMultiple fails when no temperature logs are found
parents 4a343fac 8f905170
No related branches found
No related tags found
No related merge requests found
...@@ -150,6 +150,9 @@ class ElasticWindowMultiple(DataProcessorAlgorithm): ...@@ -150,6 +150,9 @@ class ElasticWindowMultiple(DataProcessorAlgorithm):
temp = self._get_temperature(input_ws) temp = self._get_temperature(input_ws)
if temp is not None: if temp is not None:
temperatures.append(temp) temperatures.append(temp)
else:
# No need to output a tmperature workspace if there are no temperatures
self._elt_workspace = ''
logger.information('Creating Q and Q^2 workspaces') logger.information('Creating Q and Q^2 workspaces')
...@@ -328,16 +331,19 @@ class ElasticWindowMultiple(DataProcessorAlgorithm): ...@@ -328,16 +331,19 @@ class ElasticWindowMultiple(DataProcessorAlgorithm):
# Get temperature from log file # Get temperature from log file
LoadLog(Workspace=ws_name, Filename=log_path) LoadLog(Workspace=ws_name, Filename=log_path)
run_logs = mtd[ws_name].getRun() run_logs = mtd[ws_name].getRun()
tmp = run_logs[self._sample_log_name].value if self._sample_log_name in run_logs:
temp = tmp[len(tmp) - 1] tmp = run_logs[self._sample_log_name].value
logger.debug('Temperature %d K found for run: %s' % (temp, run_name)) temp = tmp[len(tmp) - 1]
return temp logger.debug('Temperature %d K found for run: %s' % (temp, run_name))
return temp
else:
logger.warning('Log entry %s for run %s not found' % (self._sample_log_name, run_name))
else: else:
# Can't find log file
logger.warning('Log file for run %s not found' % run_name) logger.warning('Log file for run %s not found' % run_name)
logger.warning('No temperature found for run: %s' % run_name)
return None # Can't find log file
logger.warning('No temperature found for run: %s' % run_name)
return None
# Register algorithm with Mantid # Register algorithm with Mantid
......
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