Skip to content

Commit

Permalink
Add check for sample log existance
Browse files Browse the repository at this point in the history
Refs #11464
  • Loading branch information
DanNixon committed Apr 1, 2015
1 parent ffb7163 commit d2a7f2f
Showing 1 changed file with 11 additions and 8 deletions.
Expand Up @@ -328,16 +328,19 @@ def _get_temperature(self, ws_name):
# 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
Expand Down

0 comments on commit d2a7f2f

Please sign in to comment.