Changeset 8d6440f in sasview for DataLoader/readers
- Timestamp:
- Jul 9, 2008 6:05:49 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:
- c45976b
- Parents:
- 8dac49d
- Location:
- DataLoader/readers
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
DataLoader/readers/IgorReader.py
r2fd516b r8d6440f 2 2 import pylab 3 3 from copy import deepcopy 4 import math 4 import math,logging 5 5 class Reader: 6 6 """ Simple data reader for Igor data files """ … … 165 165 self.center_x = center_x 166 166 self.center_y = center_y 167 print "IgorReader reading %s"%self.file167 logging.info("IgorReader reading %s"%self.file) 168 168 return Z, xmin-xstep/2.0, xmax+xstep/2.0, ymin-ystep/2.0, ymax+ystep/2.0 169 169 -
DataLoader/readers/TXT2_Reader.py
r8dac49d r8d6440f 1 1 # class Loader to load any king of file 2 2 import wx 3 import string,numpy 3 import string,numpy,logging 4 4 class Reader: 5 5 """ … … 27 27 return None 28 28 else: 29 input_f = open(path,'r') 29 try: 30 input_f = open(path,'r') 31 except : 32 raise RuntimeError,"TXT2_Reader cannot open %s"%(path) 30 33 buff = input_f.read() 31 34 lines = buff.split('\n') … … 63 66 #msg="R1 reading: \n"+"this x :"+ str(self.x) +"\n"+"this y:"+str(self.y)+"\n"+"this dy :"+str(self.dy)+"\n" 64 67 #return msg 65 print "TXT2_Reader reading %s\n" %path68 logging.info("TXT2_Reader reading %s\n" %path) 66 69 return self.x,self.y,self.dy 67 70 return None -
DataLoader/readers/TXT3_Reader.py
r1b0b3ca r8d6440f 1 1 # class Loader to load any king of file 2 2 import wx 3 import string,numpy 3 import string,numpy,logging 4 4 class Reader: 5 5 """ … … 31 31 return None 32 32 else: 33 input_f = open(path,'r') 33 try: 34 input_f = open(path,'r') 35 except : 36 raise RuntimeError,"TXT3_Reader cannot open %s"%(path) 34 37 buff = input_f.read() 35 38 lines = buff.split('\n') … … 65 68 #msg="txtReader Reading:\n"+"this x :"+ str(self.x) +"\n"+"this y:"+str(self.y)+"\n"+"this dy :"+str(self.dy)+"\n" 66 69 #return msg 67 print "TXT3_Reader reading %s \n" %path70 logging.info("TXT3_Reader reading %s \n" %path) 68 71 return self.x,self.y,self.dy 69 72 -
DataLoader/readers/danse_reader.py
rc125e0c r8d6440f 7 7 import copy 8 8 import numpy 9 import logging 9 10 class ReaderInfo: 10 11 """ … … 61 62 62 63 if read_it: 63 64 datafile = open(filename, 'r') 64 try: 65 datafile = open(filename, 'r') 66 except : 67 raise RuntimeError,"danse_reader cannot open %s"%(filename) 68 65 69 66 70 # defaults … … 126 130 error.append(err) 127 131 except: 128 print "Skipping line:%s" % data_str 129 print sys.exc_value 132 logging.info("Skipping line:%s,%s" %( data_str,sys.exc_value)) 133 #print "Skipping line:%s" % data_str 134 #print sys.exc_value 130 135 131 136 # Initialize … … 209 214 raise ValueError,"Danse_reader can't read this file %s"%filename 210 215 else: 211 print "Danse_reader Reading %s \n"%filename216 logging.info("Danse_reader Reading %s \n"%filename) 212 217 return output 213 218 -
DataLoader/readers/tiff_reader.py
r3dd7cce r8d6440f 1 1 2 2 import Image 3 import math 3 import math,logging 4 4 class ReaderInfo: 5 5 """ … … 46 46 47 47 def read(self, filename=None): 48 print "in tiff" 48 49 """ 49 50 Open and read the data in a file … … 144 145 output.image = Z 145 146 output.pixel_size = pixel 146 147 logging.info("tiff_reader reading %s"%(filename)) 148 147 149 return output 148 150
Note: See TracChangeset
for help on using the changeset viewer.