Changeset 4113 for trunk/GSASIIplot.py


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.

File:
1 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)
Note: See TracChangeset for help on using the changeset viewer.