Changeset 3757
- Timestamp:
- Dec 7, 2018 4:03:37 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIdataGUI.py
r3742 r3757 1429 1429 else: 1430 1430 rd.instmsg = 'default: '+dI.defaultIparm_lbl[res] 1431 return self.ReadPowderInstprm(dI.defaultIparms[res],bank,numbanks,rd) #this is [Inst1,Inst2] a pair of dicts 1431 inst1,inst2 = self.ReadPowderInstprm(dI.defaultIparms[res],bank,numbanks,rd) 1432 if rd.instdict.get('wave'): 1433 inst1['Lam'][0] = rd.instdict.get('wave') 1434 inst1['Lam'][1] = rd.instdict.get('wave') 1435 return [inst1,inst2] 1432 1436 1433 1437 # stuff we might need from the reader -
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 -
trunk/imports/G2pwd_xye.py
r3670 r3757 78 78 else: 79 79 if2theta = True 80 if i == 0 and 'xydata' in S.lower(): 81 continue # fullprof header 80 82 if gotCcomment and S.find('*/') > -1: 81 83 begin = False … … 84 86 gotCcomment = True 85 87 continue 86 if S[0] in ["'",'#' ]:88 if S[0] in ["'",'#','!']: 87 89 continue #ignore comments, if any 90 elif S.startswith('TITLE'): 91 continue 88 92 else: 89 93 begin = False … … 122 126 # or a block of comments delimited by /* and */ 123 127 # or (GSAS style) each line can begin with '#' 128 # or WinPLOTR style, a '!' 124 129 if begin: 125 130 if self.Chi or self.Wave: … … 137 142 gotCcomment = True 138 143 continue 139 if S[0] in ["'",'#' ]:144 if S[0] in ["'",'#','!']: 140 145 self.comments.append(S[:-1]) 141 146 continue #ignore comments, if any 147 elif i == 0 and 'xydata' in S.lower(): 148 continue # fullprof header 149 elif S.startswith('TITLE'): 150 self.comments = [S] 151 continue 142 152 else: 143 153 begin = False
Note: See TracChangeset
for help on using the changeset viewer.