Changeset a9f579c in sasview for src/sas/sasgui/guiframe


Ignore:
Timestamp:
Jan 17, 2017 12:18:58 PM (7 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:
aad41bb
Parents:
ef0e644
Message:

Manually added in all the SESANS modifications from Jurtest

Location:
src/sas/sasgui/guiframe
Files:
2 edited

Legend:

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

    r345e7e4 ra9f579c  
    1717    """ 
    1818    """ 
    19     def __init__(self, x=None, y=None, dx=None, dy=None): 
     19 
     20    def __init__(self, x=None, y=None, dx=None, dy=None, lam=None, dlam=None, isSesans=False): 
    2021        """ 
    2122        """ 
     
    2425        if y is None: 
    2526            y = [] 
    26         PlotData1D.__init__(self, x, y, dx, dy) 
    27         LoadData1D.__init__(self, x, y, dx, dy) 
     27        self.isSesans = isSesans 
     28        PlotData1D.__init__(self, x, y, dx, dy, lam, dlam) 
     29        LoadData1D.__init__(self, x, y, dx, dy, lam, dlam, isSesans) 
     30 
    2831        self.id = None 
    2932        self.list_group_id = [] 
     
    6871        # First, check the data compatibility 
    6972        dy, dy_other = self._validity_check(other) 
    70         result = Data1D(x=[], y=[], dx=None, dy=None) 
     73        result = Data1D(x=[], y=[], lam=[], dx=None, dy=None, dlam=None) 
    7174        result.clone_without_data(length=len(self.x), clone=self) 
    7275        result.copy_from_datainfo(data1d=self) 
     
    115118        # First, check the data compatibility 
    116119        self._validity_check_union(other) 
    117         result = Data1D(x=[], y=[], dx=None, dy=None) 
     120        result = Data1D(x=[], y=[], lam=[], dx=None, dy=None, dlam=None) 
    118121        tot_length = len(self.x) + len(other.x) 
    119122        result = self.clone_without_data(length=tot_length, clone=result) 
     123        if self.dlam == None or other.dlam is None: 
     124            result.dlam = None 
     125        else: 
     126            result.dlam = numpy.zeros(tot_length) 
    120127        if self.dy == None or other.dy is None: 
    121128            result.dy = None 
     
    141148        result.y = numpy.append(self.y, other.y) 
    142149        result.y = result.y[ind] 
     150        result.lam = numpy.append(self.lam, other.lam) 
     151        result.lam = result.lam[ind] 
     152        if result.dlam != None: 
     153            result.dlam = numpy.append(self.dlam, other.dlam) ^ M 
     154            result.dlam = result.dlam[ind] 
    143155        if result.dy != None: 
    144156            result.dy = numpy.append(self.dy, other.dy) 
     
    260272        # First, check the data compatibility 
    261273        self._validity_check_union(other) 
    262         result = Data1D(x=[], y=[], dx=None, dy=None) 
     274        result = Data1D(x=[], y=[], lam=[], dx=None, dy=None, dlam=[]) 
    263275        tot_length = len(self.x)+len(other.x) 
    264276        result.clone_without_data(length=tot_length, clone=self) 
     277        if self.dlam == None or other.dlam is None: 
     278            result.dlam = None 
     279        else: 
     280            result.dlam = numpy.zeros(tot_length) 
    265281        if self.dy == None or other.dy is None: 
    266282            result.dy = None 
     
    285301        result.y = numpy.append(self.y, other.y) 
    286302        result.y = result.y[ind] 
     303        result.lam = numpy.append(self.lam, other.lam) 
     304        result.lam = result.lam[ind] 
    287305        if result.dy != None: 
    288306            result.dy = numpy.append(self.dy, other.dy) 
  • src/sas/sasgui/guiframe/data_manager.py

    r345e7e4 ra9f579c  
    6262        if issubclass(Data2D, data.__class__): 
    6363            new_plot = Data2D(image=None, err_image=None)  
    64         else:  
    65             new_plot = Data1D(x=[], y=[], dx=None, dy=None) 
    66             
     64        elif data.meta_data['loader'] == 'SESANS': 
     65            new_plot = Data1D(x=[], y=[], dx=None, dy=None, lam=None, dlam=None, isSesans=True) 
     66        else: 
     67            new_plot = Data1D(x=[], y=[], dx=None, dy=None, lam=None, dlam=None) #SESANS check??? 
     68 
    6769        new_plot.copy_from_datainfo(data) 
    6870        data.clone_without_data(clone=new_plot) 
Note: See TracChangeset for help on using the changeset viewer.