diff --git a/Code/Mantid/instrument/LET_Parameters.xml b/Code/Mantid/instrument/LET_Parameters.xml index 805c0dfdc219b0e5662935f81c93ee96b1f97da0..02f28044bd03c0b761a34d4133ff38a461e94ebd 100644 --- a/Code/Mantid/instrument/LET_Parameters.xml +++ b/Code/Mantid/instrument/LET_Parameters.xml @@ -28,6 +28,11 @@ <parameter name="hard_mask_file" type="string"> <value val="hard.msk"/> </parameter> +<!-- Parameter specifies if one wants to run diagnostics (which include applying hard mask file) 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"> diff --git a/Code/Mantid/instrument/MAPS_Parameters.xml b/Code/Mantid/instrument/MAPS_Parameters.xml index e651324cc82a121f2f835c7ad1a1fb1ff72264a9..332e71d7c7b3f88c0ea9842de20a6c5e39b41ba6 100644 --- a/Code/Mantid/instrument/MAPS_Parameters.xml +++ b/Code/Mantid/instrument/MAPS_Parameters.xml @@ -28,6 +28,11 @@ <parameter name="hard_mask_file" type="string"> <value val="4to1_022.msk"/> </parameter> +<!-- Parameter specifies if one wants to run diagnostics (which include applying hard mask file) 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"> diff --git a/Code/Mantid/instrument/MARI_Parameters.xml b/Code/Mantid/instrument/MARI_Parameters.xml index b75425f2d0c2bace0cd768d88109cb57cb36eb6d..042911c94b224c331e6378bc5e873dcc4593e1b7 100644 --- a/Code/Mantid/instrument/MARI_Parameters.xml +++ b/Code/Mantid/instrument/MARI_Parameters.xml @@ -29,6 +29,10 @@ <parameter name="hard_mask_file" type="string"> <value val="None"/> </parameter> +<!-- Parameter specifies if one wants to run diagnostics (which include applying hard mask file) 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"> diff --git a/Code/Mantid/instrument/MERLIN_Parameters.xml b/Code/Mantid/instrument/MERLIN_Parameters.xml index ddced9473df26ecd26746ec6db1c6c215237e845..c98eca1fd56e39b45fe91180d4c02bd47150dce0 100644 --- a/Code/Mantid/instrument/MERLIN_Parameters.xml +++ b/Code/Mantid/instrument/MERLIN_Parameters.xml @@ -28,6 +28,11 @@ <parameter name="hard_mask_file" type="string"> <value val="None"/> </parameter> +<!-- Parameter specifies if one wants to run diagnostics (which include applying hard mask file) 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"> diff --git a/Code/Mantid/scripts/Inelastic/dgreduce.py b/Code/Mantid/scripts/Inelastic/dgreduce.py index 05b8302fb01cad3896f634087a1e2cdfe35cd312..752b6cd4bee0f225b6ff74b72b24cb5131f86ed0 100644 --- a/Code/Mantid/scripts/Inelastic/dgreduce.py +++ b/Code/Mantid/scripts/Inelastic/dgreduce.py @@ -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') @@ -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 #------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -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: @@ -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) @@ -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