code cleanup
This commit is contained in:
parent
35ba41f86b
commit
f62f26e0fa
|
@ -1,6 +1,6 @@
|
|||
from __future__ import print_function,division
|
||||
|
||||
import logging
|
||||
import logging
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
import numpy as np
|
||||
|
@ -122,7 +122,7 @@ def averageScanPoints(scan,data,errAbs=None,isRef=None,lpower=None,useRatio=Fals
|
|||
noise = np.nanstd(diff_for_scan, axis = 0)
|
||||
|
||||
# if it is the reference take only every second ...
|
||||
if np.all( shot_idx == isRef ):
|
||||
if np.all( shot_idx == isRef ):
|
||||
diff_for_scan = diff_for_scan[::2]
|
||||
|
||||
diffsInScanPoint.append( diff_for_scan )
|
||||
|
@ -216,9 +216,9 @@ def saveTxt(folder,data,delayToStr=True,basename='auto',info="",**kw):
|
|||
fname = "%s/%sdiff_av_%s.txt" % (folder,basename,scan)
|
||||
if 'mask' in data:
|
||||
tosave = np.vstack( (data.data[iscan],data.err[iscan],
|
||||
data.dataUnmasked[iscan],data.errUnmasked[iscan] ) )
|
||||
data.dataUnmasked[iscan],data.errUnmasked[iscan] ) )
|
||||
columns = 'q diffmask errmask diffnomask errnomask'.split()
|
||||
else:
|
||||
else:
|
||||
tosave = np.vstack( (data.data[iscan],data.err[iscan] ) )
|
||||
columns = 'q diff err'.split()
|
||||
utils.saveTxt(fname,q,tosave,info=info_delay,columns=columns)
|
||||
|
@ -259,4 +259,3 @@ def read_diff_av(folder,plot2D=False,save=None):
|
|||
tosave = np.vstack( (header,tosave.T) )
|
||||
np.savetxt(folder + "/all_diffs_av_matrix.txt",tosave)
|
||||
return q,it,diffs,t
|
||||
|
||||
|
|
Loading…
Reference in New Issue