Changeset 0d8ee36 in sasview for src/sas/sasgui/guiframe


Ignore:
Timestamp:
Apr 5, 2017 11:42:20 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.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
3444492
Parents:
b697396b (diff), a2e980b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into batch_slicer

Location:
src/sas/sasgui/guiframe
Files:
2 added
1 deleted
8 edited
1 moved

Legend:

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

    r49e000b r1779e72  
    118118        self.bitmap_button_ansto = wx.BitmapButton(self, -1, wx.NullBitmap) 
    119119        self.bitmap_button_tudelft = wx.BitmapButton(self, -1, wx.NullBitmap) 
     120        self.bitmap_button_dls = wx.BitmapButton(self, -1, wx.NullBitmap) 
    120121         
    121122        self.static_line_3 = wx.StaticLine(self, -1) 
     
    137138        self.Bind(wx.EVT_BUTTON, self.onAnstoLogo, self.bitmap_button_ansto) 
    138139        self.Bind(wx.EVT_BUTTON, self.onTudelftLogo, self.bitmap_button_tudelft) 
     140        self.Bind(wx.EVT_BUTTON, self.onDlsLogo, self.bitmap_button_dls) 
    139141        # end wxGlade 
    140142        # fill in acknowledgements 
     
    229231        logo = wx.Bitmap(image) 
    230232        self.bitmap_button_tudelft.SetBitmapLabel(logo) 
     233         
     234        image = file_dir + "/images/dls_logo.png" 
     235        if os.path.isfile(config._dls_logo): 
     236            image = config._dls_logo 
     237        logo = wx.Bitmap(image) 
     238        self.bitmap_button_dls.SetBitmapLabel(logo) 
    231239                 
    232240        # resize dialog window to fit version number nicely 
     
    260268        self.bitmap_button_ansto.SetSize(self.bitmap_button_ansto.GetBestSize()) 
    261269        self.bitmap_button_tudelft.SetSize(self.bitmap_button_tudelft.GetBestSize()) 
     270        self.bitmap_button_dls.SetSize(self.bitmap_button_dls.GetBestSize()) 
    262271        # end wxGlade 
    263272 
     
    325334        sizer_logos.Add(self.bitmap_button_tudelft, 0,  
    326335                        wx.LEFT|wx.ADJUST_MINSIZE, 2) 
     336        sizer_logos.Add(self.bitmap_button_dls, 0,  
     337                        wx.LEFT|wx.ADJUST_MINSIZE, 2) 
    327338                 
    328339        sizer_logos.Add((10, 50), 0, wx.ADJUST_MINSIZE, 0) 
     
    423434        event.Skip() 
    424435 
     436    def onDlsLogo(self, event): 
     437        """ 
     438        """  
     439        # wxGlade: DialogAbout.<event_handler> 
     440        launchBrowser(config._dls_url) 
     441        event.Skip() 
     442 
    425443# end of class DialogAbout 
    426444 
  • src/sas/sasgui/guiframe/config.py

    rf9d1f60 r1779e72  
    4646 
    4747_acknowledgement =  \ 
    48 '''This work was originally developed as part of the DANSE project funded by the US NSF under Award DMR-0520547,\n but is currently maintained by a collaboration between UTK, UMD, NIST, ORNL, ISIS, ESS, ILL, ANSTO and TU Delft and the scattering community.\n\n SasView also contains code developed with funding from the EU Horizon 2020 programme under the SINE2020 project (Grant No 654000).\nA list of individual contributors can be found at: https://github.com/orgs/SasView/people 
     48'''This work was originally developed as part of the DANSE project funded by the US NSF under Award DMR-0520547,\n but is currently maintained by a collaboration between UTK, UMD, NIST, ORNL, ISIS, ESS, ILL, ANSTO, TU Delft, DLS, and the scattering community.\n\n SasView also contains code developed with funding from the EU Horizon 2020 programme under the SINE2020 project (Grant No 654000).\nA list of individual contributors can be found at: https://github.com/orgs/SasView/people 
    4949''' 
    5050 
     
    8383_ansto_url = "http://www.ansto.gov.au/" 
    8484_tudelft_url = "http://www.tnw.tudelft.nl/en/cooperation/facilities/reactor-instituut-delft/" 
     85_dls_url = "http://www.diamond.ac.uk/" 
    8586_danse_url = "http://www.cacr.caltech.edu/projects/danse/release/index.html" 
    8687_inst_url = "http://www.utk.edu" 
    8788_corner_image = os.path.join(icon_path, "angles_flat.png") 
    8889_welcome_image = os.path.join(icon_path, "SVwelcome.png") 
    89 _copyright = "(c) 2009 - 2017, UTK, UMD, NIST, ORNL, ISIS, ESS, ILL, ANSTO and TU Delft" 
     90_copyright = "(c) 2009 - 2017, UTK, UMD, NIST, ORNL, ISIS, ESS, ILL, ANSTO, TU Delft, and DLS" 
    9091marketplace_url = "http://marketplace.sasview.org/" 
    9192 
  • src/sas/sasgui/guiframe/dataFitting.py

    r68adf86 r9a5097c  
    33""" 
    44import copy 
    5 import numpy 
     5import numpy as np 
    66import math 
    77from sas.sascalc.data_util.uncertainty import Uncertainty 
     
    8181            result.dxw = None 
    8282        else: 
    83             result.dxw = numpy.zeros(len(self.x)) 
     83            result.dxw = np.zeros(len(self.x)) 
    8484        if self.dxl == None: 
    8585            result.dxl = None 
    8686        else: 
    87             result.dxl = numpy.zeros(len(self.x)) 
     87            result.dxl = np.zeros(len(self.x)) 
    8888 
    8989        for i in range(len(self.x)): 
     
    128128            result.dlam = None 
    129129        else: 
    130             result.dlam = numpy.zeros(tot_length) 
     130            result.dlam = np.zeros(tot_length) 
    131131        if self.dy == None or other.dy is None: 
    132132            result.dy = None 
    133133        else: 
    134             result.dy = numpy.zeros(tot_length) 
     134            result.dy = np.zeros(tot_length) 
    135135        if self.dx == None or other.dx is None: 
    136136            result.dx = None 
    137137        else: 
    138             result.dx = numpy.zeros(tot_length) 
     138            result.dx = np.zeros(tot_length) 
    139139        if self.dxw == None or other.dxw is None: 
    140140            result.dxw = None 
    141141        else: 
    142             result.dxw = numpy.zeros(tot_length) 
     142            result.dxw = np.zeros(tot_length) 
    143143        if self.dxl == None or other.dxl is None: 
    144144            result.dxl = None 
    145145        else: 
    146             result.dxl = numpy.zeros(tot_length) 
    147  
    148         result.x = numpy.append(self.x, other.x) 
     146            result.dxl = np.zeros(tot_length) 
     147 
     148        result.x = np.append(self.x, other.x) 
    149149        #argsorting 
    150         ind = numpy.argsort(result.x) 
     150        ind = np.argsort(result.x) 
    151151        result.x = result.x[ind] 
    152         result.y = numpy.append(self.y, other.y) 
     152        result.y = np.append(self.y, other.y) 
    153153        result.y = result.y[ind] 
    154         result.lam = numpy.append(self.lam, other.lam) 
     154        result.lam = np.append(self.lam, other.lam) 
    155155        result.lam = result.lam[ind] 
    156156        if result.dlam != None: 
    157             result.dlam = numpy.append(self.dlam, other.dlam) 
     157            result.dlam = np.append(self.dlam, other.dlam) 
    158158            result.dlam = result.dlam[ind] 
    159159        if result.dy != None: 
    160             result.dy = numpy.append(self.dy, other.dy) 
     160            result.dy = np.append(self.dy, other.dy) 
    161161            result.dy = result.dy[ind] 
    162162        if result.dx is not None: 
    163             result.dx = numpy.append(self.dx, other.dx) 
     163            result.dx = np.append(self.dx, other.dx) 
    164164            result.dx = result.dx[ind] 
    165165        if result.dxw is not None: 
    166             result.dxw = numpy.append(self.dxw, other.dxw) 
     166            result.dxw = np.append(self.dxw, other.dxw) 
    167167            result.dxw = result.dxw[ind] 
    168168        if result.dxl is not None: 
    169             result.dxl = numpy.append(self.dxl, other.dxl) 
     169            result.dxl = np.append(self.dxl, other.dxl) 
    170170            result.dxl = result.dxl[ind] 
    171171        return result 
     
    230230            result.dxw = None 
    231231        else: 
    232             result.dxw = numpy.zeros(len(self.x)) 
     232            result.dxw = np.zeros(len(self.x)) 
    233233        if self.dxl == None: 
    234234            result.dxl = None 
    235235        else: 
    236             result.dxl = numpy.zeros(len(self.x)) 
    237  
    238         for i in range(numpy.size(self.x)): 
     236            result.dxl = np.zeros(len(self.x)) 
     237 
     238        for i in range(np.size(self.x)): 
    239239            result.x[i] = self.x[i] 
    240240            if self.dx is not None and len(self.x) == len(self.dx): 
     
    282282            result.dlam = None 
    283283        else: 
    284             result.dlam = numpy.zeros(tot_length) 
     284            result.dlam = np.zeros(tot_length) 
    285285        if self.dy == None or other.dy is None: 
    286286            result.dy = None 
    287287        else: 
    288             result.dy = numpy.zeros(tot_length) 
     288            result.dy = np.zeros(tot_length) 
    289289        if self.dx == None or other.dx is None: 
    290290            result.dx = None 
    291291        else: 
    292             result.dx = numpy.zeros(tot_length) 
     292            result.dx = np.zeros(tot_length) 
    293293        if self.dxw == None or other.dxw is None: 
    294294            result.dxw = None 
    295295        else: 
    296             result.dxw = numpy.zeros(tot_length) 
     296            result.dxw = np.zeros(tot_length) 
    297297        if self.dxl == None or other.dxl is None: 
    298298            result.dxl = None 
    299299        else: 
    300             result.dxl = numpy.zeros(tot_length) 
    301         result.x = numpy.append(self.x, other.x) 
     300            result.dxl = np.zeros(tot_length) 
     301        result.x = np.append(self.x, other.x) 
    302302        #argsorting 
    303         ind = numpy.argsort(result.x) 
     303        ind = np.argsort(result.x) 
    304304        result.x = result.x[ind] 
    305         result.y = numpy.append(self.y, other.y) 
     305        result.y = np.append(self.y, other.y) 
    306306        result.y = result.y[ind] 
    307         result.lam = numpy.append(self.lam, other.lam) 
     307        result.lam = np.append(self.lam, other.lam) 
    308308        result.lam = result.lam[ind] 
    309309        if result.dy != None: 
    310             result.dy = numpy.append(self.dy, other.dy) 
     310            result.dy = np.append(self.dy, other.dy) 
    311311            result.dy = result.dy[ind] 
    312312        if result.dx is not None: 
    313             result.dx = numpy.append(self.dx, other.dx) 
     313            result.dx = np.append(self.dx, other.dx) 
    314314            result.dx = result.dx[ind] 
    315315        if result.dxw is not None: 
    316             result.dxw = numpy.append(self.dxw, other.dxw) 
     316            result.dxw = np.append(self.dxw, other.dxw) 
    317317            result.dxw = result.dxw[ind] 
    318318        if result.dxl is not None: 
    319             result.dxl = numpy.append(self.dxl, other.dxl) 
     319            result.dxl = np.append(self.dxl, other.dxl) 
    320320            result.dxl = result.dxl[ind] 
    321321        return result 
     
    409409            result.dqy_data = None 
    410410        else: 
    411             result.dqx_data = numpy.zeros(len(self.data)) 
    412             result.dqy_data = numpy.zeros(len(self.data)) 
    413         for i in range(numpy.size(self.data)): 
     411            result.dqx_data = np.zeros(len(self.data)) 
     412            result.dqy_data = np.zeros(len(self.data)) 
     413        for i in range(np.size(self.data)): 
    414414            result.data[i] = self.data[i] 
    415415            if self.err_data is not None and \ 
    416                 numpy.size(self.data) == numpy.size(self.err_data): 
     416                            np.size(self.data) == np.size(self.err_data): 
    417417                result.err_data[i] = self.err_data[i]     
    418418            if self.dqx_data is not None: 
     
    473473            result.dqy_data = None 
    474474        else: 
    475             result.dqx_data = numpy.zeros(len(self.data) + \ 
    476                                          numpy.size(other.data)) 
    477             result.dqy_data = numpy.zeros(len(self.data) + \ 
    478                                          numpy.size(other.data)) 
    479          
    480         result.data = numpy.append(self.data, other.data) 
    481         result.qx_data = numpy.append(self.qx_data, other.qx_data) 
    482         result.qy_data = numpy.append(self.qy_data, other.qy_data) 
    483         result.q_data = numpy.append(self.q_data, other.q_data) 
    484         result.mask = numpy.append(self.mask, other.mask) 
     475            result.dqx_data = np.zeros(len(self.data) + \ 
     476                                       np.size(other.data)) 
     477            result.dqy_data = np.zeros(len(self.data) + \ 
     478                                       np.size(other.data)) 
     479         
     480        result.data = np.append(self.data, other.data) 
     481        result.qx_data = np.append(self.qx_data, other.qx_data) 
     482        result.qy_data = np.append(self.qy_data, other.qy_data) 
     483        result.q_data = np.append(self.q_data, other.q_data) 
     484        result.mask = np.append(self.mask, other.mask) 
    485485        if result.err_data is not None: 
    486             result.err_data = numpy.append(self.err_data, other.err_data)  
     486            result.err_data = np.append(self.err_data, other.err_data) 
    487487        if self.dqx_data is not None: 
    488             result.dqx_data = numpy.append(self.dqx_data, other.dqx_data) 
     488            result.dqx_data = np.append(self.dqx_data, other.dqx_data) 
    489489        if self.dqy_data is not None: 
    490             result.dqy_data = numpy.append(self.dqy_data, other.dqy_data) 
     490            result.dqy_data = np.append(self.dqy_data, other.dqy_data) 
    491491 
    492492        return result 
  • src/sas/sasgui/guiframe/data_processor.py

    r468c253 r9a5097c  
    10911091            # When inputs are from an external file 
    10921092            return inputs, outputs 
    1093         inds = numpy.lexsort((to_be_sort, to_be_sort)) 
     1093        inds = np.lexsort((to_be_sort, to_be_sort)) 
    10941094        for key in outputs.keys(): 
    10951095            key_list = outputs[key] 
     
    13791379            return 
    13801380        if dy == None: 
    1381             dy = numpy.zeros(len(y)) 
     1381            dy = np.zeros(len(y)) 
    13821382        #plotting 
    13831383        new_plot = Data1D(x=x, y=y, dy=dy) 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter1D.py

    r29e872e r9a5097c  
    1414import sys 
    1515import math 
    16 import numpy 
     16import numpy as np 
    1717import logging 
    1818from sas.sasgui.plottools.PlotPanel import PlotPanel 
     
    288288        :Param value: float 
    289289        """ 
    290         idx = (numpy.abs(array - value)).argmin() 
     290        idx = (np.abs(array - value)).argmin() 
    291291        return int(idx)  # array.flat[idx] 
    292292 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter2D.py

    rdfa1579 r0d8ee36  
    1414import sys 
    1515import math 
    16 import numpy 
     16import numpy as np 
    1717import logging 
    1818from sas.sasgui.plottools.PlotPanel import PlotPanel 
     
    568568        """ 
    569569        # Find the best number of bins 
    570         npt = math.sqrt(len(self.data2D.data[numpy.isfinite(self.data2D.data)])) 
     570        npt = math.sqrt(len(self.data2D.data[np.isfinite(self.data2D.data)])) 
    571571        npt = math.floor(npt) 
    572572        from sas.sascalc.dataloader.manipulations import CircularAverage 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/boxSlicer.py

    rd85c194 r9a5097c  
    11import wx 
    22import math 
    3 import numpy 
     3import numpy as np 
    44from sas.sasgui.guiframe.events import NewPlotEvent 
    55from sas.sasgui.guiframe.events import StatusEvent 
     
    358358        # # Reset x, y- coordinates if send as parameters 
    359359        if x != None: 
    360             self.x = numpy.sign(self.x) * math.fabs(x) 
     360            self.x = np.sign(self.x) * math.fabs(x) 
    361361        if y != None: 
    362             self.y = numpy.sign(self.y) * math.fabs(y) 
     362            self.y = np.sign(self.y) * math.fabs(y) 
    363363        # # Draw lines and markers 
    364364        self.inner_marker.set(xdata=[0], ydata=[self.y]) 
     
    465465        # # reset x, y -coordinates if given as parameters 
    466466        if x != None: 
    467             self.x = numpy.sign(self.x) * math.fabs(x) 
     467            self.x = np.sign(self.x) * math.fabs(x) 
    468468        if y != None: 
    469             self.y = numpy.sign(self.y) * math.fabs(y) 
     469            self.y = np.sign(self.y) * math.fabs(y) 
    470470        # # draw lines and markers 
    471471        self.inner_marker.set(xdata=[self.x], ydata=[0]) 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/masking.py

    rd85c194 r9a5097c  
    2424import math 
    2525import copy 
    26 import numpy 
     26import numpy as np 
    2727from sas.sasgui.plottools.PlotPanel import PlotPanel 
    2828from sas.sasgui.plottools.plottables import Graph 
     
    298298        self.subplot.set_ylim(self.data.ymin, self.data.ymax) 
    299299        self.subplot.set_xlim(self.data.xmin, self.data.xmax) 
    300         mask = numpy.ones(len(self.data.mask), dtype=bool) 
     300        mask = np.ones(len(self.data.mask), dtype=bool) 
    301301        self.data.mask = mask 
    302302        # update mask plot 
     
    343343            self.mask = mask 
    344344        # make temperary data to plot 
    345         temp_mask = numpy.zeros(len(mask)) 
     345        temp_mask = np.zeros(len(mask)) 
    346346        temp_data = copy.deepcopy(self.data) 
    347347        # temp_data default is None 
Note: See TracChangeset for help on using the changeset viewer.