Ignore:
Timestamp:
Aug 19, 2016 5:20:16 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:
edf0e06
Parents:
ac370c5
Message:

Refactor to make use of x_bins and y_bins

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/file_converter/converter_panel.py

    re9e777c rfe498b83  
    224224 
    225225        if not should_continue: 
    226             return None, None, None 
    227  
    228         frame_data = {} 
    229  
    230         for frame in frames: 
    231             loader.frame = frame 
    232             frame_data[frame] = loader.load_data() 
    233  
    234         # Prepare axes values (arbitrary scale) 
    235         x_data = loader.n_rasters * range(1,loader.n_pixels+1) 
    236         y_data = [loader.n_pixels * [i] for i in range(1, loader.n_rasters+1)] 
    237         y_data = np.reshape(y_data, (1, loader.n_pixels*loader.n_rasters))[0] 
    238  
    239         return (x_data, y_data), (loader.n_rasters, loader.n_pixels), frame_data 
     226            return None 
     227 
     228        frame_data = loader.load_frames(frames) 
     229 
     230        return frame_data 
    240231 
    241232    def ask_frame_range(self, n_frames): 
     
    300291            else: # self.data_type == 'bsl' 
    301292 
    302                 (x, y), dimensions, frame_data = \ 
    303                     self.extract_bsl_data(self.iq_input.GetPath()) 
    304                 if x == None and y == None and frame_data == None: 
     293                dataset = self.extract_bsl_data(self.iq_input.GetPath()) 
     294                if dataset is None: 
    305295                    # Cancelled by user 
    306296                    return 
    307297 
    308                 dataset = [] 
    309                 for i_data in frame_data.values(): 
    310                     i_data = np.reshape(i_data, (1, i_data.size))[0] 
    311                     data2d = Data2D(data=i_data, qx_data=x, qy_data=y) 
    312                     dataset.append(data2d) 
    313298                w = NXcanSASWriter() 
    314                 dimensions = [dimensions] * len(dataset) 
    315                 w.write(dataset, self.output.GetPath(), dimensions=dimensions) 
     299                w.write(dataset, self.output.GetPath()) 
    316300 
    317301                wx.PostEvent(self.parent.manager.parent, 
Note: See TracChangeset for help on using the changeset viewer.