Skip to content
Snippets Groups Projects
Commit d2a7f2fa authored by Dan Nixon's avatar Dan Nixon
Browse files

Add check for sample log existance

Refs #11464
parent ffb7163d
No related branches found
No related tags found
No related merge requests found
......@@ -328,16 +328,19 @@ class ElasticWindowMultiple(DataProcessorAlgorithm):
# Get temperature from log file
LoadLog(Workspace=ws_name, Filename=log_path)
run_logs = mtd[ws_name].getRun()
tmp = run_logs[self._sample_log_name].value
temp = tmp[len(tmp) - 1]
logger.debug('Temperature %d K found for run: %s' % (temp, run_name))
return temp
if self._sample_log_name in run_logs:
tmp = run_logs[self._sample_log_name].value
temp = tmp[len(tmp) - 1]
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:
# Can't find log file
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
......
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