Changeset 1100 for trunk/GSASIIphsGUI.py


Ignore:
Timestamp:
Oct 11, 2013 10:55:06 AM (9 years ago)
Author:
vondreele
Message:

finish 1st version (workable) of a PDB exporter for macromolecular structures
make exporter for Cartesian XYZ file for any phase

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r1097 r1100  
    16261626                       
    16271627    def OnReImport(event):
    1628         print 'reimport atoms from file to be developed'
     1628        generalData = data['General']
     1629        cx,ct,cs,cia = generalData['AtomPtrs']
    16291630        reqrdr = G2frame.dataFrame.ReImportMenuId.get(event.GetId())
    16301631        rdlist = G2frame.OnImportGeneric(reqrdr,
    1631                                          G2frame.ImportPhaseReaderlist,
    1632                                          'phase')
     1632            G2frame.ImportPhaseReaderlist,'phase')
    16331633        if len(rdlist) == 0: return
    1634         # for now rdlist is only expected to have one element
    1635         # for now always use the first phase for when multiple phases are ever implemented
    1636         # but it would be better to loop until we find a phase that matches the one in data
    1637         for rd in rdlist:
    1638             # rd contains all info for a phase
    1639             PhaseName = rd.Phase['General']['Name']
    1640             print 'Read phase '+str(PhaseName)+' from file '+str(G2frame.lastimport)
    1641             atomData = data['Atoms']
    1642             for atom in rd.Phase['Atoms'][:5]:
    1643                 print atom
    1644             for atom in atomData[:5]:
    1645                 print atom
    1646            
    1647             return
     1634        # rdlist is only expected to have one element
     1635        rd = rdlist[0]
     1636        G2frame.OnFileSave(event)
     1637        # rd contains all info for a phase
     1638        PhaseName = rd.Phase['General']['Name']
     1639        print 'Read phase '+str(PhaseName)+' from file '+str(G2frame.lastimport)
     1640        atomData = data['Atoms']
     1641        atomNames = []
     1642        for atom in atomData:
     1643            atomNames.append(atom[:ct+1])
     1644        for atom in rd.Phase['Atoms']:
     1645            try:
     1646                idx = atomNames.index(atom[:ct+1])
     1647                atomData[idx][:-1] = atom[:-1]
     1648            except ValueError:
     1649                print atom[:ct+1], 'not in Atom array; not updated'
     1650        wx.CallAfter(FillAtomsGrid,Atoms)
     1651         
    16481652                       
    16491653################################################################################
Note: See TracChangeset for help on using the changeset viewer.