Ignore:
Timestamp:
Sep 25, 2017 1:58:13 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:
ffb6474
Parents:
7b07fbe
Message:

Load fit states and project filess with 2D data sets using new loader system.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/file_reader_base_class.py

    r7b07fbe rdeaa0c6  
    167167                    dataset.x_bins = dataset.qx_data[:int(n_cols)] 
    168168                dataset.data = dataset.data.flatten() 
     169                if len(dataset.data) > 0: 
     170                    dataset.xmin = np.min(dataset.qx_data) 
     171                    dataset.xmax = np.max(dataset.qx_data) 
     172                    dataset.ymin = np.min(dataset.qy_data) 
     173                    dataset.ymax = np.max(dataset.qx_data) 
    169174 
    170175    def format_unit(self, unit=None): 
     
    249254            has_error_dy = self.current_dataset.err_data is not None 
    250255            has_mask = self.current_dataset.mask is not None 
    251             has_q_data = self.current_dataset.q_data is not None 
    252256            x = self.current_dataset.qx_data 
    253257            self.current_dataset.data = self.current_dataset.data[x != 0] 
    254258            self.current_dataset.qx_data = self.current_dataset.qx_data[x != 0] 
    255259            self.current_dataset.qy_data = self.current_dataset.qy_data[x != 0] 
     260            self.current_dataset.q_data = np.sqrt( 
     261                np.square(self.current_dataset.qx_data) + np.square( 
     262                    self.current_dataset.qy_data)) 
    256263            if has_error_dy: 
    257264                self.current_dataset.err_data = self.current_dataset.err_data[x != 0] 
     
    262269            if has_mask: 
    263270                self.current_dataset.mask = self.current_dataset.mask[x != 0] 
    264             if has_q_data: 
    265                 self.current_dataset.q_data = self.current_dataset.q_data[x != 0] 
    266271 
    267272    def reset_data_list(self, no_lines=0): 
Note: See TracChangeset for help on using the changeset viewer.