Changeset 9bab141 in sasview
- Timestamp:
- Jun 21, 2012 2:37:34 PM (13 years ago)
- 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:
- ffdfd23
- Parents:
- 75a6cf0
- Location:
- plottools/src/danse/common/plottools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
plottools/src/danse/common/plottools/PlotPanel.py
r75a6cf0 r9bab141 729 729 self.viewModel = "--" 730 730 dial.setValues(self.xLabel, self.yLabel, self.viewModel) 731 if self.viewModel == " CS Guinier ln(y*x) vs x^(2)":731 if self.viewModel == "XS Guinier ln(y*x) vs x^(2)": 732 732 self.xLabel = "x^(2)" 733 733 self.yLabel = "ln(y*x)" -
plottools/src/danse/common/plottools/PropertyDialog.py
r75a6cf0 r9bab141 79 79 self.view.Insert("Linear y vs x", 1) 80 80 self.view.Insert("Guinier lny vs x^(2)", 2) 81 self.view.Insert(" CS Guinier ln(y*x) vs x^(2)", 3)81 self.view.Insert("XS Guinier ln(y*x) vs x^(2)", 3) 82 82 self.view.Insert("Porod y*x^(4) vs x^(4)", 4) 83 83 self.SetSizer(vbox) -
plottools/src/danse/common/plottools/fitDialog.py
r10bfeb3 r9bab141 10 10 if sys.platform.count("win32") > 0: 11 11 FONT_VARIANT = 0 12 PNL_WIDTH = 400 12 PNL_WIDTH = 450 13 PNL_HEIGHT = 500 13 14 else: 14 15 FONT_VARIANT = 1 15 PNL_WIDTH = 450 16 16 PNL_WIDTH = 500 17 PNL_HEIGHT = 500 18 RG_ON = True 17 19 18 20 def format_number(value, high=False): … … 40 42 Displays fitting parameters 41 43 """ 42 wx.Dialog.__init__(self, parent, title=title, size=(PNL_WIDTH, 350)) 44 wx.Dialog.__init__(self, parent, title=title, 45 size=(PNL_WIDTH, 350)) 43 46 self.parent = parent 44 47 self.transform = transform … … 52 55 #dialog self plottable 53 56 self.plottable = plottable 54 57 self.rg_on = False 55 58 # Receive transformations of x and y 56 59 self.xLabel, self.yLabel, self.Avalue, self.Bvalue,\ … … 104 107 105 108 # Intro 106 explanation = "Perform fit for y(x) = Ax + B"109 explanation = "Perform fit for y(x) = ax + b" 107 110 vbox.Add(sizer) 108 111 ix = 0 … … 111 114 (1, 1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 112 115 iy += 2 113 sizer.Add(wx.StaticText(self, -1, 'Parameter A'), (iy, ix),116 sizer.Add(wx.StaticText(self, -1, 'Parameter a'), (iy, ix), 114 117 (1, 1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 115 118 ix += 1 … … 123 126 iy += 1 124 127 ix = 0 125 sizer.Add(wx.StaticText(self, -1, 'Parameter B'), (iy, ix),(1, 1),128 sizer.Add(wx.StaticText(self, -1, 'Parameter b'), (iy, ix),(1, 1), 126 129 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 127 130 ix += 1 … … 139 142 ix += 1 140 143 sizer.Add(self.tcChi, (iy, ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 144 145 146 #sizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0) 141 147 iy += 2 142 148 ix = 1 … … 146 152 sizer.Add(wx.StaticText(self, -1, 'Max'), (iy, ix), 147 153 (1, 1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 154 148 155 iy += 1 149 156 ix = 0 … … 168 175 ix += 2 169 176 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 Diameter_stxt = wx.StaticText(self, -1, 'Rod Diameter (A)') 200 Diameter_stxt.Show(self.yLabel == "ln(y*x)") 201 self.Diameter_tctr = wx.TextCtrl(self, -1, '') 202 self.Diameter_tctr.SetEditable(False) 203 self.Diameter_tctr.SetBackgroundColour(_BACKGROUND_COLOR) 204 self.Diameter_tctr.Show(self.yLabel == "ln(y*x)") 205 self.Diametererr_tctr = wx.TextCtrl(self, -1, '') 206 self.Diametererr_tctr.SetEditable(False) 207 self.Diametererr_tctr.SetBackgroundColour(_BACKGROUND_COLOR) 208 self.Diametererr_tctr.Show(self.yLabel == "ln(y*x)") 209 RgQmin_stxt = wx.StaticText(self, -1, 'Rg*Qmin') 210 self.RgQmin_tctr = wx.TextCtrl(self, -1, '') 211 self.RgQmin_tctr.SetEditable(False) 212 self.RgQmin_tctr.SetBackgroundColour(_BACKGROUND_COLOR) 213 RgQmax_stxt = wx.StaticText(self, -1, 'Rg*Qmax') 214 self.RgQmax_tctr = wx.TextCtrl(self, -1, '') 215 self.RgQmax_tctr.SetEditable(False) 216 self.RgQmax_tctr.SetBackgroundColour(_BACKGROUND_COLOR) 217 218 #sizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0) 219 iy += 2 220 ix = 0 221 sizer.Add(I0_stxt, (iy, ix),(1,1), 222 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 223 ix += 1 224 sizer.Add(self.I0_tctr, (iy, ix), (1,1), 225 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 226 227 ix += 2 228 sizer.Add(self.I0err_tctr, (iy, ix), (1,1), 229 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 230 231 iy += 1 232 ix = 0 233 sizer.Add(Rg_stxt, (iy, ix),(1,1), 234 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 235 ix += 1 236 sizer.Add(self.Rg_tctr, (iy, ix), (1,1), 237 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 238 239 ix += 2 240 sizer.Add(self.Rgerr_tctr, (iy, ix), (1,1), 241 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 242 iy += 1 243 ix = 0 244 sizer.Add(Diameter_stxt, (iy, ix),(1,1), 245 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 246 ix += 1 247 sizer.Add(self.Diameter_tctr, (iy, ix), (1,1), 248 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 249 250 ix += 2 251 sizer.Add(self.Diametererr_tctr, (iy, ix), (1,1), 252 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 253 iy += 1 254 ix = 0 255 sizer.Add(RgQmin_stxt, (iy, ix),(1,1), 256 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 257 ix += 1 258 sizer.Add(self.RgQmin_tctr, (iy, ix), (1,1), 259 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 260 iy += 1 261 ix = 0 262 sizer.Add(RgQmax_stxt, (iy, ix),(1,1), 263 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 264 ix += 1 265 sizer.Add(self.RgQmax_tctr, (iy, ix), (1,1), 266 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 267 170 268 iy += 1 171 269 ix = 1 … … 393 491 Display the value on fit Dialog 394 492 """ 493 rg = None 395 494 self.tcA.SetValue(format_number(cstA)) 396 495 self.tcB.SetValue(format_number(cstB)) … … 398 497 self.tcErrB.SetValue(format_number(errB)) 399 498 self.tcChi.SetValue(format_number(Chi)) 400 499 if self.rg_on: 500 if self.Rg_tctr.IsShown(): 501 rg = numpy.sqrt(-3 * float(cstA)) 502 value = format_number(rg) 503 self.Rg_tctr.SetValue(value) 504 if self.I0_tctr.IsShown(): 505 val = numpy.exp(cstB) 506 self.I0_tctr.SetValue(format_number(val)) 507 if self.Rgerr_tctr.IsShown(): 508 if rg != None and rg != 0: 509 value = format_number(3 * float(cstA) / (2 * rg)) 510 else: 511 value ='' 512 self.Rgerr_tctr.SetValue(value) 513 if self.I0err_tctr.IsShown(): 514 val = numpy.abs(numpy.exp(cstB) - numpy.exp(cstB + errB)) 515 self.I0err_tctr.SetValue(format_number(val)) 516 if self.Diameter_tctr.IsShown(): 517 rg = 4 * numpy.sqrt(-float(cstA)) 518 value = format_number(rg) 519 self.Diameter_tctr.SetValue(value) 520 if self.Diametererr_tctr.IsShown(): 521 if rg != None and rg != 0: 522 value = format_number(8 * float(cstA) / rg) 523 else: 524 value ='' 525 self.Diametererr_tctr.SetValue(value) 526 if self.RgQmin_tctr.IsShown(): 527 value = format_number(rg * self.mini) 528 self.RgQmin_tctr.SetValue(value) 529 if self.RgQmax_tctr.IsShown(): 530 value = format_number(rg * self.maxi) 531 self.RgQmax_tctr.SetValue(value) 532 401 533 def _ongetValues(self): 402 534 """
Note: See TracChangeset
for help on using the changeset viewer.