Changeset 8780e9a in sasview for DataLoader
- Timestamp:
- Jul 30, 2008 2:33:17 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:
- 6b126e8
- Parents:
- 7924042
- Location:
- DataLoader
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
DataLoader/data_info.py
ra3084ada r8780e9a 21 21 from sans.guitools.plottables import Data1D as plottable_1D 22 22 23 class Data2D: 24 """ 25 Data2D is a place holder for 2D plottables, which are 26 not yet implemented. 27 """ 28 xmin = None 29 xmax = None 30 ymin = None 31 ymax = None 32 image = None 23 33 24 34 class Vector: … … 58 68 ## Sample to detector distance [float] [mm] 59 69 distance = None 70 distance_unit = 'm' 60 71 ## Offset of this detector position in X, Y, (and Z if necessary) [Vector] [mm] 61 72 offset = Vector() 73 offset_unit = 'mm' 62 74 ## Orientation (rotation) of this detector in roll, pitch, and yaw [Vector] [degrees] 63 75 orientation = Vector() 76 orientation_unit = 'degree' 64 77 ## Center of the beam on the detector in X and Y (and Z if necessary) [Vector] [pixel] 65 78 beam_center = Vector() 79 beam_center_unit = 'mm' 66 80 ## Pixel size in X, Y, (and Z if necessary) [Vector] [mm] 67 81 pixel_size = Vector() 82 pixel_size_unit = 'mm' 68 83 ## Slit length of the instrument for this detector.[float] [mm] 69 84 slit_length = None 85 slit_length_unit = 'mm' 86 87 def __str__(self): 88 _str = "Detector:\n" 89 _str += " Name: %s\n" % self.name 90 _str += " Distance: %s [%s]\n" % \ 91 (str(self.distance), str(self.distance_unit)) 92 _str += " Offset: %s [%s]\n" % \ 93 (str(self.offset), str(self.offset_unit)) 94 _str += " Orientation: %s [%s]\n" % \ 95 (str(self.orientation), str(self.orientation_unit)) 96 _str += " Beam center: %s [%s]\n" % \ 97 (str(self.beam_center), str(self.beam_center_unit)) 98 _str += " Pixel size: %s [%s]\n" % \ 99 (str(self.pixel_size), str(self.pixel_size_unit)) 100 _str += " Slit length: %s [%s]\n" % \ 101 (str(self.slit_length), str(self.slit_length_unit)) 102 return _str 70 103 71 104 class Collimation: … … 73 106 Class to hold collimation information 74 107 """ 108 class Aperture: 109 # Aperture size [Vector] 110 size = Vector() 111 size_unit = 'mm' 112 # Aperture distance [float] 113 distance = None 114 distance_unit = 'mm' 115 75 116 ## Length [float] [mm] 76 117 length = None 77 ## Aperture size [Vector] [mm] 78 aperture_size = Vector() 79 ## Aperture distance [float] [m] 80 aperture_distance = None 118 length_unit = 'mm' 119 ## Aperture 120 aperture = [] 121 122 def __str__(self): 123 _str = "Collimation:\n" 124 _str += " Length: %s [%s]\n" % \ 125 (str(self.length), str(self.length_unit)) 126 for item in self.aperture: 127 _str += " Aperture size:%s [%s]\n" % \ 128 (str(item.size), str(item.size_unit)) 129 _str += " Aperture_dist:%s [%s]\n" % \ 130 (str(item.distance), str(item.distance_unit)) 131 return _str 81 132 82 133 class Source: … … 88 139 ## Beam size [Vector] [mm] 89 140 beam_size = Vector() 141 beam_size_unit = 'mm' 90 142 ## Beam shape [string] 91 143 beam_shape = '' 92 144 ## Wavelength [float] [Angstrom] 93 145 wavelength = None 146 wavelength_unit = 'A' 94 147 ## Minimum wavelength [float] [Angstrom] 95 148 wavelength_min = None 149 wavelength_min_unit = 'nm' 96 150 ## Maximum wavelength [float] [Angstrom] 97 151 wavelength_max = None 152 wavelength_max_unit = 'nm' 98 153 ## Wavelength spread [float] [Angstrom] 99 154 wavelength_spread = None 155 wavelength_spread_unit = 'percent' 156 157 def __str__(self): 158 _str = "Source:\n" 159 _str += " Radiation: %s\n" % str(self.radiation) 160 _str += " Shape: %s\n" % str(self.beam_shape) 161 _str += " Wavelength: %s [%s]\n" % \ 162 (str(self.wavelength), str(self.wavelength_unit)) 163 _str += " Waveln_min: %s [%s]\n" % \ 164 (str(self.wavelength_min), str(self.wavelength_min_unit)) 165 _str += " Waveln_max: %s [%s]\n" % \ 166 (str(self.wavelength_max), str(self.wavelength_max_unit)) 167 _str += " Waveln_spread:%s [%s]\n" % \ 168 (str(self.wavelength_spread), str(self.wavelength_spread_unit)) 169 _str += " Beam_size: %s [%s]\n" % \ 170 (str(self.beam_size), str(self.beam_size_unit)) 171 return _str 172 100 173 101 174 """ … … 115 188 ## Thickness [float] [mm] 116 189 thickness = None 117 ## Transmission [float] [%] 190 thickness_unit = 'mm' 191 ## Transmission [float] [fraction] 118 192 transmission = None 119 193 ## Temperature [float] [C] 120 194 temperature = None 195 temperature_unit = 'C' 121 196 ## Position [Vector] [mm] 122 197 position = Vector() 198 position_unit = 'mm' 123 199 ## Orientation [Vector] [degrees] 124 200 orientation = Vector() 201 orientation_unit = 'degree' 125 202 ## Details 126 details = '' 203 details = [] 204 205 def __str__(self): 206 _str = "Sample:\n" 207 _str += " ID: %s\n" % str(self.ID) 208 _str += " Transmission: %s\n" % str(self.transmission) 209 _str += " Thickness: %s [%s]\n" % \ 210 (str(self.thickness), str(self.thickness_unit)) 211 _str += " Temperature: %s [%s]\n" % \ 212 (str(self.temperature), str(self.temperature_unit)) 213 _str += " Position: %s [%s]\n" % \ 214 (str(self.position), str(self.position_unit)) 215 _str += " Orientation: %s [%s]\n" % \ 216 (str(self.orientation), str(self.orientation_unit)) 217 218 _str += " Details:\n" 219 for item in self.details: 220 _str += " %s\n" % item 221 222 return _str 223 224 class Process: 225 """ 226 Class that holds information about the processes 227 performed on the data. 228 """ 229 name = '' 230 date = '' 231 description= '' 232 term = [] 233 notes = [] 234 235 def __str__(self): 236 _str = "Process:\n" 237 _str += " Name: %s\n" % self.name 238 _str += " Date: %s\n" % self.date 239 _str += " Description: %s\n" % self.description 240 for item in self.term: 241 _str += " Term: %s\n" % item 242 for item in self.notes: 243 _str += " Note: %s\n" % item 244 return _str 127 245 128 246 … … 134 252 the data itself and any other meta data. 135 253 """ 254 ## Title 255 title = '' 136 256 ## Run number 137 257 run = None … … 139 259 filename = '' 140 260 ## Notes 141 notes = ''261 notes = [] 142 262 ## Processes (Action on the data) 143 263 process = [] 264 ## Instrument name 265 instrument = '' 144 266 ## Detector information 145 detector = Detector()267 detector = [] 146 268 ## Sample information 147 269 sample = Sample() 148 270 ## Source information 149 271 source = Source() 272 ## Collimation information 273 collimation = [] 150 274 ## Additional meta-data 151 275 meta_data = {} 276 ## Loading errors 277 errors = [] 152 278 153 279 def __add__(self, data): … … 191 317 1D data class 192 318 """ 319 x_unit = '1/A' 320 y_unit = '1/cm' 321 193 322 def __init__(self, x, y, dx=None, dy=None): 194 323 plottable_1D.__init__(self, x, y, dx, dy) … … 198 327 Nice printout 199 328 """ 200 _str = "File: %s\n" % self.filename 201 202 _str += "Sample:\n" 203 _str += " Transmission: %s\n" % str(self.sample.transmission) 204 _str += " Thickness: %s\n" % str(self.sample.thickness) 205 206 _str += "Source:\n" 207 _str += " Wavelength: %s [A]\n" % str(self.source.wavelength) 208 209 _str += "Detector:\n" 210 _str += " Name: %s\n" % self.detector.name 211 _str += " Distance: %s [mm]\n" % str(self.detector.distance) 212 _str += " Beam_center: %s [pixel]\n" % str(self.detector.beam_center) 329 _str = "File: %s\n" % self.filename 330 _str += "Title: %s\n" % self.title 331 _str += "Run: %s\n" % str(self.run) 332 _str += "Instrument: %s\n" % str(self.instrument) 333 _str += "%s\n" % str(self.sample) 334 _str += "%s\n" % str(self.source) 335 for item in self.detector: 336 _str += "%s\n" % str(item) 337 for item in self.collimation: 338 _str += "%s\n" % str(item) 339 for item in self.process: 340 _str += "%s\n" % str(item) 341 for item in self.notes: 342 _str += "%s\n" % str(item) 343 213 344 214 345 _str += "Data:\n" -
DataLoader/readers/abs_reader.py
r8bd8ea4 r8780e9a 17 17 Class to load IGOR reduced .ABS files 18 18 """ 19 ## File type 20 type = ["IGOR 1D files (*.abs)|*.abs"] 19 21 ## List of allowed extensions 20 22 ext=['.abs', '.ABS'] -
DataLoader/readers/ascii_reader.py
r8bd8ea4 r8780e9a 17 17 Class to load ascii files (2 or 3 columns) 18 18 """ 19 ## File type 20 type = ["ASCII files (*.txt)|*.txt", 21 "ASCII files (*.dat)|*.dat"] 19 22 ## List of allowed extensions 20 23 ext=['.txt', '.TXT', '.dat', '.DAT']
Note: See TracChangeset
for help on using the changeset viewer.