Changeset 2499


Ignore:
Timestamp:
Oct 20, 2016 11:27:37 AM (7 years ago)
Author:
vondreele
Message:

move setting of G2frame.HKL from MakeReflectionTable? to ShowReflTable?; makes reflection tic mark tool tip match selected reflection list
work on Mag moment derivs.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r2486 r2499  
    12101210       G2frame.PatternId (contains the tree item for the current histogram)
    12111211       G2frame.PickId (contains the actual selected tree item (can be child of histogram)
    1212        G2frame.HKL (contains a reflection list -- when used unclear)
     1212       G2frame.HKL (used for tool tip display of hkl for selected phase reflection list)
    12131213    '''
    12141214    global exclLines
  • trunk/GSASIIpwdGUI.py

    r2492 r2499  
    34263426            elif 'T' in Inst['Type'][0]:
    34273427                refs = np.vstack((refList.T[:18+Super],I100)).T
    3428             G2frame.HKL = np.vstack((refList.T[:6+Super])).T    #build for plots
    34293428        rowLabels = [str(i) for i in range(len(refs))]
    34303429        Types = (4+Super)*[wg.GRID_VALUE_LONG,]+4*[wg.GRID_VALUE_FLOAT+':10,4',]+ \
     
    34993498            G2frame.refTable[phaseName].AutoSizeColumns(False)
    35003499            setBackgroundColors(im,itof)
     3500#        GSASIIpath.IPyBreak()
     3501        refList = np.array([refl[:6+im] for refl in data[phaseName]['RefList']])
     3502        G2frame.HKL = np.vstack((refList.T)).T    #build for plots
    35013503        # raise the tab (needed for 1st use and from OnSelectPhase)
    35023504        for PageNum in range(G2frame.dataDisplay.GetPageCount()):
  • trunk/GSASIIstrMath.py

    r2497 r2499  
    12851285        eDotK = np.sum(HM[:,:,nxs,nxs]*Gdata[:,nxs,:,:],axis=0)
    12861286        Q = HM[:,:,nxs,nxs]*eDotK[nxs,:,:,:]-Gdata[:,nxs,:,:] #Mxyz,Nref,Nop,Natm = BPM in magstrfc.for OK
    1287         dqdm = (HM*HM-1)[:,:,nxs,nxs]/Mag[nxs,nxs,:,:]
     1287        dqdm = np.array([np.outer(hm,hm)-np.eye(3) for hm in HM.T]).T   #Mxyz,Mxyz,Nref
    12881288        fam = Q*TMcorr[nxs,:,nxs,:]*cosm[nxs,:,:,:]*Mag[nxs,nxs,:,:]    #ditto
    12891289        fbm = Q*TMcorr[nxs,:,nxs,:]*sinm[nxs,:,:,:]*Mag[nxs,nxs,:,:]    #ditto
     
    12951295        dfadfr = np.sum(fam/occ,axis=2)        #array(Mxyz,refBlk,nAtom) Fdata != 0 avoids /0. problem
    12961296        dfadx = np.sum(twopi*Uniq[nxs,:,:,nxs,:]*famx[:,:,:,:,nxs],axis=2)
    1297         dfadmx = np.sum(TMcorr[nxs,:,nxs,:]*cosm[nxs,:,:,:]*(Mag[nxs,nxs,:,:]*dqdm+Q),axis=2)
    1298         dfadmx = np.reshape(dfadmx,(iFin-iBeg,-1,3))
     1297        dfadmx = np.sum(TMcorr[nxs,nxs,:,nxs,:]*cosm[nxs,nxs,:,:,:]*(dqdm[:,:,:,nxs,nxs]+Q[nxs,:,:,:,:]),axis=-2)
     1298        dfadmx = np.reshape(dfadmx,(3,iFin-iBeg,-1,3))
    12991299        dfadui = np.sum(-SQfactor[:,nxs,nxs]*fam,axis=2) #array(Ops,refBlk,nAtoms)
    13001300        dfadua = np.sum(-Hij[nxs,:,:,nxs,:]*fam[:,:,:,:,nxs],axis=2)
     
    13021302        dfbdfr = np.sum(fbm/occ,axis=2)        #array(mxyz,refBlk,nAtom) Fdata != 0 avoids /0. problem
    13031303        dfbdx = np.sum(twopi*Uniq[nxs,:,:,nxs,:]*fbmx[:,:,:,:,nxs],axis=2)
    1304         dfbdmx = np.sum(TMcorr[nxs,:,nxs,:]*sinm[nxs,:,:,:]*(Mag[nxs,nxs,:,:]*dqdm+Q),axis=2)
    1305         dfbdmx = np.reshape(dfbdmx,(iFin-iBeg,-1,3))
     1304        dfbdmx = np.sum(TMcorr[nxs,nxs,:,nxs,:]*sinm[nxs,nxs,:,:,:]*(dqdm[:,:,:,nxs,nxs]+Q[nxs,:,:,:,:]),axis=-2)
     1305        dfbdmx = np.reshape(dfbdmx,(3,iFin-iBeg,-1,3))
    13061306        dfbdui = np.sum(-SQfactor[:,nxs,nxs]*fbm,axis=2) #array(Ops,refBlk,nAtoms)
    13071307        dfbdua = np.sum(-Hij[nxs,:,:,nxs,:]*fbm[:,:,:,:,nxs],axis=2)
    13081308        dFdfr[iBeg:iFin] = np.sum(2.*(fams[:,:,nxs]*dfadfr+fbms[:,:,nxs]*dfbdfr)*Mdata/(2*Nops*Ncen),axis=0)
    13091309        dFdx[iBeg:iFin] = np.sum(2.*(fams[:,:,nxs,nxs]*dfadx+fbms[:,:,nxs,nxs]*dfbdx),axis=0)
    1310         dFdMx[iBeg:iFin] = 2.*(fams.T[:,nxs,:]*dfadmx+fbms.T[:,nxs,:]*dfbdmx)
     1310#        GSASIIpath.IPyBreak()
     1311        dFdMx[iBeg:iFin] = np.sum(2.*(fams[:,:,nxs,nxs]*dfadmx+fbms[:,:,nxs,nxs]*dfbdmx),axis=0)
    13111312        dFdui[iBeg:iFin] = 2.*np.sum(fams[:,:,nxs]*dfadui+fbms[:,:,nxs]*dfbdui,axis=0)
    13121313        dFdua[iBeg:iFin] = 2.*np.sum(fams[:,:,nxs,nxs]*dfadua+fbms[:,:,nxs,nxs]*dfbdua,axis=0)
    13131314        iBeg += blkSize
    1314 #        GSASIIpath.IPyBreak()
    13151315    print ' %d derivative time %.4f\r'%(nRef,time.time()-time0)
    13161316        #loop over atoms - each dict entry is list of derivatives for all the reflections
Note: See TracChangeset for help on using the changeset viewer.