Changeset e2afadf in sasview for sansmodels/src/sans/models
- Timestamp:
- Aug 25, 2009 3:31:36 PM (15 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:
- ff85cc5
- Parents:
- c8727c5
- Location:
- sansmodels/src/sans/models
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/HollowCylinderModel.py
r9bd69098 re2afadf 34 34 scale = 1.0 35 35 core_radius = 20.0 [A] 36 shell_radius= 30.0 [A]36 radius = 30.0 [A] 37 37 length = 400.0 [A] 38 38 contrast = 5.3e-006 [1/A²] … … 59 59 self.details['scale'] = ['', None, None] 60 60 self.details['core_radius'] = ['[A]', None, None] 61 self.details[' shell_radius'] = ['[A]', None, None]61 self.details['radius'] = ['[A]', None, None] 62 62 self.details['length'] = ['[A]', None, None] 63 63 self.details['contrast'] = ['[1/A²]', None, None] … … 67 67 68 68 ## fittable parameters 69 self.fixed=['axis_phi.width', 'axis_theta.width', 'length.width', 'core_radius.width', ' shell_radius']69 self.fixed=['axis_phi.width', 'axis_theta.width', 'length.width', 'core_radius.width', 'radius'] 70 70 71 71 ## parameters with orientation -
sansmodels/src/sans/models/VesicleModel.py
r870f131 re2afadf 33 33 List of default parameters: 34 34 scale = 1.0 35 core_radius= 100.0 [A]35 radius = 100.0 [A] 36 36 thickness = 30.0 [A] 37 37 core_sld = 6.36e-006 [1/A²] … … 51 51 self.name = "VesicleModel" 52 52 ## Model description 53 self.description ="""Model parameters: core_radius : Core radius of the vesicle53 self.description ="""Model parameters: radius : core radius of the vesicle 54 54 thickness: shell thickness 55 55 core_sld: core scattering length density … … 61 61 self.details = {} 62 62 self.details['scale'] = ['', None, None] 63 self.details[' core_radius'] = ['[A]', None, None]63 self.details['radius'] = ['[A]', None, None] 64 64 self.details['thickness'] = ['[A]', None, None] 65 65 self.details['core_sld'] = ['[1/A²]', None, None] … … 68 68 69 69 ## fittable parameters 70 self.fixed=[' core_radius.width', 'thickness.width']70 self.fixed=['radius.width', 'thickness.width'] 71 71 72 72 ## parameters with orientation -
sansmodels/src/sans/models/c_extensions/hollow_cylinder.c
r27fea3f re2afadf 18 18 double hollow_cylinder_analytical_1D(HollowCylinderParameters *pars, double q) { 19 19 double dp[6]; 20 20 21 21 dp[0] = pars->scale; 22 22 dp[1] = pars->core_radius; 23 dp[2] = pars-> shell_radius;23 dp[2] = pars->radius; 24 24 dp[3] = pars->length; 25 25 dp[4] = pars->contrast; 26 26 dp[5] = pars->background; 27 27 28 28 return HollowCylinder(dp, q); 29 29 } 30 30 31 31 /** 32 32 * Function to evaluate 2D scattering function … … 39 39 q = sqrt(qx*qx+qy*qy); 40 40 return hollow_cylinder_analytical_2D_scaled(pars, q, qx/q, qy/q); 41 } 41 } 42 42 43 43 /** … … 50 50 double hollow_cylinder_analytical_2D(HollowCylinderParameters *pars, double q, double phi) { 51 51 return hollow_cylinder_analytical_2D_scaled(pars, q, cos(phi), sin(phi)); 52 } 52 } 53 53 54 54 /** … … 65 65 double alpha,vol, cos_val; 66 66 double answer; 67 67 68 68 // Cylinder orientation 69 69 cyl_x = sin(pars->axis_theta) * cos(pars->axis_phi); 70 70 cyl_y = sin(pars->axis_theta) * sin(pars->axis_phi); 71 71 cyl_z = cos(pars->axis_theta); 72 72 73 73 // q vector 74 74 q_z = 0; 75 75 76 76 // Compute the angle btw vector q and the 77 77 // axis of the cylinder 78 78 cos_val = cyl_x*q_x + cyl_y*q_y + cyl_z*q_z; 79 79 80 80 // The following test should always pass 81 81 if (fabs(cos_val)>1.0) { … … 83 83 return 0; 84 84 } 85 85 86 86 alpha = acos( cos_val ); 87 87 88 88 // Call the IGOR library function to get the kernel 89 answer = HolCylKernel(q, pars->core_radius, pars-> shell_radius, pars->length, cos_val);90 89 answer = HolCylKernel(q, pars->core_radius, pars->radius, pars->length, cos_val); 90 91 91 //normalize by cylinder volume 92 vol=acos(-1.0)*((pars->core_radius *pars->core_radius)-(pars-> shell_radius*pars->shell_radius))92 vol=acos(-1.0)*((pars->core_radius *pars->core_radius)-(pars->radius*pars->radius)) 93 93 *(pars->length); 94 94 answer /= vol; 95 95 96 96 //convert to [cm-1] 97 97 answer *= 1.0e8; 98 98 99 99 //Scale 100 100 answer *= pars->scale; 101 101 102 102 // add in the background 103 103 answer += pars->background; 104 104 105 105 return answer; 106 106 } -
sansmodels/src/sans/models/c_extensions/hollow_cylinder.h
r27fea3f re2afadf 6 6 */ 7 7 //[PYTHONCLASS] = HollowCylinderModel 8 //[DISP_PARAMS] = core_radius, shell_radius, length, axis_theta, axis_phi8 //[DISP_PARAMS] = core_radius, radius, length, axis_theta, axis_phi 9 9 //[DESCRIPTION] = <text></text> 10 //[FIXED]= <text> axis_phi.width; axis_theta.width; length.width;core_radius.width; shell_radius</text>10 //[FIXED]= <text> axis_phi.width; axis_theta.width; length.width;core_radius.width; radius</text> 11 11 //[ORIENTATION_PARAMS]= axis_phi; axis_theta;axis_phi.width; axis_theta.width 12 12 … … 22 22 23 23 /// Shell radius [A] 24 // [DEFAULT]= shell_radius=30.0 [A]25 double shell_radius;24 // [DEFAULT]=radius=30.0 [A] 25 double radius; 26 26 27 27 /// Hollow cylinder length [A] -
sansmodels/src/sans/models/c_extensions/vesicle.c
r3d25331f re2afadf 17 17 double vesicle_analytical_1D(VesicleParameters *pars, double q) { 18 18 double dp[6]; 19 19 20 20 dp[0] = pars->scale; 21 dp[1] = pars-> core_radius;21 dp[1] = pars->radius; 22 22 dp[2] = pars->thickness; 23 23 dp[3] = pars->core_sld; … … 25 25 dp[5] = pars->background; 26 26 27 27 28 28 return VesicleForm(dp, q); 29 29 } 30 30 31 31 /** 32 32 * Function to evaluate 2D scattering function … … 40 40 41 41 double vesicle_analytical_2DXY(VesicleParameters *pars, double qx, double qy){ 42 return vesicle_analytical_1D(pars,sqrt(qx*qx+qy*qy)); 42 return vesicle_analytical_1D(pars,sqrt(qx*qx+qy*qy)); 43 43 } -
sansmodels/src/sans/models/c_extensions/vesicle.h
r42f193a re2afadf 5 5 * Structure definition for vesicle parameters 6 6 [PYTHONCLASS] = VesicleModel 7 [DISP_PARAMS] = core_radius,thickness8 [DESCRIPTION] =<text>Model parameters: core_radius : Core radius of the vesicle7 [DISP_PARAMS] = radius,thickness 8 [DESCRIPTION] =<text>Model parameters: radius : core radius of the vesicle 9 9 thickness: shell thickness 10 10 core_sld: core scattering length density … … 13 13 scale : scale factor 14 14 </text> 15 [FIXED]= core_radius.width; thickness.width15 [FIXED]= radius.width; thickness.width 16 16 [ORIENTATION_PARAMS]= <text> </text> 17 17 */ … … 22 22 23 23 /// Core radius of the vesicle [A] 24 // [DEFAULT]= core_radius= 100.0 [A]25 double core_radius;24 // [DEFAULT]=radius= 100.0 [A] 25 double radius; 26 26 27 27 /// shell thickness [Å] -
sansmodels/src/sans/models/c_models/CHollowCylinderModel.cpp
r870f131 re2afadf 91 91 PyDict_SetItemString(self->params,"length",Py_BuildValue("d",400.000000)); 92 92 PyDict_SetItemString(self->params,"axis_phi",Py_BuildValue("d",0.000000)); 93 PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",30.000000)); 93 94 PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.010000)); 94 PyDict_SetItemString(self->params,"shell_radius",Py_BuildValue("d",30.000000));95 95 PyDict_SetItemString(self->params,"contrast",Py_BuildValue("d",0.000005)); 96 96 // Initialize dispersion / averaging parameter dict … … 101 101 PyDict_SetItemString(self->dispersion, "core_radius", disp_dict); 102 102 disp_dict = PyDict_New(); 103 self->model-> shell_radius.dispersion->accept_as_source(visitor, self->model->shell_radius.dispersion, disp_dict);104 PyDict_SetItemString(self->dispersion, " shell_radius", disp_dict);103 self->model->radius.dispersion->accept_as_source(visitor, self->model->radius.dispersion, disp_dict); 104 PyDict_SetItemString(self->dispersion, "radius", disp_dict); 105 105 disp_dict = PyDict_New(); 106 106 self->model->length.dispersion->accept_as_source(visitor, self->model->length.dispersion, disp_dict); … … 248 248 self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") ); 249 249 self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") ); 250 self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") ); 250 251 self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 251 self->model->shell_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_radius") );252 252 self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") ); 253 253 // Read in dispersion parameters … … 256 256 disp_dict = PyDict_GetItemString(self->dispersion, "core_radius"); 257 257 self->model->core_radius.dispersion->accept_as_destination(visitor, self->model->core_radius.dispersion, disp_dict); 258 disp_dict = PyDict_GetItemString(self->dispersion, " shell_radius");259 self->model-> shell_radius.dispersion->accept_as_destination(visitor, self->model->shell_radius.dispersion, disp_dict);258 disp_dict = PyDict_GetItemString(self->dispersion, "radius"); 259 self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict); 260 260 disp_dict = PyDict_GetItemString(self->dispersion, "length"); 261 261 self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict); … … 331 331 self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") ); 332 332 self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") ); 333 self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") ); 333 334 self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 334 self->model->shell_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_radius") );335 335 self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") ); 336 336 // Read in dispersion parameters … … 339 339 disp_dict = PyDict_GetItemString(self->dispersion, "core_radius"); 340 340 self->model->core_radius.dispersion->accept_as_destination(visitor, self->model->core_radius.dispersion, disp_dict); 341 disp_dict = PyDict_GetItemString(self->dispersion, " shell_radius");342 self->model-> shell_radius.dispersion->accept_as_destination(visitor, self->model->shell_radius.dispersion, disp_dict);341 disp_dict = PyDict_GetItemString(self->dispersion, "radius"); 342 self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict); 343 343 disp_dict = PyDict_GetItemString(self->dispersion, "length"); 344 344 self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict); … … 403 403 self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") ); 404 404 self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") ); 405 self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") ); 405 406 self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 406 self->model->shell_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_radius") );407 407 self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") ); 408 408 // Read in dispersion parameters … … 411 411 disp_dict = PyDict_GetItemString(self->dispersion, "core_radius"); 412 412 self->model->core_radius.dispersion->accept_as_destination(visitor, self->model->core_radius.dispersion, disp_dict); 413 disp_dict = PyDict_GetItemString(self->dispersion, " shell_radius");414 self->model-> shell_radius.dispersion->accept_as_destination(visitor, self->model->shell_radius.dispersion, disp_dict);413 disp_dict = PyDict_GetItemString(self->dispersion, "radius"); 414 self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict); 415 415 disp_dict = PyDict_GetItemString(self->dispersion, "length"); 416 416 self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict); … … 476 476 if (!strcmp(par_name, "core_radius")) { 477 477 self->model->core_radius.dispersion = dispersion; 478 } else if (!strcmp(par_name, " shell_radius")) {479 self->model-> shell_radius.dispersion = dispersion;478 } else if (!strcmp(par_name, "radius")) { 479 self->model->radius.dispersion = dispersion; 480 480 } else if (!strcmp(par_name, "length")) { 481 481 self->model->length.dispersion = dispersion; -
sansmodels/src/sans/models/c_models/CVesicleModel.cpp
r870f131 re2afadf 87 87 // Initialize parameter dictionary 88 88 PyDict_SetItemString(self->params,"core_sld",Py_BuildValue("d",0.000006)); 89 PyDict_SetItemString(self->params,"core_radius",Py_BuildValue("d",100.000000));90 89 PyDict_SetItemString(self->params,"thickness",Py_BuildValue("d",30.000000)); 91 90 PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000)); 91 PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",100.000000)); 92 92 PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000)); 93 93 PyDict_SetItemString(self->params,"shell_sld",Py_BuildValue("d",0.000000)); … … 96 96 PyObject * disp_dict; 97 97 disp_dict = PyDict_New(); 98 self->model-> core_radius.dispersion->accept_as_source(visitor, self->model->core_radius.dispersion, disp_dict);99 PyDict_SetItemString(self->dispersion, " core_radius", disp_dict);98 self->model->radius.dispersion->accept_as_source(visitor, self->model->radius.dispersion, disp_dict); 99 PyDict_SetItemString(self->dispersion, "radius", disp_dict); 100 100 disp_dict = PyDict_New(); 101 101 self->model->thickness.dispersion->accept_as_source(visitor, self->model->thickness.dispersion, disp_dict); … … 233 233 // Reader parameter dictionary 234 234 self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") ); 235 self->model->core_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_radius") );236 235 self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") ); 237 236 self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") ); 237 self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") ); 238 238 self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 239 239 self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") ); … … 241 241 PyObject* disp_dict; 242 242 DispersionVisitor* visitor = new DispersionVisitor(); 243 disp_dict = PyDict_GetItemString(self->dispersion, " core_radius");244 self->model-> core_radius.dispersion->accept_as_destination(visitor, self->model->core_radius.dispersion, disp_dict);243 disp_dict = PyDict_GetItemString(self->dispersion, "radius"); 244 self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict); 245 245 disp_dict = PyDict_GetItemString(self->dispersion, "thickness"); 246 246 self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict); … … 308 308 // Reader parameter dictionary 309 309 self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") ); 310 self->model->core_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_radius") );311 310 self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") ); 312 311 self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") ); 312 self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") ); 313 313 self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 314 314 self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") ); … … 316 316 PyObject* disp_dict; 317 317 DispersionVisitor* visitor = new DispersionVisitor(); 318 disp_dict = PyDict_GetItemString(self->dispersion, " core_radius");319 self->model-> core_radius.dispersion->accept_as_destination(visitor, self->model->core_radius.dispersion, disp_dict);318 disp_dict = PyDict_GetItemString(self->dispersion, "radius"); 319 self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict); 320 320 disp_dict = PyDict_GetItemString(self->dispersion, "thickness"); 321 321 self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict); … … 372 372 // Reader parameter dictionary 373 373 self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") ); 374 self->model->core_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_radius") );375 374 self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") ); 376 375 self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") ); 376 self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") ); 377 377 self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 378 378 self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") ); … … 380 380 PyObject* disp_dict; 381 381 DispersionVisitor* visitor = new DispersionVisitor(); 382 disp_dict = PyDict_GetItemString(self->dispersion, " core_radius");383 self->model-> core_radius.dispersion->accept_as_destination(visitor, self->model->core_radius.dispersion, disp_dict);382 disp_dict = PyDict_GetItemString(self->dispersion, "radius"); 383 self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict); 384 384 disp_dict = PyDict_GetItemString(self->dispersion, "thickness"); 385 385 self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict); … … 439 439 // Ugliness necessary to go from python to C 440 440 // TODO: refactor this 441 if (!strcmp(par_name, " core_radius")) {442 self->model-> core_radius.dispersion = dispersion;441 if (!strcmp(par_name, "radius")) { 442 self->model->radius.dispersion = dispersion; 443 443 } else if (!strcmp(par_name, "thickness")) { 444 444 self->model->thickness.dispersion = dispersion; -
sansmodels/src/sans/models/c_models/hollowcylinder.cpp
r9188cc1 re2afadf 36 36 core_radius = Parameter(20.0, true); 37 37 core_radius.set_min(0.0); 38 shell_radius = Parameter(30.0, true);39 shell_radius.set_min(0.0);38 radius = Parameter(30.0, true); 39 radius.set_min(0.0); 40 40 length = Parameter(400.0, true); 41 41 length.set_min(0.0); … … 57 57 dp[0] = scale(); 58 58 dp[1] = core_radius(); 59 dp[2] = shell_radius();59 dp[2] = radius(); 60 60 dp[3] = length(); 61 61 dp[4] = contrast(); … … 67 67 68 68 // Get the dispersion points for the shell radius 69 vector<WeightPoint> weights_ shell_radius;70 shell_radius.get_weights(weights_shell_radius);69 vector<WeightPoint> weights_radius; 70 radius.get_weights(weights_radius); 71 71 72 72 // Get the dispersion points for the length … … 87 87 88 88 // Loop over shell radius weight points 89 for(int k=0; k< (int)weights_ shell_radius.size(); k++) {90 dp[2] = weights_ shell_radius[k].value;89 for(int k=0; k< (int)weights_radius.size(); k++) { 90 dp[2] = weights_radius[k].value; 91 91 92 92 sum += weights_core_radius[i].weight 93 93 * weights_length[j].weight 94 * weights_ shell_radius[k].weight94 * weights_radius[k].weight 95 95 * HollowCylinder(dp, q); 96 96 norm += weights_core_radius[i].weight 97 97 * weights_length[j].weight 98 * weights_ shell_radius[k].weight;98 * weights_radius[k].weight; 99 99 } 100 100 } … … 114 114 dp.scale = scale(); 115 115 dp.core_radius = core_radius(); 116 dp. shell_radius = shell_radius();116 dp.radius = radius(); 117 117 dp.length = length(); 118 118 dp.contrast = contrast(); … … 126 126 127 127 // Get the dispersion points for the shell radius 128 vector<WeightPoint> weights_ shell_radius;129 shell_radius.get_weights(weights_shell_radius);128 vector<WeightPoint> weights_radius; 129 radius.get_weights(weights_radius); 130 130 131 131 // Get the dispersion points for the length … … 155 155 156 156 // Loop over shell radius weight points 157 for(int m=0; m< (int)weights_ shell_radius.size(); m++) {158 dp. shell_radius = weights_shell_radius[m].value;157 for(int m=0; m< (int)weights_radius.size(); m++) { 158 dp.radius = weights_radius[m].value; 159 159 160 160 // Average over theta distribution … … 168 168 double _ptvalue = weights_core_radius[i].weight 169 169 * weights_length[j].weight 170 * weights_ shell_radius[m].weight170 * weights_radius[m].weight 171 171 * weights_theta[k].weight 172 172 * weights_phi[l].weight … … 179 179 norm += weights_core_radius[i].weight 180 180 * weights_length[j].weight 181 * weights_ shell_radius[m].weight181 * weights_radius[m].weight 182 182 * weights_theta[k].weight 183 183 * weights_phi[l].weight; -
sansmodels/src/sans/models/c_models/models.hh
rc1c29b6 re2afadf 494 494 Parameter scale; 495 495 Parameter core_radius; 496 Parameter shell_radius;496 Parameter radius; 497 497 Parameter length; 498 498 Parameter contrast; … … 535 535 // Model parameters 536 536 Parameter scale; 537 Parameter core_radius;537 Parameter radius; 538 538 Parameter thickness; 539 539 Parameter core_sld; -
sansmodels/src/sans/models/c_models/vesicle.cpp
r9188cc1 re2afadf 32 32 VesicleModel :: VesicleModel() { 33 33 scale = Parameter(1.0); 34 core_radius = Parameter(100.0, true);35 core_radius.set_min(0.0);34 radius = Parameter(100.0, true); 35 radius.set_min(0.0); 36 36 thickness = Parameter(30.0, true); 37 37 thickness.set_min(0.0); … … 53 53 // Add the background after averaging 54 54 dp[0] = scale(); 55 dp[1] = core_radius();55 dp[1] = radius(); 56 56 dp[2] = thickness(); 57 57 dp[3] = core_sld(); … … 61 61 62 62 // Get the dispersion points for the core radius 63 vector<WeightPoint> weights_ core_radius;64 core_radius.get_weights(weights_core_radius);63 vector<WeightPoint> weights_radius; 64 radius.get_weights(weights_radius); 65 65 // Get the dispersion points for the thickness 66 66 vector<WeightPoint> weights_thickness; … … 72 72 73 73 // Loop over radius weight points 74 for(int i=0; i< (int)weights_ core_radius.size(); i++) {75 dp[1] = weights_ core_radius[i].value;76 for(int j=0; j< (int)weights_ core_radius.size(); j++) {74 for(int i=0; i< (int)weights_radius.size(); i++) { 75 dp[1] = weights_radius[i].value; 76 for(int j=0; j< (int)weights_thickness.size(); j++) { 77 77 dp[2] = weights_thickness[j].value; 78 sum += weights_ core_radius[i].weight78 sum += weights_radius[i].weight 79 79 * weights_thickness[j].weight * VesicleForm(dp, q); 80 norm += weights_ core_radius[i].weight * weights_thickness[j].weight;80 norm += weights_radius[i].weight * weights_thickness[j].weight; 81 81 } 82 82 }
Note: See TracChangeset
for help on using the changeset viewer.