Changeset 3d6ab79 in sasview for src/sas/sascalc/dataloader


Ignore:
Timestamp:
Aug 18, 2016 10:52:06 AM (8 years ago)
Author:
lewis
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:
7f71637
Parents:
e9e777c
Message:

Fix cansas_reader_HDF5 unit tests

I'm not sure why the first value of each data array was being deleted, but
as of commit 7bd6860, I don't believe they need to be any more.

File:
1 edited

Legend:

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

    r7bd6860a r3d6ab79  
    136136                data_set = data[key][:] 
    137137                unit = self._get_unit(value) 
    138  
     138                 
    139139                ## I and Q Data 
    140140                if key == u'I': 
     
    307307        ## Type cast data arrays to float64 and find min/max as appropriate 
    308308        for dataset in self.data2d: 
    309             dataset.data = np.delete(dataset.data, [0]) 
    310309            dataset.data = dataset.data.astype(np.float64) 
    311             dataset.err_data = np.delete(dataset.err_data, [0]) 
    312310            dataset.err_data = dataset.err_data.astype(np.float64) 
    313             dataset.mask = np.delete(dataset.mask, [0]) 
    314311            if dataset.qx_data is not None: 
    315                 dataset.qx_data = np.delete(dataset.qx_data, [0]) 
    316312                dataset.xmin = np.min(dataset.qx_data) 
    317313                dataset.xmax = np.max(dataset.qx_data) 
    318314                dataset.qx_data = dataset.qx_data.astype(np.float64) 
    319315            if dataset.dqx_data is not None: 
    320                 dataset.dqx_data = np.delete(dataset.dqx_data, [0]) 
    321316                dataset.dqx_data = dataset.dqx_data.astype(np.float64) 
    322317            if dataset.qy_data is not None: 
    323                 dataset.qy_data = np.delete(dataset.qy_data, [0]) 
    324318                dataset.ymin = np.min(dataset.qy_data) 
    325319                dataset.ymax = np.max(dataset.qy_data) 
    326320                dataset.qy_data = dataset.qy_data.astype(np.float64) 
    327321            if dataset.dqy_data is not None: 
    328                 dataset.dqy_data = np.delete(dataset.dqy_data, [0]) 
    329322                dataset.dqy_data = dataset.dqy_data.astype(np.float64) 
    330323            if dataset.q_data is not None: 
    331                 dataset.q_data = np.delete(dataset.q_data, [0]) 
    332324                dataset.q_data = dataset.q_data.astype(np.float64) 
    333325            zeros = np.ones(dataset.data.size, dtype=bool) 
     
    349341        for dataset in self.data1d: 
    350342            if dataset.x is not None: 
    351                 dataset.x = np.delete(dataset.x, [0]) 
    352343                dataset.x = dataset.x.astype(np.float64) 
    353344                dataset.xmin = np.min(dataset.x) 
    354345                dataset.xmax = np.max(dataset.x) 
    355346            if dataset.y is not None: 
    356                 dataset.y = np.delete(dataset.y, [0]) 
    357347                dataset.y = dataset.y.astype(np.float64) 
    358348                dataset.ymin = np.min(dataset.y) 
    359349                dataset.ymax = np.max(dataset.y) 
    360350            if dataset.dx is not None: 
    361                 dataset.dx = np.delete(dataset.dx, [0]) 
    362351                dataset.dx = dataset.dx.astype(np.float64) 
    363352            if dataset.dxl is not None: 
    364                 dataset.dxl = np.delete(dataset.dxl, [0]) 
    365353                dataset.dxl = dataset.dxl.astype(np.float64) 
    366354            if dataset.dxw is not None: 
    367                 dataset.dxw = np.delete(dataset.dxw, [0]) 
    368355                dataset.dxw = dataset.dxw.astype(np.float64) 
    369356            if dataset.dy is not None: 
    370                 dataset.dy = np.delete(dataset.dy, [0]) 
    371357                dataset.dy = dataset.dy.astype(np.float64) 
    372358            final_dataset = combine_data_info_with_plottable(dataset, self.current_datainfo) 
Note: See TracChangeset for help on using the changeset viewer.