Changeset c94280c in sasview
- Timestamp:
- Mar 9, 2017 3:25:56 PM (8 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, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 29adb33
- Parents:
- 54544637
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/readers/cansas_reader_HDF5.py
r54544637 rc94280c 193 193 continue 194 194 # Transmission Spectrum 195 elif (key == u'T' ) \196 and (self.parent_class == u'SAStransmission_spectrum'):195 elif (key == u'T' 196 and self.parent_class == u'SAStransmission_spectrum'): 197 197 self.trans_spectrum.transmission = data_set.flatten() 198 198 continue 199 elif (key == u'Tdev' ) \200 and (self.parent_class == u'SAStransmission_spectrum'):199 elif (key == u'Tdev' 200 and self.parent_class == u'SAStransmission_spectrum'): 201 201 self.trans_spectrum.transmission_deviation = \ 202 202 data_set.flatten() 203 203 continue 204 elif (key == u'lambda' ) \205 and (self.parent_class == u'SAStransmission_spectrum'):204 elif (key == u'lambda' 205 and self.parent_class == u'SAStransmission_spectrum'): 206 206 self.trans_spectrum.wavelength = data_set.flatten() 207 207 continue … … 234 234 elif key == u'ID' and self.parent_class == u'SASsample': 235 235 self.current_datainfo.sample.name = data_point 236 elif (key == u'thickness' ) and (self.parent_class ==237 236 elif (key == u'thickness' 237 and self.parent_class == u'SASsample'): 238 238 self.current_datainfo.sample.thickness = data_point 239 elif (key == u'temperature' ) and (self.parent_class ==240 239 elif (key == u'temperature' 240 and self.parent_class == u'SASsample'): 241 241 self.current_datainfo.sample.temperature = data_point 242 elif (key == u'transmission' ) and (self.parent_class ==243 242 elif (key == u'transmission' 243 and self.parent_class == u'SASsample'): 244 244 self.current_datainfo.sample.transmission = data_point 245 elif (key == u'x_position' ) and (self.parent_class ==246 245 elif (key == u'x_position' 246 and self.parent_class == u'SASsample'): 247 247 self.current_datainfo.sample.position.x = data_point 248 elif (key == u'y_position' ) and (self.parent_class ==249 248 elif (key == u'y_position' 249 and self.parent_class == u'SASsample'): 250 250 self.current_datainfo.sample.position.y = data_point 251 251 elif key == u'pitch' and self.parent_class == u'SASsample': … … 255 255 elif key == u'roll' and self.parent_class == u'SASsample': 256 256 self.current_datainfo.sample.orientation.z = data_point 257 elif (key == u'details' ) and (self.parent_class ==258 257 elif (key == u'details' 258 and self.parent_class == u'SASsample'): 259 259 self.current_datainfo.sample.details.append(data_point) 260 260 261 261 # Instrumental Information 262 elif (key == u'name' ) and (self.parent_class ==263 262 elif (key == u'name' 263 and self.parent_class == u'SASinstrument'): 264 264 self.current_datainfo.instrument = data_point 265 265 elif key == u'name' and self.parent_class == u'SASdetector': … … 268 268 self.detector.distance = float(data_point) 269 269 self.detector.distance_unit = unit 270 elif (key == u'slit_length' ) and (self.parent_class ==271 270 elif (key == u'slit_length' 271 and self.parent_class == u'SASdetector'): 272 272 self.detector.slit_length = float(data_point) 273 273 self.detector.slit_length_unit = unit 274 elif (key == u'x_position' ) and (self.parent_class ==275 274 elif (key == u'x_position' 275 and self.parent_class == u'SASdetector'): 276 276 self.detector.offset.x = float(data_point) 277 277 self.detector.offset_unit = unit 278 elif (key == u'y_position' ) and (self.parent_class ==279 278 elif (key == u'y_position' 279 and self.parent_class == u'SASdetector'): 280 280 self.detector.offset.y = float(data_point) 281 281 self.detector.offset_unit = unit 282 elif (key == u'pitch' ) and (self.parent_class ==283 282 elif (key == u'pitch' 283 and self.parent_class == u'SASdetector'): 284 284 self.detector.orientation.x = float(data_point) 285 285 self.detector.orientation_unit = unit … … 290 290 self.detector.orientation.y = float(data_point) 291 291 self.detector.orientation_unit = unit 292 elif (key == u'beam_center_x' ) and (self.parent_class ==293 292 elif (key == u'beam_center_x' 293 and self.parent_class == u'SASdetector'): 294 294 self.detector.beam_center.x = float(data_point) 295 295 self.detector.beam_center_unit = unit 296 elif (key == u'beam_center_y' ) and (self.parent_class ==297 296 elif (key == u'beam_center_y' 297 and self.parent_class == u'SASdetector'): 298 298 self.detector.beam_center.y = float(data_point) 299 299 self.detector.beam_center_unit = unit 300 elif (key == u'x_pixel_size' ) and (self.parent_class ==301 300 elif (key == u'x_pixel_size' 301 and self.parent_class == u'SASdetector'): 302 302 self.detector.pixel_size.x = float(data_point) 303 303 self.detector.pixel_size_unit = unit 304 elif (key == u'y_pixel_size' ) and (self.parent_class ==305 304 elif (key == u'y_pixel_size' 305 and self.parent_class == u'SASdetector'): 306 306 self.detector.pixel_size.y = float(data_point) 307 307 self.detector.pixel_size_unit = unit 308 elif (key == u'distance' ) and (self.parent_class ==309 308 elif (key == u'distance' 309 and self.parent_class == u'SAScollimation'): 310 310 self.collimation.length = data_point 311 311 self.collimation.length_unit = unit 312 elif (key == u'name' ) and (self.parent_class ==313 312 elif (key == u'name' 313 and self.parent_class == u'SAScollimation'): 314 314 self.collimation.name = data_point 315 elif (key == u'shape' ) and (self.parent_class ==316 315 elif (key == u'shape' 316 and self.parent_class == u'SASaperture'): 317 317 self.aperture.shape = data_point 318 elif (key == u'x_gap' ) and (self.parent_class ==319 318 elif (key == u'x_gap' 319 and self.parent_class == u'SASaperture'): 320 320 self.aperture.size.x = data_point 321 elif (key == u'y_gap' ) and (self.parent_class ==322 321 elif (key == u'y_gap' 322 and self.parent_class == u'SASaperture'): 323 323 self.aperture.size.y = data_point 324 324 325 325 # Process Information 326 elif (key == u'Title' ) and (self.parent_class ==327 326 elif (key == u'Title' 327 and self.parent_class == u'SASprocess'): # CanSAS 2.0 328 328 self.process.name = data_point 329 elif (key == u'name' ) and (self.parent_class ==330 329 elif (key == u'name' 330 and self.parent_class == u'SASprocess'): # NXcanSAS 331 331 self.process.name = data_point 332 elif (key == u'description' ) and (self.parent_class ==333 332 elif (key == u'description' 333 and self.parent_class == u'SASprocess'): 334 334 self.process.description = data_point 335 335 elif key == u'date' and self.parent_class == u'SASprocess': … … 341 341 342 342 # Source 343 elif (key == u'wavelength' ) and (self.parent_class ==344 343 elif (key == u'wavelength' 344 and self.parent_class == u'SASdata'): 345 345 self.current_datainfo.source.wavelength = data_point 346 346 self.current_datainfo.source.wavelength_unit = unit 347 elif (key == u'incident_wavelength' ) and \348 (self.parent_class == 'SASsource'):347 elif (key == u'incident_wavelength' 348 and self.parent_class == 'SASsource'): 349 349 self.current_datainfo.source.wavelength = data_point 350 350 self.current_datainfo.source.wavelength_unit = unit 351 elif (key == u'wavelength_max' ) and (self.parent_class ==352 351 elif (key == u'wavelength_max' 352 and self.parent_class == u'SASsource'): 353 353 self.current_datainfo.source.wavelength_max = data_point 354 354 self.current_datainfo.source.wavelength_max_unit = unit 355 elif (key == u'wavelength_min' ) and (self.parent_class ==356 355 elif (key == u'wavelength_min' 356 and self.parent_class == u'SASsource'): 357 357 self.current_datainfo.source.wavelength_min = data_point 358 358 self.current_datainfo.source.wavelength_min_unit = unit 359 elif key == u'incident_wavelength_spread' and \360 (self.parent_class == u'SASsource'):359 elif (key == u'incident_wavelength_spread' 360 and self.parent_class == u'SASsource'): 361 361 self.current_datainfo.source.wavelength_spread = \ 362 362 data_point 363 363 self.current_datainfo.source.wavelength_spread_unit = \ 364 364 unit 365 elif (key == u'beam_size_x' ) and (self.parent_class ==366 365 elif (key == u'beam_size_x' 366 and self.parent_class == u'SASsource'): 367 367 self.current_datainfo.source.beam_size.x = data_point 368 368 self.current_datainfo.source.beam_size_unit = unit 369 elif (key == u'beam_size_y' ) and (self.parent_class ==370 369 elif (key == u'beam_size_y' 370 and self.parent_class == u'SASsource'): 371 371 self.current_datainfo.source.beam_size.y = data_point 372 372 self.current_datainfo.source.beam_size_unit = unit 373 elif (key == u'beam_shape' ) and (self.parent_class ==374 373 elif (key == u'beam_shape' 374 and self.parent_class == u'SASsource'): 375 375 self.current_datainfo.source.beam_shape = data_point 376 elif (key == u'radiation' ) and (self.parent_class ==377 376 elif (key == u'radiation' 377 and self.parent_class == u'SASsource'): 378 378 self.current_datainfo.source.radiation = data_point 379 elif (key == u'transmission' ) and (self.parent_class ==380 379 elif (key == u'transmission' 380 and self.parent_class == u'SASdata'): 381 381 self.current_datainfo.sample.transmission = data_point 382 382
Note: See TracChangeset
for help on using the changeset viewer.