Changeset 1494


Ignore:
Timestamp:
Sep 12, 2014 7:27:57 AM (9 years ago)
Author:
vondreele
Message:

add traps for bad peak profiles where iBeg > iFin caused crash

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrMath.py

    r1493 r1494  
    16571657                elif not iBeg-iFin:     #peak above high limit - done
    16581658                    break
     1659                elif iBeg > iFin:   #bad peak coeff - skip
     1660                    continue
    16591661                yc[iBeg:iFin] += refl[11]*refl[9]*G2pwd.getFCJVoigt3(refl[5],refl[6],refl[7],shl,ma.getdata(x[iBeg:iFin]))    #>90% of time spent here
    16601662                if Ka2:
     
    16671669                    elif not iBeg-iFin:     #peak above high limit - done
    16681670                        return yc,yb
     1671                    elif iBeg > iFin:   #bad peak coeff - skip
     1672                        continue
    16691673                    yc[iBeg:iFin] += refl[11]*refl[9]*kRatio*G2pwd.getFCJVoigt3(pos2,refl[6],refl[7],shl,ma.getdata(x[iBeg:iFin]))        #and here
    16701674            elif 'T' in calcControls[hfx+'histType']:
     
    16921696                elif not iBeg-iFin:     #peak above high limit - done
    16931697                    break
     1698                elif iBeg > iFin:   #bad peak coeff - skip
     1699                    continue
    16941700                yc[iBeg:iFin] += refl[11]*refl[9]*G2pwd.getEpsVoigt(refl[5],refl[12],refl[13],refl[6],refl[7],ma.getdata(x[iBeg:iFin]))/cw[iBeg:iFin]
    16951701#        print 'profile calc time: %.3fs'%(time.time()-time0)
     
    18201826            else:   #'T'OF
    18211827                lenBF = iFin-iBeg
     1828                if lenBF < 0:   #bad peak coeff
     1829                    break
    18221830                dMdpk = np.zeros(shape=(6,lenBF))
    18231831                dMdipk = G2pwd.getdEpsVoigt(refl[5],refl[12],refl[13],refl[6],refl[7],ma.getdata(x[iBeg:iFin]))
Note: See TracChangeset for help on using the changeset viewer.