Skip to content

Commit

Permalink
refs #6667 Modified parameters in accordance with MAPS
Browse files Browse the repository at this point in the history
mean real data which MAPS uses -- not the one it has in MAPS parameters file
  • Loading branch information
abuts committed Jun 20, 2013
1 parent a3a3ba2 commit f0e7a7f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
8 changes: 4 additions & 4 deletions Code/Mantid/instrument/MAPS_Parameters.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@
</parameter>
<!-- Fraction of median to consider counting high for the white beam diag (sv_hi)-->
<parameter name="diag_samp_hi">
<value val="1.5"/>
<value val="2."/>
</parameter>

<!-- Error criterion as a multiple of error bar for background (sv_sig)
i.e. to fail the test, the magnitude of the
difference with respect to the median value must also exceed this number of error bars (default=3.3)
-->
<parameter name="diag_samp_sig">
<value val="3.3"/>
<value val="3."/>
</parameter>

<!-- Lower bound defining outliers as fraction of median value (v_out_lo)-->
Expand All @@ -183,7 +183,7 @@

<!-- Fraction of median to consider counting high for the white beam diag (vv_hi) vanhi=1.5 -->
<parameter name="diag_van_hi">
<value val="2.0"/>
<value val="1.5"/>
</parameter>

<!-- Error criterion as a multiple of error bar van_sig "
Expand Down Expand Up @@ -340,7 +340,7 @@
monovan_lo_value = monovan-integr-min;
monovan_hi_value = monovan-integr-max;
use_hard_mask_only=hardmaskOnly;
background_range = bkgd_range;
bkgd_range = background_range;
hard_mask = hard_mask_file=hardmaskPlus;
van_out_lo = diag_van_median_rate_limit_lo=diag_van_out_lo;
van_out_hi = diag_van_median_rate_limit_hi=diag_van_out_hi;
Expand Down
13 changes: 7 additions & 6 deletions Code/Mantid/scripts/Inelastic/DirectEnergyConversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def diagnose(self, white, **kwargs):
bkgd_range = kwargs['bkgd_range']
del kwargs['bkgd_range']
else:
bkgd_range = self.background_range
bkgd_range = self.bkgd_range
background_int = Integration(result_ws,
RangeLower=bkgd_range[0],RangeUpper=bkgd_range[1],
IncludePartialBins=True)
Expand Down Expand Up @@ -334,7 +334,7 @@ def _do_mono(self, data_ws, monitor_ws, result_name, ei_guess,
if (self.facility == "SNS"):
if self.background == True:
# Extract the time range for the background determination before we throw it away
background_bins = "%s,%s,%s" % (self.background_range[0] + bin_offset, (self.background_range[1]-self.background_range[0]), self.background_range[1] + bin_offset)
background_bins = "%s,%s,%s" % (self.bkgd_range[0] + bin_offset, (self.bkgd_range[1]-self.bkgd_range[0]), self.bkgd_range[1] + bin_offset)
Rebin(InputWorkspace=result_name,OutputWorkspace= "background_origin_ws",Params=background_bins)
# Convert to Et
ConvertUnits(InputWorkspace=result_name,OutputWorkspace= "_tmp_energy_ws", Target="DeltaE",EMode="Direct", EFixed=ei_value)
Expand Down Expand Up @@ -375,7 +375,7 @@ def _do_mono(self, data_ws, monitor_ws, result_name, ei_guess,
ConvertToDistribution(Workspace=result_name)
if (self.facility == "SNS"):
FlatBackground(InputWorkspace="background_origin_ws",OutputWorkspace= "background_ws",
StartX= self.background_range[0] + bin_offset,EndX= self.background_range[1] + bin_offset,
StartX= self.bkgd_range[0] + bin_offset,EndX= self.bkgd_range[1] + bin_offset,
WorkspaceIndexList= '',Mode= 'Mean',OutputMode= 'Return Background')
# Delete the raw data background region workspace
DeleteWorkspace("background_origin_ws")
Expand All @@ -387,7 +387,7 @@ def _do_mono(self, data_ws, monitor_ws, result_name, ei_guess,
DeleteWorkspace("background_ws")
else:
FlatBackground(InputWorkspace=result_name,OutputWorkspace=result_name,
StartX= self.background_range[0] + bin_offset,EndX= self.background_range[1] + bin_offset,
StartX= self.bkgd_range[0] + bin_offset,EndX= self.bkgd_range[1] + bin_offset,
WorkspaceIndexList= '',Mode= 'Mean')
ConvertFromDistribution(Workspace=result_name)

Expand Down Expand Up @@ -803,10 +803,11 @@ def init_idf_params(self, reload_instrument=False):
self.__save_formats = ['.spe','.nxs','.nxspe']

## Detector diagnosis
# Diag parameters -- keys used by diag method to pick from default parameters. Diag cuts these keys removing diag_ word
# Diag parameters -- keys used by diag method to pick from default parameters. Diag cuts these keys removing diag_ word
# and picks correspondent parameters
self.__diag_params = ['diag_tiny', 'diag_huge', 'diag_samp_zero', 'diag_samp_lo', 'diag_samp_hi','diag_samp_sig',\
'diag_van_out_lo', 'diag_van_out_hi', 'diag_van_lo', 'diag_van_hi', 'diag_van_sig', 'diag_variation',\
'diag_bleed_test','diag_hard_mask']
'diag_bleed_test','diag_bleed_pixels','diag_bleed_maxrate','diag_hard_mask','diag_bkgd_range']

self.__normalization_methods=['none','monitor-1','current'] # 'monitor-2','uamph', peak -- disabled/unknown at the moment

Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/scripts/Inelastic/dgreduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def arb_units(wb_run,sample_run,ei_guess,rebin,map_file=None,monovan_run=None,**
# inform user about changed parameters
for key in changed_Keys:
val = getattr(Reducer,key);
Reducer.log(" Value of key: {0:<25} is set to non-default value: {1:<20} ".format(key,val))
Reducer.log(" Value of : {0:<25} is set to : {1:<20} ".format(key,val))


#do we run absolute units normalization and need to warn users if the parameters needed for that have not changed from defaults
Expand Down
2 changes: 2 additions & 0 deletions Code/Mantid/scripts/Inelastic/diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ def diagnose(white_int, **kwargs):
if white_int is None and str(white_int) != '':
raise RuntimeError("No white beam integral specified. This is the minimum required to run diagnostics")

for key,val in kwargs.iteritems():
print "diag for key:\t {0:<20}\t Value: {1:<20}".format(key, str(val))
# Grab the arguments
parser = ArgumentParser(kwargs)
start_index = parser.start_index
Expand Down

0 comments on commit f0e7a7f

Please sign in to comment.