Changeset 2818 for trunk/GSASIIobj.py


Ignore:
Timestamp:
May 2, 2017 1:39:22 PM (6 years ago)
Author:
vondreele
Message:

add GetPhaseNames?(fl) to G2obj - uses opened gpx file
fix PhaseSelector? & remove ShowBusy? & DoneBusy? from G2IO - not used ever

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIobj.py

    r2817 r2818  
    864864import sys
    865865import os.path as ospath
     866import cPickle
    866867import GSASIIpath
    867868import GSASIImath as G2mth
     
    980981'''
    981982P1SGData = G2spc.SpcGroup('P 1')[1] # data structure for default space group
     983
     984def GetPhaseNames(fl):
     985    ''' Returns a list of phase names found under 'Phases' in GSASII gpx file
     986    NB: there is another one of these in GSASIIstrIO.py that uses the gpx filename
     987
     988    :param file fl: opened .gpx file
     989    :return: list of phase names
     990    '''
     991    PhaseNames = []
     992    while True:
     993        try:
     994            data = cPickle.load(fl)
     995        except EOFError:
     996            break
     997        datum = data[0]
     998        if 'Phases' == datum[0]:
     999            for datus in data[1:]:
     1000                PhaseNames.append(datus[0])
     1001    fl.seek(0)          #reposition file
     1002    return PhaseNames
    9821003
    9831004def SetNewPhase(Name='New Phase',SGData=None,cell=None,Super=None):
Note: See TracChangeset for help on using the changeset viewer.