From 8f922cce86ba591545e2dcf2adb3569467c6ac3f Mon Sep 17 00:00:00 2001 From: Marco Cammarata Date: Fri, 27 Jan 2017 15:39:06 +0100 Subject: [PATCH] masking parameters are now saved --- xray/dataReduction.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xray/dataReduction.py b/xray/dataReduction.py index 005605d..3e6d5c3 100644 --- a/xray/dataReduction.py +++ b/xray/dataReduction.py @@ -177,7 +177,9 @@ def errorMask(data,threshold=5): log.debug("errorMask mask, scanpoint: %s, fraction of q points filtered out (average) %.4e [max %.4e])"%\ (data.scan[iscan],idx.sum()/idx.size,max(np.sum(idx,axis=1)/idx.shape[1])) ) if "masks" not in data: data['masks'] = dict() + if "masks_pars" not in data: data['masks_pars'] = dict() data['masks']['error'] = idx_mask + data['masks_pars']['errormask_threshold'] = threshold return data def chi2Mask(data,threshold=2): @@ -197,7 +199,9 @@ def chi2Mask(data,threshold=2): log.debug("Chi2 mask, scanpoint: %s, curves filtereout out %d/%d (%.2f%%)"%\ (data.scan[iscan],idx.sum(),len(idx),idx.sum()/len(idx)*100) ) if "masks" not in data: data['masks'] = dict() + if "masks_pars" not in data: data['masks_pars'] = dict() data['masks']['chi2'] = idx_mask + data['masks_pars']['chi2_threshold'] = threshold return data def applyMasks(data,which='all',funcForAveraging=np.nanmean):