changed behavoiur, still saving "light" pyfai data, saving theta and buxfix: doFolder was not passing the dezinger parameter to do1d

This commit is contained in:
Marco Cammarata 2017-03-16 23:16:34 +01:00
parent a92c68467d
commit 3ac0613226
1 changed files with 11 additions and 3 deletions

View File

@ -280,7 +280,7 @@ def doFolder(folder,files='*.edf*',nQ = 1500,force=False,mask=None,dark=10,
err = np.empty( (len(files),nQ) ) err = np.empty( (len(files),nQ) )
for ifname,fname in enumerate(files): for ifname,fname in enumerate(files):
img = read(fname) img = read(fname)
q,i,e = do1d(ai,img,mask=mask,npt_radial=nQ,dark=dark) q,i,e = do1d(ai,img,mask=mask,npt_radial=nQ,dark=dark,dezinger=dezinger)
data[ifname] = i data[ifname] = i
err[ifname] = e err[ifname] = e
if saveChi: if saveChi:
@ -291,10 +291,18 @@ def doFolder(folder,files='*.edf*',nQ = 1500,force=False,mask=None,dark=10,
files = np.concatenate( (saved["files"] ,basenames ) ) files = np.concatenate( (saved["files"] ,basenames ) )
data = np.concatenate( (saved["data"] ,data ) ) data = np.concatenate( (saved["data"] ,data ) )
err = np.concatenate( (saved["err"] ,err ) ) err = np.concatenate( (saved["err"] ,err ) )
theta_rad = utils.qToTheta(q,wavelength=ai.wavelength)
theta_deg = utils.qToTheta(q,wavelength=ai.wavelength,asDeg=True)
orig = dict(data=data.copy(),err=err.copy(),q=q.copy())
ret = dict(q=q,folder=folder,files=files,data=data,err=err, ret = dict(q=q,folder=folder,files=files,data=data,err=err,
orig = dict(data=data.copy(),err=err.copy(),q=q.copy()), orig = orig, theta_rad = theta_rad, theta_deg=theta_deg,
pyfai=ai_as_dict(ai),pyfai_info=ai_as_str(ai),mask=mask) pyfai=ai_as_dict(ai),pyfai_info=ai_as_str(ai),mask=mask)
if not save_pyfai: del ret['pyfai'] if not save_pyfai:
ret['pyfai']['chia'] = None
ret['pyfai']['dssa'] = None
ret['pyfai']['q'] = None
ret['pyfai']['ttha'] = None
ret = storage.DataStorage(ret) ret = storage.DataStorage(ret)