Changeset 4337


Ignore:
Timestamp:
Mar 3, 2020 7:45:23 AM (4 years ago)
Author:
vondreele
Message:

add 'Va' for vacancy to valence table
skip 'Va' atoms in partials plots from RMCProfile
add 6 more colors (from xkcd list of "standard" colors) in various plots
fix bug in bond valence sum stuff in RMCProfile

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r4334 r4337  
    43404340        # rdlist is only expected to have one element
    43414341        rd = rdlist[0]
     4342        Strict = True
     4343        if 'rmc6f' in rd.readfilename:
     4344            Strict = False
     4345            idx = -1
    43424346        G2frame.OnFileSave(event)
    43434347        # rd contains all info for a phase
     
    43514355        for atom in rd.Phase['Atoms']:
    43524356            try:
    4353                 idx = atomNames.index(''.join(atom[:ct+1]).capitalize())  #eliminate spurious differences
     4357                if Strict:
     4358                    idx = atomNames.index(''.join(atom[:ct+1]).capitalize())  #eliminate spurious differences
     4359                else:
     4360                    idx += 1
    43544361                atId = atomData[idx][cia+8]                                 #save old Id
    43554362                atomData[idx][:cia+8] = atom[:cia+8]+[atId,]
     
    47684775                        valChoice = atmdata.BVSoxid[RMCPdict['atSeq'][itype]]
    47694776                        valSel = wx.ComboBox(G2frame.FRMC,choices=valChoice,style=wx.CB_DROPDOWN|wx.TE_READONLY)
    4770                         valSel.SetStringSelection(RMCPdict['Oxid'][itype][0])
     4777                        try:
     4778                            valSel.SetStringSelection(RMCPdict['Oxid'][itype][0])
     4779                        except IndexError:
     4780                            RMCPdict['Oxid'].append([RMCPdict['atSeq'][itype],0.0])
    47714781                        valSel.Bind(wx.EVT_COMBOBOX,OnValSel)
    47724782                        Indx[valSel.GetId()] = itype
     
    54495459                    if 'Q' in label:
    54505460                        XY = [[X.T,Y.T] for iy,Y in enumerate(Partials) if 'Va' not in Names[iy+1]]
    5451                         Names = [name for name in Names if 'Va' not in name]
    54525461                    else:
    5453                         XY = [[X.T,(DX*Y.T)] for Y in Partials]
     5462                        XY = [[X.T,(DX*Y.T)] for iy,Y in enumerate(Partials) if 'Va' not in Names[iy+1]]
     5463                    Names = [name for name in Names if 'Va' not in name]
    54545464                    if 'G(R)' in Labels[label][1]:
    54555465                        if ifNeut:
     
    54745484                            if '-' in name:
    54755485                                at1,at2 = name.strip().split('-')
    5476                                 bcorr.append(bfac[at1]*bfac[at2])
     5486                                if 'Va' in name:
     5487                                    bcorr.append(0.)
     5488                                else:
     5489                                    bcorr.append(bfac[at1]*bfac[at2])
    54775490                                if at1 == at2:
    54785491                                    bcorr[-1] /= 2.         #no double counting
  • trunk/GSASIIplot.py

    r4334 r4337  
    2424:func:`PlotStructure`         Crystal structure plotting with balls, sticks, lines,
    2525                              ellipsoids, polyhedra and magnetic moments
     26:func:`PlotBeadModel`         Plots representation of protein shape from small angle scattering
    2627:func:`Plot1DSngl`            1D stick plots of structure factors                             
    2728:func:`PlotSngl`              Structure factor plotting
     
    3233:func:`PlotXY`                Simple plot of xy data
    3334:func:`PlotXYZ`               Simple contour plot of xyz data
     35:func:`PlotXYZvect`           Scatter Plot for 3D cartesian vectors
     36:func:`Plot3Dxyz`             Surface Plot for 3D vectors
    3437:func:`PlotAAProb`            Protein "quality" plot
    3538:func:`PlotStrain`            Plot of strain data, used for diagnostic purposes
     
    32383241                    if 'PWDR' in plottype:
    32393242                        Plot.set_yscale("log",nonposy='mask')
    3240                         Plot.plot(X,Y,colors[0]+pP,picker=3.,clip_on=Clip_on,label=incCptn('obs'))
     3243                        Plot.plot(X,Y,marker=pP,color=colors[0],picker=3.,clip_on=Clip_on,label=incCptn('obs'))
    32413244                        if G2frame.SinglePlot or G2frame.plusPlot:
    32423245                            Plot.plot(X,Z,colors[1],picker=False,label=incCptn('calc'))
     
    32543257                                    ecolor=colors[0],picker=3.,clip_on=Clip_on,label=incCptn('obs'))
    32553258                        else:
    3256                             Plot.plot(X,YB,colors[0]+pP,picker=3.,clip_on=Clip_on,label=incCptn('obs'))
     3259                            Plot.plot(X,YB,marker=pP,color=colors[0],picker=3.,clip_on=Clip_on,label=incCptn('obs'))
    32573260                        Plot.plot(X,W,colors[1],picker=False,label=incCptn('bkg'))     #const. background
    32583261                        Plot.plot(X,ZB,colors[2],picker=False,label=incCptn('calc'))
     
    32603263                    if G2frame.SubBack:
    32613264                        if 'PWDR' in plottype:
    3262                             ObsLine = Plot.plot(Xum,Y,colors[0]+pP,picker=False,clip_on=Clip_on,label=incCptn('obs-bkg'))  #Io-Ib
     3265                            ObsLine = Plot.plot(Xum,Y,color=colors[0],marker=pP,picker=False,clip_on=Clip_on,label=incCptn('obs-bkg'))  #Io-Ib
    32633266                            if np.any(Z):       #only if there is a calc pattern
    32643267                                CalcLine = Plot.plot(X,Z-W,colors[1],picker=False,label=incCptn('calc-bkg'))               #Ic-Ib
    32653268                        else:
    3266                             Plot.plot(X,YB,colors[0]+pP,picker=3.,clip_on=Clip_on,label=incCptn('obs'))
     3269                            Plot.plot(X,YB,color=colors[0],marker=pP,picker=3.,clip_on=Clip_on,label=incCptn('obs'))
    32673270                            Plot.plot(X,ZB,colors[2],picker=False,label=incCptn('calc'))
    32683271                    else:
    32693272                        if 'PWDR' in plottype:
    3270                             ObsLine = Plot.plot(Xum,Y,colors[0]+pP,picker=3.,clip_on=Clip_on,label=incCptn('obs'))    #Io
     3273                            ObsLine = Plot.plot(Xum,Y,color=colors[0],marker=pP,picker=3.,clip_on=Clip_on,label=incCptn('obs'))    #Io
    32713274                            CalcLine = Plot.plot(X,Z,colors[1],picker=False,label=incCptn('calc'))                 #Ic
    32723275                        else:
    3273                             Plot.plot(X,YB,colors[0]+pP,picker=3.,clip_on=Clip_on,label=incCptn('obs'))
     3276                            Plot.plot(X,YB,color=colors[0],marler=pP,picker=3.,clip_on=Clip_on,label=incCptn('obs'))
    32743277                            Plot.plot(X,ZB,colors[2],picker=False,label=incCptn('calc'))
    32753278                    if 'PWDR' in plottype and (G2frame.SinglePlot and G2frame.plusPlot):
     
    49734976        Plot.set_xlabel(r''+labelX,fontsize=14)
    49744977        Plot.set_ylabel(r''+labelY,fontsize=14)
    4975         colors=['b','r','g','c','m','k']
     4978        colors = ['xkcd:blue','xkcd:red','xkcd:green','xkcd:cyan','xkcd:magenta','xkcd:black',
     4979            'xkcd:pink','xkcd:brown','xkcd:teal','xkcd:orange','xkcd:grey','xkcd:violet',]
     4980        NC = len(colors)
    49764981        Page.keyPress = OnKeyPress
    49774982        Xmax = 0.
     
    49854990                dY = Page.Offset[1]*(ixy)*Ymax/100.
    49864991                if len(names):
    4987                     Plot.plot(X+dX,Y+dY,colors[ixy%6],picker=False,label=names[ixy])
     4992                    Plot.plot(X+dX,Y+dY,colors[ixy%NC],picker=False,label=names[ixy])
    49884993                else:
    4989                     Plot.plot(X+dX,Y+dY,colors[ixy%6],picker=False)
     4994                    Plot.plot(X+dX,Y+dY,colors[ixy%NC],picker=False)
    49904995            else:
    4991                 Plot.plot(X,Y,colors[ixy%6]+'+',picker=False)
     4996                Plot.plot(X,Y,marker='+',color=colors[ixy%NC],picker=False)
    49924997        if len(vertLines):
    49934998            for ixy,X in enumerate(vertLines):
    49944999                dX = Page.Offset[0]*(ixy)*Xmax/500.
    49955000                for x in X:
    4996                     Plot.axvline(x+dX,color=colors[ixy%6],dashes=(5,5),picker=False)
     5001                    Plot.axvline(x+dX,color=colors[ixy%NC],dashes=(5,5),picker=False)
    49975002        if XY2 is not None and len(XY2):
    49985003            for ixy,xy in enumerate(XY2):
     
    50015006                dY = Page.Offset[1]*(ixy+1)*Ymax/100.
    50025007                if len(names2):
    5003                     Plot.plot(X+dX,Y+dY,colors[ixy%6],picker=False,label=names2[ixy])
     5008                    Plot.plot(X+dX,Y+dY,colors[ixy%NC],picker=False,label=names2[ixy])
    50045009                else:
    5005                     Plot.plot(X+dX,Y+dY,colors[ixy%6],picker=False)
     5010                    Plot.plot(X+dX,Y+dY,colors[ixy%NC],picker=False)
    50065011        if len(names):
    50075012            Plot.legend(names,loc='best')
     
    52405245            xyzlim = np.array([Plot.get_xlim3d(),Plot.get_ylim3d(),Plot.get_zlim3d()]).T
    52415246            XYZlim = [min(xyzlim[0]),max(xyzlim[1])]
    5242     #        Plot.contour(X,Y,Z,10,zdir='x',offset=XYZlim[0])
    5243     #        Plot.contour(X,Y,Z,10,zdir='y',offset=XYZlim[1])
    5244     #        Plot.contour(X,Y,Z,10,zdir='z',offset=XYZlim[0])
    52455247            Plot.set_xlim3d(XYZlim)
    52465248            Plot.set_ylim3d(XYZlim)
    52475249            Plot.set_zlim3d(XYZlim)
     5250            Plot.set_title(Title)
     5251            Plot.set_xlabel(labelX)
     5252            Plot.set_ylabel(labelY)
     5253            Plot.set_zlabel(labelZ)
     5254            Plot.set_aspect('equal')
    52485255        except:
     5256            print('Plot3dXYZ failure')
    52495257            pass
    5250         try:
    5251             Plot.set_aspect('equal')
    5252         except: #broken in mpl 3.1.1; worked in mpl 3.0.3
    5253             pass
    5254         Plot.set_title(Title)
    5255         Plot.set_xlabel(labelX)
    5256         Plot.set_ylabel(labelY)
    5257         Plot.set_zlabel(labelZ)
    52585258        Page.canvas.draw()
    52595259       
     
    53485348    Plot.set_ylabel(r'd-spacing',fontsize=14)
    53495349    Plot.set_xlabel(r'Azimuth',fontsize=14)
    5350     colors=['b','g','r','c','m','k']
     5350#    colors=['b','g','r','c','m','k']
     5351    colors = ['xkcd:blue','xkcd:red','xkcd:green','xkcd:cyan','xkcd:magenta','xkcd:black',
     5352        'xkcd:pink','xkcd:brown','xkcd:teal','xkcd:orange','xkcd:grey','xkcd:violet',]
     5353    NC = len(colors)
    53515354    for N,item in enumerate(data['d-zero']):
    53525355        Y,X = np.array(item['ImtaObs'])         #plot azimuth as X & d-spacing as Y
    5353         Plot.plot(X,Y,colors[N%6]+'+',picker=False)
     5356        Plot.plot(X,Y,marker='+',color=colors[N%NC],picker=False)
    53545357        Y,X = np.array(item['ImtaCalc'])
    5355         Plot.plot(X,Y,colors[N%6],picker=False)
     5358        Plot.plot(X,Y,colors[N%NC],picker=False)
    53565359        Plot.plot([0.,360.],[item['Dcalc'],item['Dcalc']],colors[5],dashes=(5,5))
    53575360    if not newPlot:
     
    54445447        Plot.set_xlim([np.min(2.*Bins)/2.,np.max(2.*Bins)*2.])
    54455448    Plot.bar(2.*Bins-Dbins,BinMag,2.*Dbins,facecolor='white',edgecolor='green')       #plot diameters
    5446     colors=['b','r','c','m','k']
     5449#    colors=['b','r','c','m','k']
     5450    colors = ['xkcd:blue','xkcd:red','xkcd:green','xkcd:cyan','xkcd:magenta','xkcd:black',
     5451        'xkcd:pink','xkcd:brown','xkcd:teal','xkcd:orange','xkcd:grey','xkcd:violet',]
     5452    NC = len(colors)
    54475453    if 'Size Calc' in data:
    54485454        Rbins,Dist = data['Size Calc']
    54495455        for i in range(len(Rbins)):
    54505456            if len(Rbins[i]):
    5451                 Plot.plot(2.*Rbins[i],Dist[i],color=colors[i%5])       #plot diameters
     5457                Plot.plot(2.*Rbins[i],Dist[i],color=colors[i%NC])       #plot diameters
    54525458    Page.canvas.draw()
    54535459
     
    66516657            'press L to toggle lines, S to select X axis, T to change titles (reselect column to show?)',1)
    66526658        Plot.clear()
    6653         colors=['b','g','r','c','m','k']
     6659#        colors=['b','g','r','c','m','k']
     6660        colors = ['xkcd:blue','xkcd:red','xkcd:green','xkcd:cyan','xkcd:magenta','xkcd:black',
     6661            'xkcd:pink','xkcd:brown','xkcd:teal','xkcd:orange','xkcd:grey','xkcd:violet',]
     6662        NC = len(colors)
    66546663        uselist = G2frame.SeqTable.GetColValues(1)
    66556664        X = np.arange(0,G2frame.SeqTable.GetNumberRows(),1)
     
    66646673                G2frame.seqXaxis = None
    66656674        for ic,col in enumerate(Page.seqYaxisList):
    6666             Ncol = colors[ic%6]
     6675            Ncol = colors[ic%NC]
    66676676            name,Y,sig = Page.seqTableGet(col)
    66686677            if G2frame.seqReverse and not G2frame.seqXaxis:
     
    66936702            else:
    66946703                Plot.plot(Xnew,Ynew,color=Ncol)
    6695                 Plot.plot(Xnew,Ynew,'o',color=Ncol,label=name)
     6704                Plot.plot(Xnew,Ynew,marker='o',color=Ncol,label=name)
    66966705        if Page.fitvals: # TODO: deal with fitting of None values
    66976706            if G2frame.seqReverse and not G2frame.seqXaxis:
    66986707                Page.fitvals = Page.fitvals[::-1]
    6699             Plot.plot(X,Page.fitvals,label='Fit',color=colors[(ic+2)%6])
     6708            Plot.plot(X,Page.fitvals,label='Fit',color=colors[(ic+2)%NC])
    67006709           
    67016710        Plot.legend(loc='best')
     
    68866895    #Dsp = lambda tth,wave: wave/(2.*npsind(tth/2.))
    68876896    global Data,Masks,StrSta,Plot1,Page  # RVD: these are needed for multiple image controls/masks
    6888     colors=['b','g','r','c','m','k']
     6897#    colors=['b','g','r','c','m','k']
     6898    colors = ['xkcd:blue','xkcd:red','xkcd:green','xkcd:cyan','xkcd:magenta','xkcd:black',
     6899        'xkcd:pink','xkcd:brown','xkcd:teal','xkcd:orange','xkcd:grey','xkcd:violet',]
     6900    NC = len(colors)
    68896901    Data = G2frame.GPXtree.GetItemPyData(
    68906902        G2gd.GetGPXtreeItemId(G2frame,G2frame.Image, 'Image Controls'))
     
    77607772                for ring in Data['rings']:
    77617773                    xring,yring = np.array(ring).T[:2]
    7762                     Plot.plot(xring,yring,'.',color=colors[N%6])
     7774                    Plot.plot(xring,yring,'.',color=colors[N%NC])
    77637775                    N += 1
    77647776            for ellipse in Data['ellipses']:      #what about hyperbola?
     
    77717783                if 'ImxyCalc' in ring:
    77727784                    xringc,yringc = ring['ImxyCalc']
    7773                     Plot.plot(xringc,yringc,colors[N%6])
     7785                    Plot.plot(xringc,yringc,colors[N%NC])
    77747786                xring,yring = ring['ImxyObs']
    7775                 Plot.plot(xring,yring,colors[N%6]+'.')
     7787                Plot.plot(xring,yring,'.',colors[N%NC])
    77767788        # display the Masks
    77777789        if 'Frames' not in Masks: Masks['Frames'] = []  # patch
     
    1035210364    Plot.set_xlabel(r'$\Delta 2\theta, deg$',fontsize=14)
    1035310365    Plot.set_ylabel(r'Intensity (arbitrary)',fontsize=14)
    10354     refColors=['b','r','c','g','m','k']
     10366#    refColors=['b','r','c','g','m','k']
     10367    refColors = ['xkcd:blue','xkcd:red','xkcd:green','xkcd:cyan','xkcd:magenta','xkcd:black',
     10368        'xkcd:pink','xkcd:brown','xkcd:teal','xkcd:orange','xkcd:grey','xkcd:violet',]
    1035510369    ttmin = ttmax = 0
    1035610370    #GSASIIpath.IPyBreak()
  • trunk/GSASIIpwd.py

    r4334 r4337  
    21192119        if useSamBrd[0]:
    21202120            if 'ellipsoidal' not in Size[0]:    #take the isotropic term only
    2121                 Xsb = 1.e-4*difC/Size[1][0]/2.
     2121                Xsb = 1.e-4*difC/(2.*Size[1][0])
    21222122        if useSamBrd[1]:
    21232123            if 'generalized' not in Mustrain[0]:    #take the isotropic term only
     
    23942394        fl.write('  > RIJ :: %s\n'%' '.join(['%6.3f'%RMCPdict['BVS'][bvs][0] for bvs in RMCPdict['BVS']]))
    23952395        fl.write('  > BVAL :: %s\n'%' '.join(['%6.3f'%RMCPdict['BVS'][bvs][1] for bvs in RMCPdict['BVS']]))
    2396         fl.write('  > CUTOFF :: %s\n'%' '.join(['%6.3f'%RMCPdict['BVS'][bvs][3] for bvs in RMCPdict['BVS']]))       
     2396        fl.write('  > CUTOFF :: %s\n'%' '.join(['%6.3f'%RMCPdict['BVS'][bvs][2] for bvs in RMCPdict['BVS']]))       
    23972397        fl.write('  > SAVE :: 100000\n')
    23982398        fl.write('  > UPDATE :: 100000\n')
  • trunk/atmdata.py

    r4267 r4337  
    439439    'U' :['U+4','U+6',],
    440440    'V': ['V+5','V+4','V+3',],
     441    'Va':['Va',],   #vacancy
    441442    'W' :['W+6',],
    442443    'Y' :['Y+3',],
     
    549550    'V+3':[  1.743, 1.702, 2.19],     
    550551    'V+4':[  1.784, 1.7,   2.16],       
    551     'V+5':[  1.803, 1.71,  2.16],        
     552    'V+5':[  1.803, 1.71,  2.16],
    552553    'W+6':[  1.921, 1.83,  2.27],       
    553554    'Y+3':[  2.014, 1.904, 2.4],     
Note: See TracChangeset for help on using the changeset viewer.