Changeset 3b2b031 in sasview


Ignore:
Timestamp:
Jun 29, 2012 4:59:38 PM (12 years ago)
Author:
Jae Cho <jhjcho@…>
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:
7d89e50
Parents:
83b81b8
Message:

added background for porodplot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plottools/src/danse/common/plottools/fitDialog.py

    rffdfd23 r3b2b031  
    9999         
    100100        # Buttons on the bottom 
     101        self.bg_on = False 
    101102        self.static_line_1 = wx.StaticLine(self, -1) 
    102103        self.btFit = wx.Button(self, -1, 'Fit') 
     
    105106        self.btClose =wx.Button(self, wx.ID_CANCEL, 'Close') 
    106107        self.btClose.Bind(wx.EVT_BUTTON, self._on_close) 
    107          
     108        if RG_ON: 
     109            if (self.yLabel == "ln(y)" or self.yLabel == "ln(y*x)") and \ 
     110                    (self.xLabel == "x^(2)"): 
     111                self.rg_on = True 
     112            if (self.xLabel == "x^(4)") and (self.yLabel == "y*x^(4)"): 
     113                self.bg_on = True 
    108114        # Intro 
    109115        explanation = "Perform fit for y(x) = ax + b" 
     116        if self.bg_on: 
     117            param_a = 'Background (= Parameter a)' 
     118        else: 
     119            param_a = 'Parameter a' 
    110120        vbox.Add(sizer) 
    111121        ix = 0 
     
    114124                 (1, 1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
    115125        iy += 2 
    116         sizer.Add(wx.StaticText(self, -1, 'Parameter a'), (iy, ix), 
     126        sizer.Add(wx.StaticText(self, -1, param_a), (iy, ix), 
    117127                 (1, 1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
    118128        ix += 1 
     
    175185        ix += 2 
    176186        sizer.Add(self.xmaxFit, (iy, ix), (1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
    177         if RG_ON: 
    178             if (self.yLabel == "ln(y)" or self.yLabel == "ln(y*x)") and \ 
    179                     (self.xLabel == "x^(2)"): 
    180                 self.rg_on = True 
    181                 self.SetSize((PNL_WIDTH, PNL_HEIGHT)) 
    182                 I0_stxt = wx.StaticText(self, -1, 'I(q=0)') 
    183                 self.I0_tctr = wx.TextCtrl(self, -1, '') 
    184                 self.I0_tctr.SetEditable(False) 
    185                 self.I0_tctr.SetBackgroundColour(_BACKGROUND_COLOR) 
    186                 self.I0err_tctr = wx.TextCtrl(self, -1, '') 
    187                 self.I0err_tctr.SetEditable(False) 
    188                 self.I0err_tctr.SetBackgroundColour(_BACKGROUND_COLOR) 
    189                 Rg_stxt = wx.StaticText(self, -1, 'Rg [A]') 
    190                 Rg_stxt.Show(self.yLabel == "ln(y)" ) 
    191                 self.Rg_tctr = wx.TextCtrl(self, -1, '') 
    192                 self.Rg_tctr.SetEditable(False) 
    193                 self.Rg_tctr.SetBackgroundColour(_BACKGROUND_COLOR) 
    194                 self.Rg_tctr.Show(self.yLabel == "ln(y)" ) 
    195                 self.Rgerr_tctr = wx.TextCtrl(self, -1, '') 
    196                 self.Rgerr_tctr.SetEditable(False) 
    197                 self.Rgerr_tctr.SetBackgroundColour(_BACKGROUND_COLOR) 
    198                 self.Rgerr_tctr.Show(self.yLabel == "ln(y)" ) 
    199                 self.Rgerr_pm = wx.StaticText(self, -1, '+/-') 
    200                 self.Rgerr_pm.Show(self.yLabel == "ln(y)" ) 
    201                 Diameter_stxt = wx.StaticText(self, -1, 'Rod Diameter [A]') 
    202                 Diameter_stxt.Show(self.yLabel == "ln(y*x)") 
    203                 self.Diameter_tctr = wx.TextCtrl(self, -1, '') 
    204                 self.Diameter_tctr.SetEditable(False) 
    205                 self.Diameter_tctr.SetBackgroundColour(_BACKGROUND_COLOR) 
    206                 self.Diameter_tctr.Show(self.yLabel == "ln(y*x)") 
    207                 self.Diameter_pm = wx.StaticText(self, -1, '+/-') 
    208                 self.Diameter_pm.Show(self.yLabel == "ln(y*x)") 
    209                 self.Diametererr_tctr = wx.TextCtrl(self, -1, '') 
    210                 self.Diametererr_tctr.SetEditable(False) 
    211                 self.Diametererr_tctr.SetBackgroundColour(_BACKGROUND_COLOR) 
    212                 self.Diametererr_tctr.Show(self.yLabel == "ln(y*x)") 
    213                 RgQmin_stxt = wx.StaticText(self, -1, 'Rg*Qmin') 
    214                 self.RgQmin_tctr = wx.TextCtrl(self, -1, '') 
    215                 self.RgQmin_tctr.SetEditable(False) 
    216                 self.RgQmin_tctr.SetBackgroundColour(_BACKGROUND_COLOR) 
    217                 RgQmax_stxt = wx.StaticText(self, -1, 'Rg*Qmax') 
    218                 self.RgQmax_tctr = wx.TextCtrl(self, -1, '') 
    219                 self.RgQmax_tctr.SetEditable(False) 
    220                 self.RgQmax_tctr.SetBackgroundColour(_BACKGROUND_COLOR) 
     187        if self.rg_on: 
     188            self.SetSize((PNL_WIDTH, PNL_HEIGHT)) 
     189            I0_stxt = wx.StaticText(self, -1, 'I(q=0)') 
     190            self.I0_tctr = wx.TextCtrl(self, -1, '') 
     191            self.I0_tctr.SetEditable(False) 
     192            self.I0_tctr.SetBackgroundColour(_BACKGROUND_COLOR) 
     193            self.I0err_tctr = wx.TextCtrl(self, -1, '') 
     194            self.I0err_tctr.SetEditable(False) 
     195            self.I0err_tctr.SetBackgroundColour(_BACKGROUND_COLOR) 
     196            Rg_stxt = wx.StaticText(self, -1, 'Rg [A]') 
     197            Rg_stxt.Show(self.yLabel == "ln(y)" ) 
     198            self.Rg_tctr = wx.TextCtrl(self, -1, '') 
     199            self.Rg_tctr.SetEditable(False) 
     200            self.Rg_tctr.SetBackgroundColour(_BACKGROUND_COLOR) 
     201            self.Rg_tctr.Show(self.yLabel == "ln(y)" ) 
     202            self.Rgerr_tctr = wx.TextCtrl(self, -1, '') 
     203            self.Rgerr_tctr.SetEditable(False) 
     204            self.Rgerr_tctr.SetBackgroundColour(_BACKGROUND_COLOR) 
     205            self.Rgerr_tctr.Show(self.yLabel == "ln(y)" ) 
     206            self.Rgerr_pm = wx.StaticText(self, -1, '+/-') 
     207            self.Rgerr_pm.Show(self.yLabel == "ln(y)" ) 
     208            Diameter_stxt = wx.StaticText(self, -1, 'Rod Diameter [A]') 
     209            Diameter_stxt.Show(self.yLabel == "ln(y*x)") 
     210            self.Diameter_tctr = wx.TextCtrl(self, -1, '') 
     211            self.Diameter_tctr.SetEditable(False) 
     212            self.Diameter_tctr.SetBackgroundColour(_BACKGROUND_COLOR) 
     213            self.Diameter_tctr.Show(self.yLabel == "ln(y*x)") 
     214            self.Diameter_pm = wx.StaticText(self, -1, '+/-') 
     215            self.Diameter_pm.Show(self.yLabel == "ln(y*x)") 
     216            self.Diametererr_tctr = wx.TextCtrl(self, -1, '') 
     217            self.Diametererr_tctr.SetEditable(False) 
     218            self.Diametererr_tctr.SetBackgroundColour(_BACKGROUND_COLOR) 
     219            self.Diametererr_tctr.Show(self.yLabel == "ln(y*x)") 
     220            RgQmin_stxt = wx.StaticText(self, -1, 'Rg*Qmin') 
     221            self.RgQmin_tctr = wx.TextCtrl(self, -1, '') 
     222            self.RgQmin_tctr.SetEditable(False) 
     223            self.RgQmin_tctr.SetBackgroundColour(_BACKGROUND_COLOR) 
     224            RgQmax_stxt = wx.StaticText(self, -1, 'Rg*Qmax') 
     225            self.RgQmax_tctr = wx.TextCtrl(self, -1, '') 
     226            self.RgQmax_tctr.SetEditable(False) 
     227            self.RgQmax_tctr.SetBackgroundColour(_BACKGROUND_COLOR) 
    221228 
    222                 iy += 2 
    223                 ix = 0 
    224                 sizer.Add(I0_stxt, (iy, ix), (1,1), 
    225                                         wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
    226                 ix += 1 
    227                 sizer.Add(self.I0_tctr, (iy, ix), (1,1), 
    228                                         wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
    229                 ix += 1 
    230                 sizer.Add(wx.StaticText(self, -1, '+/-'), (iy, ix), 
    231                                         (1, 1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
    232                 ix += 1 
    233                 sizer.Add(self.I0err_tctr, (iy, ix), (1,1),  
    234                                         wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
    235                  
    236                 iy += 1 
    237                 ix = 0 
    238                 sizer.Add(Rg_stxt, (iy, ix),(1,1), 
    239                                         wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
    240                 ix += 1 
    241                 sizer.Add(self.Rg_tctr, (iy, ix), (1,1), 
    242                                         wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
    243          
    244                 ix += 1 
    245                 sizer.Add(self.Rgerr_pm, (iy, ix), 
    246                                         (1, 1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
    247                 ix += 1 
    248                 sizer.Add(self.Rgerr_tctr, (iy, ix), (1,1),  
    249                                         wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
    250                 iy += 1 
    251                 ix = 0 
    252                 sizer.Add(Diameter_stxt, (iy, ix),(1,1), 
    253                                         wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
    254                 ix += 1 
    255                 sizer.Add(self.Diameter_tctr, (iy, ix), (1,1), 
    256                                         wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
    257          
    258                 ix += 1 
    259                 sizer.Add(self.Diameter_pm, (iy, ix), 
    260                                         (1, 1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
    261                 ix += 1 
    262                 sizer.Add(self.Diametererr_tctr, (iy, ix), (1,1),  
    263                                         wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
    264                 iy += 1 
    265                 ix = 0 
    266                 sizer.Add(RgQmin_stxt, (iy, ix),(1,1), 
    267                                         wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
    268                 ix += 1 
    269                 sizer.Add(self.RgQmin_tctr, (iy, ix), (1,1), 
    270                                         wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
    271                 iy += 1 
    272                 ix = 0 
    273                 sizer.Add(RgQmax_stxt, (iy, ix),(1,1), 
    274                                         wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
    275                 ix += 1 
    276                 sizer.Add(self.RgQmax_tctr, (iy, ix), (1,1), 
    277                                         wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
     229            iy += 2 
     230            ix = 0 
     231            sizer.Add(I0_stxt, (iy, ix), (1,1), 
     232                                    wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
     233            ix += 1 
     234            sizer.Add(self.I0_tctr, (iy, ix), (1,1), 
     235                                    wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
     236            ix += 1 
     237            sizer.Add(wx.StaticText(self, -1, '+/-'), (iy, ix), 
     238                                    (1, 1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
     239            ix += 1 
     240            sizer.Add(self.I0err_tctr, (iy, ix), (1,1),  
     241                                    wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
     242             
     243            iy += 1 
     244            ix = 0 
     245            sizer.Add(Rg_stxt, (iy, ix),(1,1), 
     246                                    wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
     247            ix += 1 
     248            sizer.Add(self.Rg_tctr, (iy, ix), (1,1), 
     249                                    wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
     250     
     251            ix += 1 
     252            sizer.Add(self.Rgerr_pm, (iy, ix), 
     253                                    (1, 1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
     254            ix += 1 
     255            sizer.Add(self.Rgerr_tctr, (iy, ix), (1,1),  
     256                                    wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
     257            iy += 1 
     258            ix = 0 
     259            sizer.Add(Diameter_stxt, (iy, ix),(1,1), 
     260                                    wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
     261            ix += 1 
     262            sizer.Add(self.Diameter_tctr, (iy, ix), (1,1), 
     263                                    wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
     264     
     265            ix += 1 
     266            sizer.Add(self.Diameter_pm, (iy, ix), 
     267                                    (1, 1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
     268            ix += 1 
     269            sizer.Add(self.Diametererr_tctr, (iy, ix), (1,1),  
     270                                    wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
     271            iy += 1 
     272            ix = 0 
     273            sizer.Add(RgQmin_stxt, (iy, ix),(1,1), 
     274                                    wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
     275            ix += 1 
     276            sizer.Add(self.RgQmin_tctr, (iy, ix), (1,1), 
     277                                    wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
     278            iy += 1 
     279            ix = 0 
     280            sizer.Add(RgQmax_stxt, (iy, ix),(1,1), 
     281                                    wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
     282            ix += 1 
     283            sizer.Add(self.RgQmax_tctr, (iy, ix), (1,1), 
     284                                    wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
    278285             
    279286        iy += 1 
     
    372379        tempy = [] 
    373380        tempdy = [] 
    374         
     381             
    375382        # Check if View contains a x array .we online fit when x exits 
    376383        # makes transformation for y as a line to fit 
Note: See TracChangeset for help on using the changeset viewer.