Changeset 2546 for trunk/GSASIIsasd.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/GSASIIsasd.py

    r2308 r2546  
    564564    lam2 = (-1.0*qb+np.sqrt(radic))/(2.0*qa)
    565565    lam = min(lam1,lam2)
    566     test = 1.0 + 2.0*eta
    567566    mu = lam*eta*etam1
    568567    alp = (1.0 + 2.0*eta - mu)/(etam1*etam1)
     
    939938            print " MaxEnt trial/max: %3d/%3d" % ((iter+1), IterMax)
    940939            print " Residual: %5.2lf%% Entropy: %8lg" % (100*test, S)
    941             if iter > 0:
    942                 value = 100*( math.sqrt(chisq/chtarg)-1)
    943             else:
    944                 value = 0
    945       #      print " %12.5lg %10.4lf" % ( math.sqrt(chtarg/npt), value )
    946940            print " Function sum: %.6lg Change from last: %.2lf%%\n" % (fSum,100*fChange/fSum)
    947941
     
    10571051        'Spherical shell': [SphericalShellFF, SphericalShellVol]}
    10581052    Shape = data['Size']['Shape'][0]
    1059     SlitLen = Sample.get('SlitLen',0.0)
    10601053    Parms = data['Size']['Shape'][1:]
    10611054    if data['Size']['logBins']:
     
    10921085    Ic[Ibeg:Ifin] += Back[0]
    10931086    print ' Final chi^2: %.3f'%(chisq)
    1094     Vols = shapes[Shape][1](Bins,Parms)
    10951087    data['Size']['Distribution'] = [Bins,Dbins,BinMag/(2.*Dbins)]
    10961088       
     
    12691261        result = so.leastsq(calcSASD,values,full_output=True,epsfcn=1.e-8,   #ftol=Ftol,
    12701262            args=(Q[Ibeg:Ifin],Io[Ibeg:Ifin],wtFactor*wt[Ibeg:Ifin],Ifb[Ibeg:Ifin],levelTypes,parmDict,varyList))
    1271         ncyc = int(result[2]['nfev']/2)
    12721263        parmDict.update(zip(varyList,result[0]))
    12731264        chisq = np.sum(result[2]['fvec']**2)
     
    13231314#    pdb.set_trace()
    13241315    partData = sasdData['Particle']
    1325     matFrac = partData['Matrix']['VolFrac'] #[value,flag]       
    1326     Scale = Sample['Scale']     #[value,flag]
    1327     SlitLen = Sample.get('SlitLen',0.0)
    13281316    Back = sasdData['Back']
    13291317    Q,Io,wt,Ic,Ib,Ifb = Profile[:6]
    13301318    Qmin = Limits[1][0]
    13311319    Qmax = Limits[1][1]
    1332     wtFactor = ProfDict['wtFactor']
    13331320    Ibeg = np.searchsorted(Q,Qmin)
    13341321    Ifin = np.searchsorted(Q,Qmax)+1    #include last point
     
    14161403        distFxn = 'LogNormalDist'
    14171404        cumeFxn = 'LogNormalCume'
    1418         pos = distDict['MinSize']
    1419         args = [distDict['Mean'],distDict['StdDev']]
    1420         step = 4.*np.sqrt(np.exp(distDict['StdDev']**2)*(np.exp(distDict['StdDev']**2)-1.))
    1421         mode = distDict['MinSize']+distDict['Mean']/np.exp(distDict['StdDev']**2)
    1422         minX = 1. #pos
    1423         maxX = 1.e4 #np.min([mode+nPoints*step*40,1.e5])
    14241405    elif 'Gauss' in DistName:
    14251406        distFxn = 'GaussDist'
    14261407        cumeFxn = 'GaussCume'
    1427         pos = distDict['Mean']
    1428         args = [distDict['StdDev']]
    1429         step = 0.02*distDict['StdDev']
    1430         mode = distDict['Mean']
    1431         minX = np.max([mode-4.*distDict['StdDev'],1.])
    1432         maxX = np.min([mode+4.*distDict['StdDev'],1.e5])
    14331408    elif 'LSW' in DistName:
    14341409        distFxn = 'LSWDist'
    14351410        cumeFxn = 'LSWCume'
    1436         pos = distDict['Mean']
    1437         args = []
    1438         minX,maxX = [0.,2.*pos]
    14391411    elif 'Schulz' in DistName:
    14401412        distFxn = 'SchulzZimmDist'
    14411413        cumeFxn = 'SchulzZimmCume'
    1442         pos = distDict['Mean']
    1443         args = [distDict['StdDev']]
    1444         minX = np.max([1.,pos-4.*distDict['StdDev']])
    1445         maxX = np.min([pos+4.*distDict['StdDev'],1.e5])
    14461414    nP = 500
    14471415    Diam = np.logspace(0.,5.,nP,True)
     
    14831451            raise Exception("file not found: " + filename)
    14841452        buf = [line.split() for line in open(filename, 'r').readlines()]
    1485         M = len(buf)
    14861453        buf = zip(*buf)         # transpose rows and columns
    14871454        q  = np.array(buf[0], dtype=np.float64)
Note: See TracChangeset for help on using the changeset viewer.