Changeset 5124


Ignore:
Timestamp:
Jan 6, 2022 8:31:27 AM (7 months ago)
Author:
vondreele
Message:

Fix problem of computing Bragg peak background function with irregular stepped data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwd.py

    r5113 r5124  
    905905    yb = np.zeros_like(xdata)
    906906    nBak = 0
    907     cw = np.diff(xdata)
    908     cw = np.append(cw,cw[-1])
     907    # cw = np.diff(xdata)
     908    # cw = np.append(cw,cw[-1])
    909909    sumBk = [0.,0.,0]
    910910    while True:
     
    10091009                iFin = np.searchsorted(xdata,pkP+fmax)
    10101010            if 'C' in dataType:
     1011                # ybi = pkI*getFCJVoigt3(pkP,pkS,pkG,0.002,xdata[iBeg:iFin])[0]
     1012                # yb[iBeg:iFin] += ybi/cw[iBeg:iFin]
    10111013                ybi = pkI*getFCJVoigt3(pkP,pkS,pkG,0.002,xdata[iBeg:iFin])[0]
    1012                 yb[iBeg:iFin] += ybi/cw[iBeg:iFin]
     1014                yb[iBeg:iFin] += ybi
    10131015            elif 'T' in dataType:
    10141016                ybi = pkI*getEpsVoigt(pkP,1.,1.,pkS,pkG,xdata[iBeg:iFin])[0]
     
    10471049    dydpk = np.zeros(shape=(4*parmDict[hfx+'nPeaks'],len(xdata)))
    10481050    dydfb = []
    1049     cw = np.diff(xdata)
    1050     cw = np.append(cw,cw[-1])
     1051    # cw = np.diff(xdata)
     1052    # cw = np.append(cw,cw[-1])
    10511053
    10521054    if bakType in ['chebyschev','cosine','chebyschev-1']:
     
    11481150                # dydpk[4*iD+2][iBeg:iFin] += 100.*cw[iBeg:iFin]*pkI*dFds
    11491151                # dydpk[4*iD+3][iBeg:iFin] += 100.*cw[iBeg:iFin]*pkI*dFdg
    1150                 dydpk[4*iD][iBeg:iFin] += 1000.*pkI*dFdp
    1151                 dydpk[4*iD+1][iBeg:iFin] += 1000.*Df
    1152                 dydpk[4*iD+2][iBeg:iFin] += 1000.*pkI*dFds
    1153                 dydpk[4*iD+3][iBeg:iFin] += 1000.*pkI*dFdg
     1152                dydpk[4*iD][iBeg:iFin] += pkI*dFdp
     1153                dydpk[4*iD+1][iBeg:iFin] += Df
     1154                dydpk[4*iD+2][iBeg:iFin] += pkI*dFds
     1155                dydpk[4*iD+3][iBeg:iFin] += pkI*dFdg
    11541156            else:   #'T'OF
    11551157                Df,dFdp,x,x,dFds,dFdg = getdEpsVoigt(pkP,1.,1.,pkS,pkG,xdata[iBeg:iFin])
Note: See TracChangeset for help on using the changeset viewer.