Changeset c221349 in sasview for src/sas/sascalc/dataloader/readers


Ignore:
Timestamp:
Feb 27, 2017 11:58:17 AM (8 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, 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:
53f0402, 46f798f
Parents:
7caf3e5
Message:

Split unit axis and label on "|" and then strip whitespace.

File:
1 edited

Legend:

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

    rb5e9ce26 rc221349  
    261261                # I and Q - 1D data 
    262262                elif tagname == 'I' and isinstance(self.current_dataset, plottable_1D): 
    263                     unit_list = unit.split(" | ") 
     263                    unit_list = unit.split("|") 
    264264                    if len(unit_list) > 1: 
    265                         self.current_dataset.yaxis(unit_list[0], unit_list[1]) 
     265                        self.current_dataset.yaxis(unit_list[0].strip(), 
     266                                                   unit_list[1].strip()) 
    266267                    else: 
    267268                        self.current_dataset.yaxis("Intensity", unit) 
     
    270271                    self.current_dataset.dy = np.append(self.current_dataset.dy, data_point) 
    271272                elif tagname == 'Q': 
    272                     unit_list = unit.split(" | ") 
     273                    unit_list = unit.split("|") 
    273274                    if len(unit_list) > 1: 
    274                         self.current_dataset.xaxis(unit_list[0], unit_list[1]) 
     275                        self.current_dataset.xaxis(unit_list[0].strip(), 
     276                                                   unit_list[1].strip()) 
    275277                    else: 
    276278                        self.current_dataset.xaxis("Q", unit) 
Note: See TracChangeset for help on using the changeset viewer.