Changeset 3757 for trunk/imports/G2pwd_FP.py
- Timestamp:
- Dec 7, 2018 4:03:37 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/imports/G2pwd_FP.py
r3136 r3757 21 21 import GSASIIpath 22 22 GSASIIpath.SetVersionNumber("$Revision: 1620 $") 23 class xye_ReaderClass(G2obj.ImportPowderData):23 class fp_ReaderClass(G2obj.ImportPowderData): 24 24 'Routines to import powder data from a FullProf 1-10 column .dat file' 25 25 def __init__(self): … … 40 40 fp = open(filename,'r') 41 41 for i,S in enumerate(fp): 42 if i > 100 0: break42 if i > 100: break 43 43 if begin: 44 44 if gotCcomment and S.find('*/') > -1: … … 65 65 else: 66 66 self.errors += ' (binary)' 67 fp.close() 68 return False 67 if i > 2: 68 fp.close() 69 return False 69 70 fp.close() 70 71 return True # no errors encountered … … 101 102 # valid line to read 102 103 if not steps: 103 vals = S.split(None,4) 104 if len(vals) >= 3: 105 steps = True 106 start = float(vals[0]) 107 step = float(vals[1]) 108 stop = float(vals[2]) 109 if len(vals) > 3: 110 self.comments.append(vals[3][:-1]) 104 vals = S.replace(',',' ').split(None,4) 105 if 'lambda' in S: 106 self.instdict['wave'] = float(vals[1]) 107 continue 108 elif len(vals) >= 3: 109 try: 110 steps = True 111 start = float(vals[0]) 112 step = float(vals[1]) 113 stop = float(vals[2]) 114 if len(vals) > 3: 115 self.comments.append(vals[3][:-1]) 116 except: 117 print('Skipping line ',S) 118 continue 119 elif i<3: 120 print('Skipping header line ',S) 111 121 continue 112 122 vals = S.split() #data strings
Note: See TracChangeset
for help on using the changeset viewer.