- Timestamp:
- Aug 18, 2016 5:00:32 AM (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:
- 8cb1a07
- Parents:
- 1ddf8f0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/readers/cansas_reader_HDF5.py
r1ddf8f0 r1f6d293 409 409 return np.array([np.string_(string)]) 410 410 411 def _h5_float(x): 412 if not (isinstance(x, list)): 413 x = [x] 414 return np.array(x, dtype=np.float32) 415 411 416 # Get run name and number from first Data object 412 417 data_info = dataset[0] … … 469 474 collimation_entry.attrs['canSAS_class'] = 'SAScollimation' 470 475 if coll_info.length is not None: 471 collimation_entry['SDD'] = coll_info.length476 collimation_entry['SDD'] = _h5_float(coll_info.length) 472 477 collimation_entry['SDD'].attrs['units'] = coll_info.length_unit 473 478 if coll_info.name is not None: … … 483 488 detector_entry.attrs['canSAS_class'] = 'SASdetector' 484 489 if det_info.distance is not None: 485 detector_entry['SDD'] = det_info.distance490 detector_entry['SDD'] = _h5_float(det_info.distance) 486 491 detector_entry['SDD'].attrs['units'] = det_info.distance_unit 487 492 if det_info.name is not None: … … 489 494 else: 490 495 detector_entry['name'] = _h5_string('') 496 i += 1 491 497 else: 492 498 detector_entry = instrument_entry.create_group('sasdetector01')
Note: See TracChangeset
for help on using the changeset viewer.