Changeset feec1cb in sasview


Ignore:
Timestamp:
Sep 13, 2018 1:54:54 PM (6 years ago)
Author:
krzywon
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, unittest-saveload
Children:
9a0fc50
Parents:
2ca5d57b
Message:

Differentiate between scalars and arrays.

Location:
src/sas
Files:
2 edited

Legend:

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

    r2ca5d57b rfeec1cb  
    633633                elif q_vals.attrs.get("uncertainty") is not None: 
    634634                    self.q_uncertainties = q_vals.attrs.get("uncertainty") 
    635                 if isinstance(self.q_uncertainties, str) is not None: 
    636                     self.q_uncertainties = [self.q_uncertainties] 
     635                if isinstance(self.q_uncertainties, str): 
     636                    self.q_uncertainties = self.q_uncertainties.split(",") 
    637637                if q_vals.attrs.get("resolutions") is not None: 
    638638                    self.q_resolutions = q_vals.attrs.get("resolutions") 
    639                 if isinstance(self.q_resolutions, str): 
     639                if isinstance(self.q_resolutions, (str, unicode)): 
    640640                    self.q_resolutions = self.q_resolutions.split(",") 
    641641        if self.i_name in keys: 
  • src/sas/sasgui/guiframe/gui_manager.py

    rb799f09 rfeec1cb  
    25302530            text += 'dY_min = %s:  dY_max = %s\n' % (min(data.dy), max(data.dy)) 
    25312531        text += '\nData Points:\n' 
    2532         x_st = "X" 
     2532        text += "<index> \t<X> \t<Y> \t<dY> \t<dX" 
     2533        if data.dxl is not None and data.dxw is not None: 
     2534                text += "l> \t<dxw" 
     2535        text += ">\n" 
    25332536        for index in range(len(data.x)): 
    25342537            if data.dy is not None and len(data.dy) > index: 
     
    25412544                dx_val = 0.0 
    25422545            if data.dxl is not None and len(data.dxl) > index: 
    2543                 if index == 0: 
    2544                     x_st = "Xl" 
    25452546                dx_val = data.dxl[index] 
    2546             elif data.dxw is not None and len(data.dxw) > index: 
    2547                 if index == 0: 
    2548                     x_st = "Xw" 
    2549                 dx_val = data.dxw[index] 
    2550  
    2551             if index == 0: 
    2552                 text += "<index> \t<X> \t<Y> \t<dY> \t<d%s>\n" % x_st 
     2547                if data.dxw is not None and len(data.dxw) > index: 
     2548                    dx_val = "%s \t%s" % (data.dxl[index], data.dxw[index]) 
     2549 
    25532550            text += "%s \t%s \t%s \t%s \t%s\n" % (index, 
    25542551                                                  data.x[index], 
Note: See TracChangeset for help on using the changeset viewer.