Skip to content

Commit

Permalink
refs #8609 modified Mari to avoid diagnostics completely.
Browse files Browse the repository at this point in the history
  • Loading branch information
abuts committed Dec 12, 2013
1 parent 5f1b228 commit f7e78b0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 4 additions & 0 deletions Code/Mantid/instrument/MARI_Parameters.xml
Expand Up @@ -29,6 +29,10 @@
<parameter name="hard_mask_file" type="string">
<value val="None"/>
</parameter>
<!-- Parameter specifies if one wants to run diagnostics or not-->
<parameter name="run_diagnostics" type="bool">
<value val="True"/>
</parameter>
<!-- The map file used when calculating absolute units conversion integrals
This map usually groups together large areas of detectors to obtain proper vanadium statistics -->
<parameter name="monovan_mapfile" type="string">
Expand Down
14 changes: 10 additions & 4 deletions Code/Mantid/scripts/Inelastic/dgreduce.py
Expand Up @@ -257,8 +257,11 @@ def arb_units(wb_run,sample_run,ei_guess,rebin,map_file='default',monovan_run=No
if Reducer.mask_run == None :
mask_run=sample_run


masking = None;
masks_done=False
if not Reducer.run_diagnostics:
header="Diagnostics skipped "
masks_done = True;
if Reducer.save_and_reuse_masks :
raise NotImplementedError("Save and reuse masks option is not yet implemented")
mask_file_name = common.create_resultname(str(mask_run),Reducer.instr_name,'_masks.xml')
Expand All @@ -268,7 +271,7 @@ def arb_units(wb_run,sample_run,ei_guess,rebin,map_file='default',monovan_run=No
#Reducer.hard_mask_file = mask_full_file;
#Reducer.use_hard_mask_only = True
masks_done=True
header="Masking loaded "
header="Masking fully skipped and processed {0} spectra and {1} bad spectra "
else:
pass
#-------------------------------------------------------------------------------------------------------------------------------------------------------
Expand All @@ -278,7 +281,7 @@ def arb_units(wb_run,sample_run,ei_guess,rebin,map_file='default',monovan_run=No
if not masks_done:
masking = Reducer.diagnose(wb_run,sample = mask_run,
second_white = None,print_results=True)
header = "Diag Processed "
header = "Diag Processed workspace with {0:d} spectra and masked {1:d} bad spectra"


# Calculate absolute units:
Expand Down Expand Up @@ -308,7 +311,7 @@ def arb_units(wb_run,sample_run,ei_guess,rebin,map_file='default',monovan_run=No
failed_sp_list,nSpectra = get_failed_spectra_list_from_masks(masking)
nMaskedSpectra = len(failed_sp_list)
# this tells turkey in case of hard mask only but everythin else semems work fine
print '{0} workspace with {1:d} spectra and masked {2:d} bad spectra'.format(header,nSpectra,nMaskedSpectra)
print header.format(nSpectra,nMaskedSpectra)
#Run the conversion first on the sample
deltaE_wkspace_sample = Reducer.convert_to_energy(sample_run, ei_guess, wb_run)

Expand Down Expand Up @@ -701,6 +704,9 @@ def get_failed_spectra_list_from_masks(masking_wksp):
masking_wksp = mtd[masking_wksp]

failed_spectra = []
if masking_wksp is None:
return (failed_spectra,0);

n_spectra = masking_wksp.getNumberHistograms()
for i in xrange(n_spectra):
if masking_wksp.readY(i)[0] >0.99 : # spectrum is masked
Expand Down

0 comments on commit f7e78b0

Please sign in to comment.