Skip to content

Commit

Permalink
Refs #4867 - Changes to ApplyCorr from Spencer.
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterParker committed Jul 11, 2012
1 parent bed93dc commit 8582ca9
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions Code/Mantid/scripts/Inelastic/IndirectDataAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,7 @@ def abscorFeeder(sample, container, geom, useCor):
applyCorrections routine.'''
StartTime('ApplyCorrections')
Verbose = True
Save = True
PlotResult = 'Both'
PlotContrib = 'Spectrum'
workdir = config['defaultsave.directory']
Expand Down Expand Up @@ -706,10 +707,11 @@ def abscorFeeder(sample, container, geom, useCor):
logger.notice('Correction file :'+abs_path)
LoadNexus(Filename=abs_path, OutputWorkspace='corrections')
cor_result = applyCorrections(sample, container, 'corrections', Verbose)
cor_path = os.path.join(workdir,cor_result+'.nxs')
SaveNexusProcessed(InputWorkspace=cor_result,Filename=cor_path)
if Verbose:
logger.notice('Output file created : '+cor_path)
if Save:
cor_path = os.path.join(workdir,cor_result+'.nxs')
SaveNexusProcessed(InputWorkspace=cor_result,Filename=cor_path)
if Verbose:
logger.notice('Output file created : '+cor_path)
plot_list = [cor_result,sample]
if ( container != '' ):
plot_list.append(container)
Expand All @@ -721,13 +723,15 @@ def abscorFeeder(sample, container, geom, useCor):
if ( container == '' ):
sys.exit('ERROR *** Invalid options - nothing to do!')
else:
sub_result = sample[0:8] +'_Subtract_'+ container[3:8]
Minus(LHSWorkspace=sample,RHSWorkspace=container,OutputWorkspace=sub_result)
sub_path = os.path.join(workdir,sub_result+'.nxs')
SaveNexusProcessed(InputWorkspace=sub_result,Filename=sub_path)
sub_result = sample[:-3] +'Subtract_'+ container[3:8]
if Verbose:
logger.notice('Subtracting '+container+' from '+sample)
logger.notice('Output file created : '+sub_path)
Minus(LHSWorkspace=sample,RHSWorkspace=container,OutputWorkspace=sub_result)
if Save:
sub_path = os.path.join(workdir,sub_result+'.nxs')
SaveNexusProcessed(InputWorkspace=sub_result,Filename=sub_path)
if Verbose:
logger.notice('Output file created : '+sub_path)
plot_list = [sub_result,sample]
if (PlotResult != 'None'):
plotCorrResult(sub_result,PlotResult)
Expand Down

0 comments on commit 8582ca9

Please sign in to comment.