Ignore:
Timestamp:
Apr 13, 2015 12:59:34 PM (7 years ago)
Author:
vondreele
Message:

remove user reject HKL selection from Reflection List
implement rule bases user reject for HKLF reflections in Controls
user rejection changes mul to -mul; reflection list shows this in red
implement tool tip on 3Dhkl plots showing hkl indices on each point encountered

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrMath.py

    r1786 r1787  
    23882388    return dMdv
    23892389   
     2390def UserRejectHKL(ref,im,userReject):
     2391    if ref[5+im]/ref[6+im] < userReject['minF/sig']:
     2392        return False
     2393    elif userReject['MaxD'] < ref[4+im] > userReject['MinD']:
     2394        return False
     2395    elif ref[11+im] < userReject['MinExt']:
     2396        return False
     2397    elif abs(ref[5+im]-ref[7+im])/ref[6+im] > userReject['MaxDF/F']:
     2398        return False
     2399    return True
     2400   
     2401   
     2402   
    23902403def dervHKLF(Histogram,Phase,calcControls,varylist,parmDict,rigidbodyDict):
    23912404    '''Loop over reflections in a HKLF histogram and compute derivatives of the fitting
     
    24062419        SSGMT = np.array([ops[0].T for ops in SSGData['SSGOps']])
    24072420        im = 1  #offset in SS reflection list
    2408         #??
    24092421    A = [parmDict[pfx+'A%d'%(i)] for i in range(6)]
    24102422    G,g = G2lat.A2Gmat(A)       #recip & real metric tensors
     
    24262438                dervDict = SCExtinction(ref,im,phfx,hfx,pfx,calcControls,parmDict,varylist+dependentVars)[1]
    24272439                w = 1.0/ref[6+im]
    2428                 if w*ref[5+im] >= calcControls['minF/sig'] and ref[3+im] > 0:
     2440                if ref[3+im] > 0:
    24292441                    wdf[iref] = w*(ref[5+im]-ref[7+im])
    24302442                    for j,var in enumerate(varylist):
     
    24552467                Fc = np.sqrt(ref[7+im])
    24562468                w = 1.0/ref[6+im]
    2457                 if ref[5+im]/ref[6+im] >= calcControls['minF/sig'] and ref[3+im] > 0:
     2469                if ref[3+im] > 0:
    24582470                    wdf[iref] = 2.0*Fo*w*(Fo-Fc)
    24592471                    for j,var in enumerate(varylist):
     
    26832695                SSGMT = np.array([ops[0].T for ops in SSGData['SSGOps']])
    26842696                im = 1  #offset in SS reflection list
    2685                 #??
    26862697            A = [parmDict[pfx+'A%d'%(i)] for i in range(6)]
    26872698            G,g = G2lat.A2Gmat(A)       #recip & real metric tensors
     
    27082719                        ref[7+im] = parmDict[phfx+'Scale']*ref[9+im]*ref[11+im]  #correct Fc^2 for extinction
    27092720                        ref[8+im] = ref[5+im]/(parmDict[phfx+'Scale']*ref[11+im])
    2710                         if w*ref[5+im] >= calcControls['minF/sig'] and ref[3+im] > 0:  #min cutoff & user rejection
     2721                        if UserRejectHKL(ref,im,calcControls['UsrReject']):
     2722                            ref[3+im] = abs(ref[3+im])      #mark as allowed
    27112723                            Fo = np.sqrt(ref[5+im])
    27122724                            sumFo += Fo
     
    27182730                            sumwYo += (w*ref[5+im])**2      #w*Fo^2
    27192731                        else:
     2732                            ref[3+im] = -abs(ref[3+im])      #mark as rejected
    27202733                            nrej += 1
    27212734            else:
     
    27282741                        Fc = np.sqrt(ref[7+im])
    27292742                        w = 2.0*(Fo/ref[6+im])**2    # 1/sig(F)?
    2730                         if ref[5+im]/ref[6+im] >= calcControls['minF/sig'] and ref[3+im] > 0:  #min cutoff & user rejection
     2743                        if UserRejectHKL(ref,im,calcControls['UsrReject']):
     2744                            ref[3+im] = abs(ref[3+im])      #mark as allowed
    27312745                            sumFo += Fo
    27322746                            sumFo2 += ref[5+im]
     
    27372751                            sumwYo += (w*Fo)**2
    27382752                        else:
     2753                            ref[3+im] = -abs(ref[3+im])      #mark as rejected
    27392754                            nrej += 1
    27402755            Histogram['Residuals']['Nobs'] = nobs
Note: See TracChangeset for help on using the changeset viewer.