Changeset 357b79b in sasview for prview


Ignore:
Timestamp:
Jul 3, 2008 3:35:59 PM (16 years ago)
Author:
Mathieu Doucet <doucetm@…>
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, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
9362f85
Parents:
7578961
Message:

Minor improvements

Location:
prview
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • prview/installer.iss

    rfc4ab6e r357b79b  
    33 
    44[Setup] 
    5 AppName=PrView-0.1 
    6 AppVerName=PrView 0.1 
     5AppName=PrView-0.2 
     6AppVerName=PrView 0.2 
    77AppPublisher=University of Tennessee 
    88AppPublisherURL=http://danse.chem.utk.edu/ 
    99AppSupportURL=http://danse.chem.utk.edu/ 
    1010AppUpdatesURL=http://danse.chem.utk.edu/ 
    11 DefaultDirName={userappdata}\PrView-0.1 
    12 DefaultGroupName=DANSE\PrView-0.1 
     11DefaultDirName={userappdata}\PrView-0.2 
     12DefaultGroupName=DANSE\PrView-0.2 
    1313DisableProgramGroupPage=yes 
    1414LicenseFile=license.txt 
     
    1717Compression=lzma 
    1818SolidCompression=yes 
     19PrivilegesRequired=none 
    1920 
    2021[Languages] 
     
    3536Name: "{group}\PrView"; Filename: "{app}\prView.exe"; WorkingDir: "{app}" 
    3637Name: "{group}\{cm:UninstallProgram,PrView}"; Filename: "{uninstallexe}" 
    37 Name: "{commondesktop}\PrView 0.1"; Filename: "{app}\prView.exe"; Tasks: desktopicon; WorkingDir: "{app}" 
     38Name: "{commondesktop}\PrView 0.2"; Filename: "{app}\prView.exe"; Tasks: desktopicon; WorkingDir: "{app}" 
    3839 
    3940[Run] 
  • prview/local_config.py

    ra4bd2ac r357b79b  
    66# Version of the application 
    77__appname__ = "PrView" 
    8 __version__ = '0.1.1' 
     8__version__ = '0.2.1' 
    99__download_page__ = 'http://danse.chem.utk.edu' 
    1010 
    1111 
    1212# Debug message flag 
    13 __EVT_DEBUG__ = True 
     13__EVT_DEBUG__ = False 
    1414 
    1515# Flag for automated testing 
     
    4040_danse_url = "http://www.cacr.caltech.edu/projects/danse/release/index.html" 
    4141_inst_url = "http://www.utk.edu" 
    42 _corner_image = "images/angles_flat.png" 
     42_corner_image = "images/prview.jpg" 
    4343_copyright = "(c) 2008, University of Tennessee" 
    4444 
  • prview/perspectives/pr/inversion_panel.py

    r2a92852 r357b79b  
    348348            sizer_slit = wx.GridBagSizer(5,5) 
    349349     
    350             label_sheight = wx.StaticText(self, -1, "Height") 
    351             label_swidth = wx.StaticText(self, -1, "Width") 
     350            label_sheight = wx.StaticText(self, -1, "Height", size=(35,20)) 
     351            label_swidth = wx.StaticText(self, -1, "Width", size=(35,20)) 
    352352            #label_sunits1 = wx.StaticText(self, -1, "[A^(-1)]") 
    353             label_sunits2 = wx.StaticText(self, -1, "[A^(-1)]") 
     353            label_sunits2 = wx.StaticText(self, -1, "[A^(-1)]", size=(40,20)) 
    354354            self.sheight_ctl = wx.TextCtrl(self, -1, size=(60,20)) 
    355355            self.swidth_ctl = wx.TextCtrl(self, -1, size=(60,20)) 
     
    360360             
    361361            iy = 0 
    362             sizer_slit.Add(label_sheight,    (iy,0), (1,1), wx.LEFT|wx.EXPAND, 15) 
    363             sizer_slit.Add(self.sheight_ctl, (iy,1), (1,1), wx.LEFT|wx.EXPAND, 10) 
     362            sizer_slit.Add(label_sheight,    (iy,0), (1,1), wx.LEFT|wx.EXPAND, 5) 
     363            sizer_slit.Add(self.sheight_ctl, (iy,1), (1,1), wx.LEFT|wx.EXPAND, 5) 
    364364            #sizer_slit.Add(label_sunits1,    (iy,2), (1,1), wx.LEFT|wx.EXPAND, 10) 
    365             sizer_slit.Add(label_swidth,     (iy,2), (1,1), wx.LEFT|wx.EXPAND, 15) 
    366             sizer_slit.Add(self.swidth_ctl,  (iy,3), (1,1), wx.LEFT|wx.EXPAND, 10) 
    367             sizer_slit.Add(label_sunits2,    (iy,4), (1,1), wx.LEFT|wx.EXPAND, 10) 
     365            sizer_slit.Add(label_swidth,     (iy,2), (1,1), wx.LEFT|wx.EXPAND, 5) 
     366            sizer_slit.Add(self.swidth_ctl,  (iy,3), (1,1), wx.LEFT|wx.EXPAND, 5) 
     367            sizer_slit.Add(label_sunits2,    (iy,4), (1,1), wx.LEFT|wx.EXPAND, 5) 
    368368             
    369369            sboxsizer.Add(sizer_slit, wx.TOP, 15) 
    370370            vbox.Add(sboxsizer) 
     371         
     372         
     373        # ----- Q range ----- 
     374        qbox = wx.StaticBox(self, -1, "Q range") 
     375        qboxsizer = wx.StaticBoxSizer(qbox, wx.VERTICAL) 
     376        qboxsizer.SetMinSize((320,20)) 
     377         
     378        sizer_q = wx.GridBagSizer(5,5) 
     379 
     380        label_qmin = wx.StaticText(self, -1, "Q min", size=(35,20)) 
     381        label_qmax = wx.StaticText(self, -1, "Q max", size=(35,20)) 
     382        #label_qunits1 = wx.StaticText(self, -1, "[A^(-1)]") 
     383        label_qunits2 = wx.StaticText(self, -1, "[A^(-1)]", size=(40,20)) 
     384        self.qmin_ctl = wx.TextCtrl(self, -1, size=(60,20)) 
     385        self.qmax_ctl = wx.TextCtrl(self, -1, size=(60,20)) 
     386        self.qmin_ctl.SetToolTipString("Select a lower bound for Q or leave blank.") 
     387        self.qmax_ctl.SetToolTipString("Select an upper bound for Q or leave blank.") 
     388        self.qmin_ctl.Bind(wx.EVT_TEXT, self._on_pars_changed) 
     389        self.qmax_ctl.Bind(wx.EVT_TEXT, self._on_pars_changed) 
     390         
     391        iy = 0 
     392        sizer_q.Add(label_qmin,    (iy,0), (1,1), wx.LEFT|wx.EXPAND, 5) 
     393        sizer_q.Add(self.qmin_ctl, (iy,1), (1,1), wx.LEFT|wx.EXPAND, 5) 
     394        #sizer_q.Add(label_qunits1, (iy,2), (1,1), wx.LEFT|wx.EXPAND, 15) 
     395        sizer_q.Add(label_qmax,    (iy,2), (1,1), wx.LEFT|wx.EXPAND, 5) 
     396        sizer_q.Add(self.qmax_ctl, (iy,3), (1,1), wx.LEFT|wx.EXPAND, 5) 
     397        sizer_q.Add(label_qunits2, (iy,4), (1,1), wx.LEFT|wx.EXPAND, 5) 
     398        qboxsizer.Add(sizer_q, wx.TOP, 15) 
     399        vbox.Add(qboxsizer) 
     400         
     401         
    371402         
    372403 
     
    443474        vbox.Add(boxsizer2) 
    444475 
    445         # ----- Q range ----- 
    446         qbox = wx.StaticBox(self, -1, "Q range") 
    447         qboxsizer = wx.StaticBoxSizer(qbox, wx.VERTICAL) 
    448         qboxsizer.SetMinSize((320,20)) 
    449          
    450         sizer_q = wx.GridBagSizer(5,5) 
    451  
    452         label_qmin = wx.StaticText(self, -1, "Q min") 
    453         label_qmax = wx.StaticText(self, -1, "Q max") 
    454         #label_qunits1 = wx.StaticText(self, -1, "[A^(-1)]") 
    455         label_qunits2 = wx.StaticText(self, -1, "[A^(-1)]") 
    456         self.qmin_ctl = wx.TextCtrl(self, -1, size=(60,20)) 
    457         self.qmax_ctl = wx.TextCtrl(self, -1, size=(60,20)) 
    458         self.qmin_ctl.SetToolTipString("Select a lower bound for Q or leave blank.") 
    459         self.qmax_ctl.SetToolTipString("Select an upper bound for Q or leave blank.") 
    460         self.qmin_ctl.Bind(wx.EVT_TEXT, self._on_pars_changed) 
    461         self.qmax_ctl.Bind(wx.EVT_TEXT, self._on_pars_changed) 
    462          
    463         iy = 0 
    464         sizer_q.Add(label_qmin,    (iy,0), (1,1), wx.LEFT|wx.EXPAND, 15) 
    465         sizer_q.Add(self.qmin_ctl, (iy,1), (1,1), wx.LEFT|wx.EXPAND, 10) 
    466         #sizer_q.Add(label_qunits1, (iy,2), (1,1), wx.LEFT|wx.EXPAND, 15) 
    467         sizer_q.Add(label_qmax,    (iy,2), (1,1), wx.LEFT|wx.EXPAND, 15) 
    468         sizer_q.Add(self.qmax_ctl, (iy,3), (1,1), wx.LEFT|wx.EXPAND, 10) 
    469         sizer_q.Add(label_qunits2, (iy,4), (1,1), wx.LEFT|wx.EXPAND, 15) 
    470         qboxsizer.Add(sizer_q, wx.TOP, 15) 
    471         vbox.Add(qboxsizer) 
    472          
    473          
    474476 
    475477        # ----- Results ----- 
  • prview/perspectives/pr/pr.py

    r2a92852 r357b79b  
    351351                    pass 
    352352                    
     353        if not scale==None: 
     354            message = "The loaded file had no error bars, statistical errors are assumed." 
     355            wx.PostEvent(self.parent, StatusEvent(status=message)) 
     356        else: 
     357            wx.PostEvent(self.parent, StatusEvent(status='')) 
     358                         
    353359        return data_x, data_y, data_err      
    354360         
     
    519525               
    520526        # Make a plot of I(q) data 
    521         new_plot = Data1D(self.pr.x, self.pr.y, dy=self.pr.err) 
     527        if self.pr.err==None: 
     528            new_plot = Theory1D(self.pr.x, self.pr.y) 
     529        else: 
     530            new_plot = Data1D(self.pr.x, self.pr.y, dy=self.pr.err) 
    522531        new_plot.name = "I_{obs}(q)" 
    523532        new_plot.xaxis("\\rm{Q}", 'A^{-1}') 
     
    648657            @param path: path of the file to read in  
    649658        """ 
     659        from sans.guiframe.data_loader import load_ascii_1D 
     660        import numpy 
    650661        # Load data 
    651662        if os.path.isfile(path): 
     663             
    652664            x, y, err = self.load(path) 
     665            #x, y, err = load_ascii_1D(path) 
     666             
     667            # If we have not errors, add statistical errors 
     668            if err==None: 
     669                err = numpy.zeros(len(y)) 
     670                for i in range(len(y)): 
     671                    err[i] = math.sqrt( math.fabs(y[i]) ) 
     672                message = "The loaded file had no error bars, statistical errors are assumed." 
     673                wx.PostEvent(self.parent, StatusEvent(status=message)) 
     674            else: 
     675                wx.PostEvent(self.parent, StatusEvent(status='')) 
    653676             
    654677            # Get the data from the chosen data set and perform inversion 
     
    674697        from copy import deepcopy 
    675698         
    676         wx.PostEvent(self.parent, StatusEvent(status='')) 
    677699        # If a thread is already started, stop it 
    678700        if self.estimation_thread != None and self.estimation_thread.isrunning(): 
     
    690712        from copy import deepcopy 
    691713         
    692         wx.PostEvent(self.parent, StatusEvent(status='')) 
    693714        # If a thread is already started, stop it 
    694715        if self.estimation_thread != None and self.estimation_thread.isrunning(): 
  • prview/perspectives/pr/pr_thread.py

    r2a92852 r357b79b  
    105105        self.error_func = error_func 
    106106        self.starttime = 0 
    107          
     107        self._time_for_sleep = 0 
     108        self._sleep_delay = 1.0 
     109 
     110 
     111    def isquit(self): 
     112        CalcThread.isquit(self) 
     113        if time.time()>self._time_for_sleep+self._sleep_delay: 
     114            time.sleep(.2) 
     115            self._time_for_sleep = time.time() 
     116 
    108117    def compute(self): 
    109118        """ 
     
    113122        try:             
    114123            t_0 = time.time() 
     124            self._time_for_sleep = t_0 
    115125            nterms, alpha, message = self.pr.estimate_numterms(self.isquit) 
    116126            t_1 = time.time()-t_0 
Note: See TracChangeset for help on using the changeset viewer.