Changeset 2179 for trunk/GSASIIimage.py


Ignore:
Timestamp:
Mar 18, 2016 3:20:03 PM (6 years ago)
Author:
vondreele
Message:

fixes for IntegrateAll? & AutoIntegrate? - now properly steps to next image
fix some traps for old image projects

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimage.py

    r2125 r2179  
    867867    azmOff = data['azmthOff']
    868868    Dazm = (LRazm[1]-LRazm[0])/numAzms
    869     if 'log(q)' in data['binType']:
    870         lutth = np.log(4.*np.pi*npsind(LUtth/2.)/data['wavelength'])
     869    if '2-theta' in data.get('binType','2-theta'):
     870        lutth = LUtth               
    871871    elif 'Q' == data['binType']:
    872872        lutth = 4.*np.pi*npsind(LUtth/2.)/data['wavelength']
    873     elif '2-theta' in data['binType']:
    874         lutth = LUtth               
     873    elif 'log(q)' in data['binType']:
     874        lutth = np.log(4.*np.pi*npsind(LUtth/2.)/data['wavelength'])
    875875    dtth = (lutth[1]-lutth[0])/numChans
    876     muT = data['SampleAbs'][0]
     876    muT = data.get('SampleAbs',[0.0,''])[0]
    877877    if 'SASD' in data['type']:
    878878        muT = -np.log(muT)/2.       #Transmission to 1/2 thickness muT
     
    909909            tax = np.where(tax > LRazm[1],tax-360.,tax)                 #put azm inside limits if possible
    910910            tax = np.where(tax < LRazm[0],tax+360.,tax)
    911             if data['SampleAbs'][1]:
     911            if data.get('SampleAbs',[0.0,''])[1]:
    912912                if 'Cylind' in data['SampleShape']:
    913913                    muR = muT*(1.+npsind(tax)**2/2.)/(npcosd(tay))      #adjust for additional thickness off sample normal
     
    915915                elif 'Fixed' in data['SampleShape']:    #assumes flat plate sample normal to beam
    916916                    tabs = G2pwd.Absorb('Fixed',muT,tay)
    917             if 'log(q)' in data['binType']:
     917            if 'log(q)' in data.get('binType',''):
    918918                tay = np.log(4.*np.pi*npsind(tay/2.)/data['wavelength'])
    919             elif 'Q' == data['binType']:
     919            elif 'Q' == data.get('binType',''):
    920920                tay = 4.*np.pi*npsind(tay/2.)/data['wavelength']
    921921            t0 = time.time()
     
    932932    H0 = np.nan_to_num(H0)
    933933    H2 = np.array([tth for tth in np.linspace(lutth[0],lutth[1],numChans+1)])
    934     if 'log(q)' in data['binType']:
     934    if 'log(q)' in data.get('binType',''):
    935935        H2 = 2.*npasind(np.exp(H2)*data['wavelength']/(4.*np.pi))
    936     elif 'Q' == data['binType']:
     936    elif 'Q' == data.get('binType',''):
    937937        H2 = 2.*npasind(H2*data['wavelength']/(4.*np.pi))
    938938    if Dazm:       
Note: See TracChangeset for help on using the changeset viewer.