Changeset e9b4cc4 in sasview for sansview/perspectives/fitting/model_thread.py
- Timestamp:
- Jan 15, 2009 5:39:19 PM (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:
- 633ba04
- Parents:
- 681f0dc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/model_thread.py
rd15c0202 re9b4cc4 109 109 self.model = model 110 110 self.starttime = 0 111 111 112 112 113 def isquit(self): … … 120 121 raise KeyboardInterrupt 121 122 123 def update(self, output=None, time=None): 124 125 wx.PostEvent(self.parent, StatusEvent(status="Plot \ 126 updating ... %g sec" % time)) 127 122 128 def compute(self): 123 129 import numpy … … 125 131 y = self.y 126 132 output = numpy.zeros((len(x),len(y))) 127 """ 128 if self.qmin *self.qmax >=0: 129 print "same signe plotting" 130 if self.qmax==0: 131 center_x= self.qmin/2 132 center_y= self.qmin /2 133 else: 134 center_x= (self.qmax -self.qmin)/2 135 center_y= (self.qmax -self.qmin)/2 136 else: 137 """ 133 138 134 center_x=0 139 135 center_y=0 140 #print "center_x , center_y",center_x , center_y 141 #print "x ",len(x) 142 #print "y", y 143 #print "int(len(self.x)/2)",int(len(self.x)/2) 136 144 137 self.starttime = time.time() 138 wx.PostEvent(self.parent, StatusEvent(status=\ 139 "Start Drawing model %g " % self.starttime)) 145 140 lx = len(self.x) 146 141 147 142 for i_x in range(len(self.x)): 148 149 # Check whether we need to bail out 150 self.update(output=output) 143 # Check whether we need to bail out 144 self.update(output=output, time=time.time() ) 151 145 self.isquit() 152 146 … … 154 148 try: 155 149 if (self.x[i_x]*self.x[i_x]+self.y[i_y]*self.y[i_y]) \ 156 < self.qmin * self.qmin:157 output[i_x] [i_y]=0158 150 < self.qmin * self.qmin: 151 152 output[i_x] [i_y]=0 159 153 else: 160 value1 = self.model.runXY([self.x[i_x]-center_x, self.y[i_y]-center_y]) 161 162 163 output[i_x] [i_y]=value1 164 165 154 value = self.model.runXY([self.x[i_x]-center_x, self.y[i_y]-center_y]) 155 output[i_x] [i_y]=value 166 156 except: 167 157 wx.PostEvent(self.parent, StatusEvent(status=\
Note: See TracChangeset
for help on using the changeset viewer.