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):