Ignore:
Timestamp:
Jul 27, 2017 4:38:11 AM (7 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.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
0b79323
Parents:
bc570f4
Message:

Refactor CanSAS reader to properly utilise FileReader?

Temporarily removes support for reading 2D CanSAS XML files

File:
1 edited

Legend:

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

    rbc570f4 r7477fb9  
    100100        for data in self.output: 
    101101            if isinstance(data, Data1D): 
     102                # Sort data by increasing x and remove 1st point 
    102103                ind = np.lexsort((data.y, data.x)) 
     104                ind = ind[1:] # Remove 1st point (Q, I) = (0, 0) 
    103105                data.x = np.asarray([data.x[i] for i in ind]) 
    104106                data.y = np.asarray([data.y[i] for i in ind]) 
     
    115117                if data.dlam is not None: 
    116118                    data.dlam = np.asarray([data.dlam[i] for i in ind]) 
     119                data.xmin = np.min(data.x) 
     120                data.xmax = np.max(data.x) 
     121                data.ymin = np.min(data.y) 
     122                data.ymax = np.max(data.y) 
    117123            final_list.append(data) 
    118124        self.output = final_list 
Note: See TracChangeset for help on using the changeset viewer.