def errFitZ(values, ibrav, d, H, tth, wave, Z, Zref):
    Zero = Z
    if Zref:
        Zero = values[-1]
    A = Values2A(ibrav, values)
    Qo = 1. / d**2
    Qc = G2lat.calc_rDsqZ(H, A, Zero, tth, wave)
    return (Qo - Qc)
Exemple #2
0
def errFitZ(values,ibrav,d,H,tth,wave,Z,Zref):
    Zero = Z
    if Zref:    
        Zero = values[-1]
    A = Values2A(ibrav,values)
    Qo = 1./d**2
    Qc = G2lat.calc_rDsqZ(H,A,Zero,tth,wave)
    return (Qo-Qc)
def refinePeaksZ(peaks, wave, ibrav, A, Zero, ZeroRef):
    'needs a doc string'
    dmin = getDmin(peaks)
    OK, smin, Aref, Z, result = FitHKLZ(wave, ibrav, peaks, A, Zero, ZeroRef)
    Peaks = np.array(peaks).T
    H = Peaks[4:7]
    Peaks[8] = 1. / np.sqrt(G2lat.calc_rDsqZ(H, Aref, Z, Peaks[0], wave))
    peaks = Peaks.T
    HKL = G2lat.GenHBravais(dmin, ibrav, A)
    M20, X20 = calc_M20(peaks, HKL)
    return len(HKL), M20, X20, Aref, Z
Exemple #4
0
def refinePeaksZ(peaks,wave,ibrav,A,Zero,ZeroRef):
    'needs a doc string'
    dmin = getDmin(peaks)
    OK,smin,Aref,Z,result = FitHKLZ(wave,ibrav,peaks,A,Zero,ZeroRef)
    Peaks = np.array(peaks).T
    H = Peaks[4:7]
    Peaks[8] = 1./np.sqrt(G2lat.calc_rDsqZ(H,Aref,Z,Peaks[0],wave))
    peaks = Peaks.T    
    HKL = G2lat.GenHBravais(dmin,ibrav,A)
    M20,X20 = calc_M20(peaks,HKL)
    return len(HKL),M20,X20,Aref,Z