Changeset 4349


Ignore:
Timestamp:
Mar 8, 2020 10:40:55 PM (20 months ago)
Author:
toby
Message:

fix integration over azimuths with no pixels

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r4154 r4349  
    2525
    2626import sys
    27 import os
     27#import os
    2828import platform
    2929import wx
  • trunk/GSASIIimage.py

    r4332 r4349  
    3434import GSASIIpwd as G2pwd
    3535import GSASIIspc as G2spc
    36 import GSASIImath as G2mth
     36#import GSASIImath as G2mth
    3737import GSASIIfiles as G2fil
    3838
     
    12181218    H0msk = [ma.array(np.divide(h0,nst),mask=np.logical_not(nst)) for nst,h0 in zip(NST,H0)]
    12191219    #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))       
    12241230    if 'log(q)' in data.get('binType',''):
    12251231        H2 = 2.*npasind(np.exp(H2)*data['wavelength']/(4.*np.pi))
Note: See TracChangeset for help on using the changeset viewer.