Changeset 3147
- Timestamp:
- Nov 2, 2017 9:13:23 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIimage.py
r3136 r3147 25 25 import scipy.signal as scsg 26 26 import scipy.cluster.vq as scvq 27 import scipy.interpolate as scint 27 28 import copy 28 29 import GSASIIpath … … 944 945 del tax; del tay; del taz; del tad; del tabs 945 946 t0 = time.time() 947 H2 = np.array([tth for tth in np.linspace(lutth[0],lutth[1],numChans+1)]) 946 948 NST = np.array(NST,dtype=np.float) 947 H0 = np.divide(H0,NST) 949 #prepare masked arrays of bins with pixels for interpolation setup 950 H2msk = [ma.array(H2[:-1],mask=np.logical_not(nst)) for nst in NST] 951 H0msk = [ma.array(np.divide(h0,nst),mask=np.logical_not(nst)) for nst,h0 in zip(NST,H0)] 952 #make linear interpolators; outside limits give NaN 953 H0int = [scint.interp1d(h2msk.compressed(),h0msk.compressed(),bounds_error=False) for h0msk,h2msk in zip(H0msk,H2msk)] 954 #do interpolation on all points - fills in the empty bins; leaves others the same 955 H0 = np.array([h0int(H2[:-1]) for h0int in H0int]) 948 956 H0 = np.nan_to_num(H0) 949 H2 = np.array([tth for tth in np.linspace(lutth[0],lutth[1],numChans+1)])950 957 if 'log(q)' in data.get('binType',''): 951 958 H2 = 2.*npasind(np.exp(H2)*data['wavelength']/(4.*np.pi))
Note: See TracChangeset
for help on using the changeset viewer.