Skip to content

Commit

Permalink
Allow dgreduce to work with an input workspace and no cal file.
Browse files Browse the repository at this point in the history
This assumes the calibration has already been applied to the input
workspace and allows it to be done once.
Refs #8057
  • Loading branch information
martyngigg committed Oct 4, 2013
1 parent 7c41d2d commit 8f96457
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions Code/Mantid/scripts/Inelastic/dgreduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,21 +224,17 @@ def arb_units(wb_run,sample_run,ei_guess,rebin,map_file='default',monovan_run=No
Reducer.log('one2one map selected')



if Reducer.det_cal_file != None :
if isinstance(Reducer.det_cal_file,str) and not Reducer.det_cal_file in mtd : # it is a file
if isinstance(sample_run,api.Workspace) or mtd.doesExist(sample_run):
Reducer.log('Input is pre-loaded workspace, ignoring specified det_cal_file "%s"' % str(Reducer.det_cal_file))
Reducer.log('Use UpdateInstrumentFromFile to apply calibration to %s' % (str(sample_run)))
elif isinstance(Reducer.det_cal_file,str) and not Reducer.det_cal_file in mtd : # it is a file
Reducer.log('Setting detector calibration file to '+Reducer.det_cal_file)
else:
Reducer.log('Setting detector calibration to {0}, which is probably a workspace '.format(str(Reducer.det_cal_file)))
else:
Reducer.log('Setting detector calibration to detector block info from '+str(sample_run))


if mtd.doesExist(str(sample_run))==True and Reducer.det_cal_file == None:
Reducer.log('For data input type: workspace detector calibration must be specified','error')
Reducer.log('use Keyword det_cal_file with a valid detctor file or run number','error')
return

# check if reducer can find all non-run files necessary for the reduction before starting long run.
Reducer.check_necessary_files(monovan_run);

Expand Down

0 comments on commit 8f96457

Please sign in to comment.