Changeset cf29187 in sasview for src/sas/sascalc
- Timestamp:
- Jul 13, 2018 4:22:31 PM (6 years ago)
- Branches:
- master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, unittest-saveload
- Children:
- 96d06a4
- Parents:
- 0bd8fac
- Location:
- src/sas/sascalc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/readers/cansas_reader_HDF5.py
r0bd8fac rcf29187 558 558 self.i_uncertainties = "" 559 559 560 @staticmethod 561 def check_is_list_or_array(iterable): 562 try: 563 iter(iterable) 564 if (not isinstance(iterable, np.ndarray)) or (isinstance(iterable, str) 565 or isinstance(iterable, unicode)): 566 raise TypeError 567 except TypeError: 568 iterable = iterable.split(",") 569 return iterable 570 560 571 def _find_data_attributes(self, value): 561 572 """ … … 568 579 i_axes = attrs.get("I_axes", ["Q"]) 569 580 q_indices = attrs.get("Q_indices", [0]) 570 try: 571 iter(q_indices) 572 except TypeError: 573 q_indices = [q_indices] 581 q_indices = map(int, self.check_is_list_or_array(q_indices)) 582 i_axes = self.check_is_list_or_array(i_axes) 574 583 keys = value.keys() 575 584 self.mask_name = attrs.get("mask") -
src/sas/sascalc/file_converter/nxcansas_writer.py
rac38ab4 rcf29187 304 304 data_entry.attrs['signal'] = 'I' 305 305 data_entry.attrs['I_axes'] = 'Q' 306 data_entry.attrs['Q_indic ies'] = 0306 data_entry.attrs['Q_indices'] = [0] 307 307 q_entry = data_entry.create_dataset('Q', data=data_obj.x) 308 308 q_entry.attrs['units'] = data_obj.x_unit … … 333 333 data_entry.attrs['signal'] = 'I' 334 334 data_entry.attrs['I_axes'] = 'Qx,Qy' 335 data_entry.attrs['Q_indic ies'] = [0,1]335 data_entry.attrs['Q_indices'] = [0,1] 336 336 337 337 (n_rows, n_cols) = (len(data.y_bins), len(data.x_bins))
Note: See TracChangeset
for help on using the changeset viewer.