Ignore:
Timestamp:
Oct 8, 2016 2:34:03 PM (8 years ago)
Author:
jhbakker
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:
51a4d78
Parents:
6df015de
Message:

Data1D class changed to include SESANS Data format

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/guiframe/dataFitting.py

    rd85c194 r7988501  
    1717    """ 
    1818    """ 
    19     def __init__(self, x=None, y=None, dx=None, dy=None): 
     19    def __init__(self, x=None, y=None, dx=None, dy=None, lam=None, dlam=None): 
    2020        """ 
    2121        """ 
     
    2424        if y is None: 
    2525            y = [] 
    26         PlotData1D.__init__(self, x, y, dx, dy) 
    27         LoadData1D.__init__(self, x, y, dx, dy) 
     26        PlotData1D.__init__(self, x, y, lam, dx, dy, dlam) 
     27        LoadData1D.__init__(self, x, y, lam, dx, dy, dlam) 
    2828        self.id = None 
    2929        self.list_group_id = [] 
     
    6868        # First, check the data compatibility 
    6969        dy, dy_other = self._validity_check(other) 
    70         result = Data1D(x=[], y=[], dx=None, dy=None) 
     70        result = Data1D(x=[], y=[], lam=[], dx=None, dy=None, dlam=None) 
    7171        result.clone_without_data(length=len(self.x), clone=self) 
    7272        result.copy_from_datainfo(data1d=self) 
     
    115115        # First, check the data compatibility 
    116116        self._validity_check_union(other) 
    117         result = Data1D(x=[], y=[], dx=None, dy=None) 
     117        result = Data1D(x=[], y=[], lam=[], dx=None, dy=None, dlam=None) 
    118118        tot_length = len(self.x) + len(other.x) 
    119119        result = self.clone_without_data(length=tot_length, clone=result) 
     120        if self.dlam == None or other.dlam is None: 
     121            result.dlam = None 
     122        else: 
     123            result.dlam = numpy.zeros(tot_length) 
    120124        if self.dy == None or other.dy is None: 
    121125            result.dy = None 
     
    141145        result.y = numpy.append(self.y, other.y) 
    142146        result.y = result.y[ind] 
     147        result.lam = numpy.append(self.lam, other.lam) 
     148        result.lam = result.lam[ind] 
     149        if result.dlam != None: 
     150            result.dlam = numpy.append(self.dlam, other.dlam) 
     151            result.dlam = result.dlam[ind] 
    143152        if result.dy != None: 
    144153            result.dy = numpy.append(self.dy, other.dy) 
     
    260269        # First, check the data compatibility 
    261270        self._validity_check_union(other) 
    262         result = Data1D(x=[], y=[], dx=None, dy=None) 
     271        result = Data1D(x=[], y=[], lam=[], dx=None, dy=None, dlam=[]) 
    263272        tot_length = len(self.x)+len(other.x) 
    264273        result.clone_without_data(length=tot_length, clone=self) 
     274        if self.dlam == None or other.dlam is None: 
     275            result.dlam = None 
     276        else: 
     277            result.dlam = numpy.zeros(tot_length) 
    265278        if self.dy == None or other.dy is None: 
    266279            result.dy = None 
     
    285298        result.y = numpy.append(self.y, other.y) 
    286299        result.y = result.y[ind] 
     300        result.lam = numpy.append(self.lam, other.lam) 
     301        result.lam = result.lam[ind] 
    287302        if result.dy != None: 
    288303            result.dy = numpy.append(self.dy, other.dy) 
Note: See TracChangeset for help on using the changeset viewer.