Changeset 0550752 in sasview
- Timestamp:
- Nov 7, 2008 11:50:03 AM (16 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:
- 1f62278
- Parents:
- 35d1092
- Location:
- sansview
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/bugs.txt
rd171299 r0550752 11 11 5- plot data2D theory not working for all models 12 12 ---->bugs[5] fixed 13 --------------------------------------------------------------------------------- 14 1. close button does not show up properly when selecting model. 15 static text is showing when randomly when slecting the model to fit for the first time 16 17 2. -
sansview/perspectives/fitting/fitpage1D.py
r04edd0d r0550752 65 65 66 66 self.vbox.Add(self.sizer3) 67 67 68 self.vbox.Add(self.sizer2) 68 69 self.vbox.Add(self.static_line_1, 0, wx.EXPAND, 0) 69 70 self.vbox.Add(self.sizer5) 71 70 72 self.vbox.Add(self.sizer4) 71 73 self.vbox.Add(self.sizer1) … … 89 91 ix += 1 90 92 self.sizer3.Add(self.modelbox,(iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 93 91 94 ix = 0 92 95 iy = 1 93 96 #set maximum range for x in linear scale 94 self.text4_3 = wx.StaticText(self, -1, 'Maximum Data \n Range(Linear)', style=wx.ALIGN_LEFT)97 self.text4_3 = wx.StaticText(self, -1, 'Maximum Data Range(Linear)', style=wx.ALIGN_LEFT) 95 98 self.sizer4.Add(self.text4_3,(iy,ix),(1,1),\ 96 99 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 97 100 ix += 1 98 self.text4_1 = wx.StaticText(self, -1, 'Min') 99 self.sizer4.Add(self.text4_1,(iy, ix),(1,1),\ 101 self.sizer4.Add(wx.StaticText(self, -1, 'Min'),(iy, ix),(1,1),\ 100 102 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 101 103 ix += 2 102 self.text4_2 = wx.StaticText(self, -1, 'Max') 103 self.sizer4.Add(self.text4_2,(iy, ix),(1,1),\ 104 self.sizer4.Add(wx.StaticText(self, -1, 'Max'),(iy, ix),(1,1),\ 104 105 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 105 106 ix = 0 106 107 iy += 1 107 self.text4_4 = wx.StaticText(self, -1, 'x range') 108 self.sizer4.Add(self.text4_4,(iy, ix),(1,1),\ 108 self.sizer4.Add(wx.StaticText(self, -1, 'x range'),(iy, ix),(1,1),\ 109 109 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 110 110 ix += 1 … … 112 112 self.xmin.SetValue(format_number(numpy.min(data.x))) 113 113 self.xmin.SetToolTipString("Minimun value of x in linear scale.") 114 self.sizer4.Add(self.xmin,(iy, ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0)115 114 self.xmin.Bind(wx.EVT_KILL_FOCUS, self._onTextEnter) 116 115 self.xmin.Bind(wx.EVT_TEXT_ENTER, self._onTextEnter) 117 116 self.xmin.Disable() 117 self.sizer4.Add(self.xmin,(iy, ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 118 119 118 120 ix += 2 119 121 self.xmax = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20)) 120 122 self.xmax.SetValue(format_number(numpy.max(data.x))) 121 123 self.xmax.SetToolTipString("Maximum value of x in linear scale.") 122 self.sizer4.Add(self.xmax,(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0)123 124 self.xmax.Bind(wx.EVT_KILL_FOCUS, self._onTextEnter) 124 125 self.xmax.Bind(wx.EVT_TEXT_ENTER, self._onTextEnter) 125 126 self.xmax.Disable() 127 self.sizer4.Add(self.xmax,(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 128 ix =0 126 129 iy+=1 127 self.sizer4.Add((20,20),(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0)130 self.sizer4.Add((20,20),(iy,ix),(1,1),wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 128 131 #Set chisqr result into TextCtrl 129 132 ix = 0 130 133 iy = 1 131 134 self.smear= wx.CheckBox(self, -1, "Smear", (10, 10)) 135 self.sizer1.Add(self.smear,(iy,ix),(1,1),\ 136 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 137 iy+=1 132 138 self.text1_1 = wx.StaticText(self, -1, 'Chi2/dof', style=wx.ALIGN_LEFT) 133 139 #self.sizer1.Add(self.text1_1,1) … … 142 148 #self.sizer1.Add(self.btFit, 1, wx.LEFT | wx.BOTTOM , 5) 143 149 self.sizer1.Add(self.btFit,(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 144 ix+= 1150 ix+= 2 145 151 self.sizer1.Add( self.btClose,(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) 146 152 #self.sizer1.Add( self.btClose,1, wx.LEFT | wx.BOTTOM , 5) 147 153 148 ix= 1154 ix= 0 149 155 iy+=1 150 156 self.sizer1.Add((20,20),(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 0) … … 464 470 self.set_model_parameter() 465 471 self.compute_chisqr() 472 466 473 467 474 def set_model_parameter(self): … … 473 480 for item in self.parameters: 474 481 try: 475 482 item[2].Hide() 483 item[3].Clear() 484 item[3].Hide() 476 485 name=str(item[0].GetLabelText()) 477 486 value= float(item[1].GetValue()) -
sansview/perspectives/fitting/fitting.py
r57668f8 r0550752 1 1 import os,os.path, re 2 2 import sys, wx, logging 3 import string, numpy, 3 import string, numpy, math 4 4 5 5 from copy import deepcopy … … 578 578 draw model with default data value 579 579 """ 580 x = pylab.arange(0.001, 0.1, 0.001)580 x = numpy.arange(0.001, 0.1, 0.001) 581 581 xlen = len(x) 582 dy = numpy.zeros(xlen)583 582 y = numpy.zeros(xlen) 584 583 585 584 for i in range(xlen): 586 585 y[i] = model.run(x[i]) 587 dy[i] = math.sqrt(math.fabs(y[i])) 586 588 587 try: 589 588 new_plot = Theory1D(x, y) … … 591 590 new_plot.xaxis("\\rm{Q}", 'A^{-1}') 592 591 new_plot.yaxis("\\rm{Intensity} ","cm^{-1}") 592 593 593 new_plot.group_id ="Fitness" 594 594 wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title="Analytical model"))
Note: See TracChangeset
for help on using the changeset viewer.