Ignore:
Timestamp:
May 23, 2008 10:56:21 AM (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:
f24b8f4
Parents:
43c0a8e
Message:

Add a couple of figures of merit (GUI)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • prview/perspectives/pr/inversion_panel.py

    r119a11d rdfb58f8  
    105105     
    106106    # Figure of merit parameters [default] 
     107     
     108    ## Oscillation parameters (sin function = 1.1) 
    107109    oscillation_max = 1.5 
     110     
     111    ## Fraction of P(r) that is positive  
     112    positive = 1.0 
     113     
     114    ## Fraction of P(r) that is greater than zero by more than 1 sigma 
     115    pos_err  = 1.0 
    108116     
    109117    def __init__(self, parent, id = -1, plots = None, **kwargs): 
     
    127135        self.qmin_ctl = None 
    128136        self.qmax_ctl = None 
     137         
     138        # TextCtrl for fraction of positive P(r) 
     139        self.pos_ctl = None 
     140         
     141        # TextCtrl for fraction of 1 sigma positive P(r) 
     142        self.pos_err_ctl = None  
    129143         
    130144        ## Estimates 
     
    156170        elif name=='oscillation': 
    157171            self.osc_ctl.SetValue("%-5.2g" % value) 
     172        elif name=='positive': 
     173            self.pos_ctl.SetValue("%-5.2g" % value) 
     174        elif name=='pos_err': 
     175            self.pos_err_ctl.SetValue("%-5.2g" % value) 
    158176        elif name=='alpha_estimate': 
    159177            self.alpha_estimate_ctl.SetToolTipString("Click to accept value.") 
     
    189207        elif name=='oscillation': 
    190208            self.osc_ctl.GetValue() 
     209        elif name=='pos': 
     210            self.pos_ctl.GetValue() 
     211        elif name=='pos_err': 
     212            self.pos_err_ctl.GetValue() 
    191213        elif name=='alpha_estimate': 
    192214            self.alpha_estimate_ctl.GetValue() 
     
    330352        label_chi2 = wx.StaticText(self, -1, "Chi2/dof") 
    331353        label_osc = wx.StaticText(self, -1, "Oscillations") 
     354        label_pos = wx.StaticText(self, -1, "Positive fraction") 
     355        label_pos_err = wx.StaticText(self, -1, "1-sigma positive fraction") 
    332356         
    333357        self.time_ctl = wx.TextCtrl(self, -1, size=(60,20)) 
     
    339363        self.chi2_ctl.SetToolTipString("Chi^2 over degrees of freedom.") 
    340364         
     365        # Oscillation parameter 
    341366        self.osc_ctl = wx.TextCtrl(self, -1, size=(60,20)) 
    342367        self.osc_ctl.SetEditable(False) 
    343368        self.osc_ctl.SetToolTipString("Oscillation parameter. P(r) for a sphere has an oscillation parameter of 1.1.") 
     369         
     370        # Positive fraction figure of merit 
     371        self.pos_ctl = wx.TextCtrl(self, -1, size=(60,20)) 
     372        self.pos_ctl.SetEditable(False) 
     373        self.pos_ctl.SetToolTipString("Fraction of P(r) that is positive. Theoretically, P(r) is defined positive.") 
     374         
     375        # 1-simga positive fraction figure of merit 
     376        self.pos_err_ctl = wx.TextCtrl(self, -1, size=(60,20)) 
     377        self.pos_err_ctl.SetEditable(False) 
     378        message  = "Fraction of P(r) that is at least 1 standard deviation greater than zero.\n" 
     379        message += "This figure of merit tells you about the size of the P(r) errors.\n" 
     380        message += "If it is close to 1 and the other figures of merit are bad, consider changing " 
     381        message += "the maximum distance." 
     382        self.pos_err_ctl.SetToolTipString(message) 
    344383         
    345384        sizer_res = wx.GridBagSizer(5,5) 
     
    355394        sizer_res.Add(label_osc, (iy,0), (1,1), wx.LEFT|wx.EXPAND, 15) 
    356395        sizer_res.Add(self.osc_ctl,   (iy,1), (1,1), wx.RIGHT|wx.EXPAND, 15) 
     396 
     397        iy += 1 
     398        sizer_res.Add(label_pos, (iy,0), (1,1), wx.LEFT|wx.EXPAND, 15) 
     399        sizer_res.Add(self.pos_ctl,   (iy,1), (1,1), wx.RIGHT|wx.EXPAND, 15) 
     400 
     401        iy += 1 
     402        sizer_res.Add(label_pos_err, (iy,0), (1,1), wx.LEFT|wx.EXPAND, 15) 
     403        sizer_res.Add(self.pos_err_ctl,   (iy,1), (1,1), wx.RIGHT|wx.EXPAND, 15) 
    357404 
    358405        ressizer.Add(sizer_res, 0) 
Note: See TracChangeset for help on using the changeset viewer.