Changeset 4113


Ignore:
Timestamp:
Aug 26, 2019 9:37:54 AM (2 years ago)
Author:
vondreele
Message:

add save SHAPES bead models as pdb files from plot - remove option to make SHAPES make pdb files since no longer needed.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r4100 r4113  
    91519151################################################################################
    91529152
    9153 def PlotBeadModel(G2frame,Atoms,defaults):
     9153def PlotBeadModel(G2frame,Atoms,defaults,PDBtext):
    91549154    '''Bead modelplotting package. For bead models from SHAPES
    91559155    '''
     
    93499349            cb.SetValue(' save as/key:')
    93509350            G2frame.G2plotNB.status.SetStatusText('Drawing saved to: '+Fname,1)
    9351 
     9351        elif mode == 'pdb':
     9352            Fname = os.path.join(Mydir,Page.name+'.'+mode)
     9353            PDB = open(Fname,'w')
     9354            PDB.write('REMARK    '+PDBtext+'\n')
     9355            for iatm,xyz in enumerate(XYZ):
     9356                PDB.write('ATOM   %4d  CA  ALA A%4d    %8.3f%8.3f%8.3f  1.00  0.00\n'%(iatm+1,iatm+1,xyz[0],xyz[1],xyz[2]))
     9357            PDB.close()
    93529358    # PlotRigidBody execution starts here (N.B. initialization above)
    93539359    new,plotNum,Page,Plot,lim = G2frame.G2plotNB.FindPlotTab('Bead model','ogl')
     
    93569362    Page.name = Atoms[0]
    93579363    Page.Choice = None
    9358     choice = [' save as:','jpeg','tiff','bmp',]
     9364    choice = [' save as:','jpeg','tiff','bmp','pdb',]
    93599365    cb = wx.ComboBox(G2frame.G2plotNB.status,style=wx.CB_DROPDOWN|wx.CB_READONLY,choices=choice)
    93609366    cb.Bind(wx.EVT_COMBOBOX, OnKeyBox)
  • trunk/GSASIIpwdGUI.py

    r4106 r4113  
    56765676    def ShapesSizer():
    56775677       
    5678         def OnPDBout(event):
    5679             data['Shapes']['pdbOut'] = not data['Shapes']['pdbOut']
     5678#        def OnPDBout(event):
     5679#            data['Shapes']['pdbOut'] = not data['Shapes']['pdbOut']
    56805680           
    56815681        def OnShapeSelect(event):
     
    57015701            print('%s %.3f'%('selected r value',pattern[-1]))
    57025702            print('%s %.3f'%('selected Delta P(r)',PRcalc[r][-1]))
     5703            PDBtext = 'P(R) dif: %.3f r-value: %.3f Nbeads: %d'%(PRcalc[r][-1],pattern[-1],len(selAtoms[1]))
    57035704#            RefreshPlots(True)
    57045705            G2plt.PlotPatterns(G2frame,plotType='SASD',newPlot=True)
    57055706            G2plt.PlotSASDPairDist(G2frame)
    5706             G2plt.PlotBeadModel(G2frame,selAtoms,plotDefaults)
     5707            G2plt.PlotBeadModel(G2frame,selAtoms,plotDefaults,PDBtext)
    57075708       
    57085709        shapeSizer = wx.BoxSizer(wx.VERTICAL)
     
    57415742        beadsep = G2G.ValidatedTxtCtrl(G2frame.dataWindow,data['Shapes'],'boxStep',min=3.5,max=5,nDig=(10,1))
    57425743        parmSizer.Add(beadsep,0,WACV)       
    5743         pdb = wx.CheckBox(G2frame.dataWindow,label=' Save as pdb files?: ')
    5744         pdb.SetValue(data['Shapes']['pdbOut'])
    5745         pdb.Bind(wx.EVT_CHECKBOX, OnPDBout)       
    5746         parmSizer.Add(pdb,0,WACV)
     5744#        pdb = wx.CheckBox(G2frame.dataWindow,label=' Save as pdb files?: ')
     5745#        pdb.SetValue(data['Shapes']['pdbOut'])
     5746#        pdb.Bind(wx.EVT_CHECKBOX, OnPDBout)       
     5747#        parmSizer.Add(pdb,0,WACV)
    57475748       
    57485749        shapeSizer.Add(parmSizer)
Note: See TracChangeset for help on using the changeset viewer.