Changeset 2820 for trunk/imports/G2pwd_fxye.py
- Timestamp:
- May 4, 2017 4:06:25 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/imports/G2pwd_fxye.py
r2817 r2820 17 17 import numpy as np 18 18 import GSASIIobj as G2obj 19 import GSASIIIO as G2IO20 19 import GSASIIpath 21 20 GSASIIpath.SetVersionNumber("$Revision$") … … 32 31 self.clockWd = {} 33 32 self.TimeMap = {} 33 self.dnames = [] 34 34 35 35 # Validate the contents -- look for a bank line 36 36 def ContentsValidator(self, filepointer): 37 'Valid ate by checking to see if the file has BANK lines'37 'Validrate by checking to see if the file has BANK lines & count them' 38 38 #print 'ContentsValidator: '+self.formatName 39 nBanks= 0 40 fname = ospath.basename(filepointer.name) 39 41 for i,line in enumerate(filepointer): 40 42 self.GSAS = True … … 46 48 if line[0] == '#': continue 47 49 if line[:4] == 'BANK': 48 return True 50 self.dnames.append(fname+' '+''.join(line.split()[:2])) 51 nBanks += 1 52 continue 49 53 elif line[:7] == 'Monitor': continue 50 54 elif line [:8] == 'TIME_MAP': #LANSCE TOF data 51 return True 52 else: 53 self.errors = 'Unexpected information in line: '+str(i+1) 54 if all([ord(c) < 128 and ord(c) != 0 for c in str(line)]): # show only if ASCII 55 self.errors += ' '+str(line) 56 else: 57 self.errors += ' (binary)' 58 return False 55 continue 56 # else: 57 # if not all(c in ' 0123456789.eE+-' for c in line[:-1]): 58 # self.errors = 'Unexpected information in line: '+str(i+1) 59 # self.errors += ' '+str(line) 60 # return False 61 if nBanks: 62 if not len(self.selections): 63 self.selections = range(nBanks) 64 return True 65 self.errors = 'No BANK records found' 59 66 return False # no bank records 60 67 … … 322 329 if self.repeatcount >= len(self.selections): self.repeat = False 323 330 else: # choose from options 324 if not len(self.selections): #use previous selection, otherwise...325 self.selections = G2IO.MultipleBlockSelector(326 Banks,327 ParentFrame=ParentFrame,328 title='Select Bank(s) to read from the list below',329 size=(600,300),330 header='Dataset Selector')331 if len(self.selections) == 0:332 self.errors = 'No banks selected'333 return False334 331 selblk = self.selections[0] # select first in list 335 332 if len(self.selections) > 1: # prepare to loop through again
Note: See TracChangeset
for help on using the changeset viewer.