masking parameters are now saved
This commit is contained in:
parent
1bf7670ca6
commit
8f922cce86
|
@ -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])"%\
|
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])) )
|
(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" not in data: data['masks'] = dict()
|
||||||
|
if "masks_pars" not in data: data['masks_pars'] = dict()
|
||||||
data['masks']['error'] = idx_mask
|
data['masks']['error'] = idx_mask
|
||||||
|
data['masks_pars']['errormask_threshold'] = threshold
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def chi2Mask(data,threshold=2):
|
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%%)"%\
|
log.debug("Chi2 mask, scanpoint: %s, curves filtereout out %d/%d (%.2f%%)"%\
|
||||||
(data.scan[iscan],idx.sum(),len(idx),idx.sum()/len(idx)*100) )
|
(data.scan[iscan],idx.sum(),len(idx),idx.sum()/len(idx)*100) )
|
||||||
if "masks" not in data: data['masks'] = dict()
|
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']['chi2'] = idx_mask
|
||||||
|
data['masks_pars']['chi2_threshold'] = threshold
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def applyMasks(data,which='all',funcForAveraging=np.nanmean):
|
def applyMasks(data,which='all',funcForAveraging=np.nanmean):
|
||||||
|
|
Loading…
Reference in New Issue