Ignore:
Timestamp:
May 4, 2017 4:06:25 PM (5 years ago)
Author:
vondreele
Message:

PWDR import now scriptable for single bank patterns

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIscriptable.py

    r2817 r2820  
    1313import sys
    1414import cPickle
     15import imp
    1516import GSASIIpath
    1617import GSASIIobj as G2obj
     
    9697    print('project save successful')
    9798   
    98 def ImportPowder(filename,reader):
    99     print 'importer'
     99def ImportPowder(reader,filename,bankNo=0):
     100    rdfile,rdpath,descr = imp.find_module(reader)
     101    rdclass = imp.load_module(reader,rdfile,rdpath,descr)
     102    rd = rdclass.GSAS_ReaderClass()   
     103    fl = open(filename)
     104    if rd.ContentsValidator(fl):
     105        fl.seek(0)
     106        rd.selections = [bankNo,]
     107        if rd.Reader(filename,fl):
     108            return rd
     109    print rd.errors
     110    return None
    100111   
    101112
Note: See TracChangeset for help on using the changeset viewer.