Ignore:
Timestamp:
Sep 15, 2017 12:48:18 PM (7 years ago)
Author:
krzywon
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, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
6d62b7f
Parents:
da9b239
Message:

Ensure dxl and dxw and the same length as each other and as x.

File:
1 edited

Legend:

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

    r590b5c2 rae69c690  
    511511        """ 
    512512        has_error_dx = self.current_dataset.dx is not None 
     513        has_error_dxl = self.current_dataset.dxl is not None 
     514        has_error_dxw = self.current_dataset.dxw is not None 
    513515        has_error_dy = self.current_dataset.dy is not None 
    514516        self.remove_empty_q_values(has_error_dx=has_error_dx, 
     517                                   has_error_dxl=has_error_dxl, 
     518                                   has_error_dxw=has_error_dxw, 
    515519                                   has_error_dy=has_error_dy) 
    516520        self.send_to_output()  # Combine datasets with DataInfo 
     
    678682            di_exists = True 
    679683        if dqw_exists and not dql_exists: 
    680             array_size = self.current_dataset.dxw.size - 1 
    681             self.current_dataset.dxl = np.append(self.current_dataset.dxl, 
    682                                                  np.zeros([array_size])) 
     684            array_size = self.current_dataset.dxw.size 
     685            self.current_dataset.dxl = np.zeros(array_size) 
    683686        elif dql_exists and not dqw_exists: 
    684             array_size = self.current_dataset.dxl.size - 1 
    685             self.current_dataset.dxw = np.append(self.current_dataset.dxw, 
    686                                                  np.zeros([array_size])) 
     687            array_size = self.current_dataset.dxl.size 
     688            self.current_dataset.dxw = np.zeros(array_size) 
    687689        elif not dql_exists and not dqw_exists and not dq_exists: 
    688             array_size = self.current_dataset.x.size - 1 
     690            array_size = self.current_dataset.x.size 
    689691            self.current_dataset.dx = np.append(self.current_dataset.dx, 
    690692                                                np.zeros([array_size])) 
    691693        if not di_exists: 
    692             array_size = self.current_dataset.y.size - 1 
     694            array_size = self.current_dataset.y.size 
    693695            self.current_dataset.dy = np.append(self.current_dataset.dy, 
    694696                                                np.zeros([array_size])) 
Note: See TracChangeset for help on using the changeset viewer.