Changeset 74755ff in sasview for theoryview/perspectives/theory/model_thread.py
- Timestamp:
- Jun 2, 2010 10:17:18 AM (14 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:
- 6c79243
- Parents:
- a45622a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
theoryview/perspectives/theory/model_thread.py
r64017a8 r74755ff 6 6 class Calc2D(CalcThread): 7 7 """ 8 Compute 2D model 9 This calculation assumes a 2-fold symmetry of the model 10 where points are computed for one half of the detector 11 and I(qx, qy) = I(-qx, -qy) is assumed. 8 Compute 2D model 9 This calculation assumes a 2-fold symmetry of the model 10 where points are computed for one half of the detector 11 and I(qx, qy) = I(-qx, -qy) is assumed. 12 12 13 """ 13 14 … … 34 35 def compute(self): 35 36 """ 36 Compute the data given a model function 37 Compute the data given a model function 38 37 39 """ 38 40 self.starttime = time.time() … … 105 107 qstep = self.qstep ) 106 108 107 108 109 110 109 class Calc1D(CalcThread): 111 """Compute 1D data""" 110 """ 111 Compute 1D data 112 113 """ 112 114 113 115 def __init__(self, x, model, … … 135 137 def compute(self): 136 138 """ 137 Compute model 1d value given qmin , qmax , x value 139 Compute model 1d value given qmin , qmax , x value 140 138 141 """ 139 142 … … 154 157 self.complete(x= self.x[index], y= output[index], 155 158 elapsed=elapsed, model= self.model, data=self.data) 156 157 158 159 """ 160 Example of use of Calc2D :: 161 159 162 class CalcCommandline: 163 160 164 def __init__(self, n=20000): 161 165 #print thread.get_ident() … … 163 167 164 168 model = CylinderModel() 165 166 167 169 print model.runXY([0.01, 0.02]) 168 170 … … 173 175 x = numpy.arange(-qmax, qmax+qstep*0.01, qstep) 174 176 y = numpy.arange(-qmax, qmax+qstep*0.01, qstep) 175 176 177 177 178 calc_thread_2D = Calc2D(x, y, None, model.clone(),-qmax, qmax,qstep, … … 196 197 CalcCommandline() 197 198 199 """ 200
Note: See TracChangeset
for help on using the changeset viewer.