Changeset bc3dd65d in sasview
- Timestamp:
- Mar 10, 2009 4:48:55 PM (16 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 914a499
- Parents:
- 21d2eb0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/data_loader.py
r12aa9b5 rbc3dd65d 33 33 file_y = numpy.zeros(0) 34 34 file_dy = numpy.zeros(0) 35 file_dx = numpy.zeros(0) 35 36 36 37 input_f = open(path,'r') … … 39 40 40 41 has_dy = False 42 has_dx = False 41 43 42 44 for line in lines: … … 47 49 if len(toks)==3: 48 50 has_dy = True 49 err = float(toks[2])51 errdy = float(toks[2]) 50 52 else: 51 err = 0.0 53 errdy = 0.0 54 if len(toks)==4: 55 has_dx = True 56 errdx = float(toks[3]) 57 else: 58 errdx = 0.0 52 59 file_x = numpy.append(file_x, x) 53 60 file_y = numpy.append(file_y, y) 54 file_dy = numpy.append(file_dy, err) 61 file_dy = numpy.append(file_dy, dyerr) 62 file_dx = numpy.append(file_dx, dxerr) 55 63 except: 56 64 print "READ ERROR", line … … 58 66 if has_dy==False: 59 67 file_dy = None 68 if has_dx==False: 69 file_dx = None 60 70 61 return file_x, file_y, file_dy 71 return file_x, file_y, file_dy, file_dx 62 72 return None, None, None 63 73 … … 147 157 for item in output: 148 158 try: 159 dx=item.dx 149 160 dxl=item.dxl 150 161 dxw=item.dxw 151 162 except: 163 dx=None 152 164 dxl=None 153 165 dxw=None … … 156 168 new_plot = Theory1D(item.x,item.y,dxl,dxw) 157 169 else: 158 new_plot = Data1D(x=item.x,y=item.y,dx= item.dx,dy=item.dy,dxl=dxl,dxw=dxw)170 new_plot = Data1D(x=item.x,y=item.y,dx=dx,dy=item.dy,dxl=dxl,dxw=dxw) 159 171 160 172 new_plot.source=item.source
Note: See TracChangeset
for help on using the changeset viewer.