Changeset 2ca5d57b in sasview for src/sas/sascalc/dataloader


Ignore:
Timestamp:
Sep 13, 2018 11:33:22 AM (6 years ago)
Author:
krzywon
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, unittest-saveload
Children:
feec1cb
Parents:
4fdcc65
Message:

Code cleanup and additional unit tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/readers/cansas_reader_HDF5.py

    r4fdcc65 r2ca5d57b  
    131131            value = data.get(key) 
    132132            class_name = h5attr(value, u'canSAS_class') 
     133            if isinstance(class_name, (list, tuple, np.ndarray)): 
     134                class_name = class_name[0] 
    133135            if class_name is None: 
    134136                class_name = h5attr(value, u'NX_class') 
     
    538540            if dataset.data.ndim == 2: 
    539541                (n_rows, n_cols) = dataset.data.shape 
    540                 print(n_rows) 
    541                 print(n_cols) 
    542542                flat_qy = dataset.qy_data[0::n_cols].flatten() 
    543543                if flat_qy[0] == flat_qy[1]: 
     
    548548                    flat_qx = np.transpose(dataset.qx_data)[0::n_rows].flatten() 
    549549                dataset.x_bins = np.unique(flat_qx) 
    550                 print(dataset.x_bins) 
    551                 print(len(dataset.x_bins)) 
    552                 print(dataset.y_bins) 
    553                 print(len(dataset.y_bins)) 
    554550                dataset.data = dataset.data.flatten() 
    555551                dataset.qx_data = dataset.qx_data.flatten() 
Note: See TracChangeset for help on using the changeset viewer.