Changeset 18af6d2 in sasview for src/sas/sascalc


Ignore:
Timestamp:
Jan 23, 2018 10:34:37 AM (7 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:
6bd4235
Parents:
5a4d022
Message:

Clear data locations when a new data set is created and coerce I and Q to appropriate data types.

File:
1 edited

Legend:

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

    r5a4d022 r18af6d2  
    227227        :param unit: unit attribute 
    228228        """ 
    229         # FIXME: check attributes of SASdata for Q, dQ, Mask, etc. 
    230229        if key == self.i_name: 
    231230            if isinstance(self.current_dataset, plottable_2D): 
     
    552551            self.current_dataset = plottable_1D(x, y) 
    553552        self.current_datainfo.filename = self.raw_data.filename 
     553        self.mask_name = "" 
     554        self.i_name = "" 
     555        self.i_node = "" 
     556        self.q_name = [] 
     557        self.q_uncertainties = "" 
     558        self.q_resolutions = "" 
     559        self.i_uncertainties = "" 
    554560 
    555561    def _find_data_attributes(self, value): 
     
    561567        attrs = value.attrs 
    562568        signal = attrs.get("signal") 
    563  
    564         i_axes = np.array(attrs.get("I_axes").split(",")) 
    565         q_indices = np.array(attrs.get("Q_indices")) 
     569        i_axes = np.array(str(attrs.get("I_axes")).split(",")) 
     570        q_indices = np.int_(attrs.get("Q_indices").split(",")) 
     571        keys = value.keys() 
    566572        self.mask_name = attrs.get("mask") 
    567         keys = value.keys() 
    568573        for val in q_indices: 
    569574            self.q_name.append(i_axes[val]) 
Note: See TracChangeset for help on using the changeset viewer.