Changeset 2546 for trunk/GSASIIpwd.py


Ignore:
Timestamp:
Nov 22, 2016 1:08:48 PM (5 years ago)
Author:
vondreele
Message:

cleanup of all GSASII main routines - remove unused variables, dead code, etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwd.py

    r2522 r2546  
    2020
    2121import numpy as np
    22 import scipy as sp
    2322import numpy.linalg as nl
    2423import numpy.ma as ma
     
    3433import GSASIIspc as G2spc
    3534import GSASIIElem as G2elem
    36 import GSASIIgrid as G2gd
    37 import GSASIIIO as G2IO
    3835import GSASIImath as G2mth
    3936import pypowder as pyd
     
    180177       
    181178    Sth2 = npsind(Tth/2.0)**2
    182     Cth2 = 1.-Sth2
    183179    if 'Cylinder' in Geometry:      #Lobanov & Alte da Veiga for 2-theta = 0; beam fully illuminates sample
    184180        if 'array' in str(type(MuR)):
     
    308304    #Apply angle dependent corrections
    309305    Tth = xydata['IofQ'][1][0]
    310     dt = (Tth[1]-Tth[0])
    311306    MuR = Abs*data['Diam']/20.0
    312307    xydata['IofQ'][1][1] /= Absorb(data['Geometry'],MuR,Tth)
     
    318313    #convert to Q
    319314    if 'C' in inst['Type'][0]:
    320         hc = 12.397639
    321315        wave = G2mth.getWave(inst)
    322         keV = hc/wave
    323316        minQ = npT2q(Tth[0],wave)
    324317        maxQ = npT2q(Tth[-1],wave)   
     
    559552    extended by exponential coeff.
    560553    '''
    561     lnf = 3.3      # =log(0.001/2)
    562554    widths = [np.sqrt(sig),gam]
    563555    fwhm = 2.355*widths[0]+2.*widths[1]
     
    887879    Df,dFdp,dFds,dFdg,dFdsh = pyd.pydpsvfcj(len(xdata),xdata-pos,pos,sig,gam,shl)
    888880#    Df,dFdp,dFds,dFdg,dFdsh = pyd.pydpsvfcjo(len(xdata),xdata-pos,pos,sig,gam,shl)
    889     sumDf = np.sum(Df)
    890881    return Df,dFdp,dFds,dFdg,dFdsh
    891882
     
    901892   
    902893    Df,dFdp,dFds,dFdg = pyd.pydpsvoigt(len(xdata),xdata-pos,sig,gam)
    903     sumDf = np.sum(Df)
    904894    return Df,dFdp,dFds,dFdg
    905895
     
    913903    'needs a doc string'
    914904    Df,dFdp,dFda,dFdb,dFds,dFdg = pyd.pydepsvoigt(len(xdata),xdata-pos,alp,bet,sig,gam)
    915     sumDf = np.sum(Df)
    916905    return Df,dFdp,dFda,dFdb,dFds,dFdg   
    917906
     
    16881677    if controls:
    16891678        Ftol = controls['min dM/M']
    1690         derivType = controls['deriv type']
    16911679    else:
    16921680        Ftol = 0.0001
    1693         derivType = 'analytic'
    16941681    if oneCycle:
    16951682        Ftol = 1.0
     
    18251812    Parms = []
    18261813#cell parms
    1827     cell = Layers['Cell']
    18281814    if Layers['Laue'] in ['-3','-3m','4/m','4/mmm','6/m','6/mmm']:
    18291815        Parms.append('cellA')
     
    18361822            Parms.append('cellG')
    18371823#Transition parms
    1838     Trans = Layers['Transitions']
    18391824    for iY in range(len(Layers['Layers'])):
    18401825        for iX in range(len(Layers['Layers'])):
     
    20442029    SFdat = []
    20452030    for atType in atTypes:
    2046         if atType == 'H':
    2047             blen = -.3741
    2048         else:
    2049             blen = Layers['AtInfo'][atType]['Isotopes']['Nat. Abund.']['SL'][0]
    20502031        Adat = atmdata.XrayFF[atType]
    20512032        SF = np.zeros(9)
     
    22062187    SetStackingTrans(Layers,Nlayers)
    22072188# result as Sadp
    2208     mirror = laueId in [-1,2,3,7,8,9,10]
    22092189    Nspec = 20001       
    22102190    spec = np.zeros(Nspec,dtype='double')   
     
    22372217    'needs a doc string'
    22382218#    global NeedTestData
    2239     NeedTestData = False
    22402219    global bakType
    22412220    bakType = 'chebyschev'
     
    22752254def test0():
    22762255    if NeedTestData: TestData()
    2277     msg = 'test '
    22782256    gplot = plotter.add('FCJ-Voigt, 11BM').gca()
    22792257    gplot.plot(xdata,getBackground('',parmDict0,bakType,'PXC',xdata)[0])   
     
    22872265    time0 = time.time()
    22882266    for i in range(100):
    2289         y = getPeakProfile(parmDict1,xdata,varyList,bakType)
     2267        getPeakProfile(parmDict1,xdata,varyList,bakType)
    22902268    print '100+6*Ka1-2 peaks=1200 peaks',time.time()-time0
    22912269   
Note: See TracChangeset for help on using the changeset viewer.