Changeset 4349
- Timestamp:
- Mar 8, 2020 10:40:55 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.py
r4154 r4349 25 25 26 26 import sys 27 import os27 #import os 28 28 import platform 29 29 import wx -
trunk/GSASIIimage.py
r4332 r4349 34 34 import GSASIIpwd as G2pwd 35 35 import GSASIIspc as G2spc 36 import GSASIImath as G2mth36 #import GSASIImath as G2mth 37 37 import GSASIIfiles as G2fil 38 38 … … 1218 1218 H0msk = [ma.array(np.divide(h0,nst),mask=np.logical_not(nst)) for nst,h0 in zip(NST,H0)] 1219 1219 #make linear interpolators; outside limits give NaN 1220 H0int = [scint.interp1d(h2msk.compressed(),h0msk.compressed(),bounds_error=False) for h0msk,h2msk in zip(H0msk,H2msk)] 1221 #do interpolation on all points - fills in the empty bins; leaves others the same 1222 H0 = np.array([h0int(H2[:-1]) for h0int in H0int]) 1223 H0 = np.nan_to_num(H0) 1220 H0 = [] 1221 for h0msk,h2msk in zip(H0msk,H2msk): 1222 try: 1223 h0int = scint.interp1d(h2msk.compressed(),h0msk.compressed(),bounds_error=False) 1224 #do interpolation on all points - fills in the empty bins; leaves others the same 1225 h0 = h0int(H2[:-1]) 1226 H0.append(h0) 1227 except ValueError: 1228 H0.append(np.zeros(numChans,order='F',dtype=np.float32)) 1229 H0 = np.nan_to_num(np.array(H0)) 1224 1230 if 'log(q)' in data.get('binType',''): 1225 1231 H2 = 2.*npasind(np.exp(H2)*data['wavelength']/(4.*np.pi))
Note: See TracChangeset
for help on using the changeset viewer.