Changeset 5eb9154 in sasview for sansmodels/src/sans/models/c_models/CVesicleModel.cpp
- Timestamp:
- Aug 31, 2009 5:25:44 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:
- 5be36bb
- Parents:
- 572beba
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/c_models/CVesicleModel.cpp
re2afadf r5eb9154 357 357 } 358 358 } 359 360 /** 361 * Function to call to evaluate model in cartesian coordinates 362 * @param args: input q or [qx, qy]] 363 * @return: function value 364 */ 365 static PyObject * runXY(CVesicleModel *self, PyObject *args) { 366 double qx_value, qy_value; 359 /** 360 * Function to call to calculate_ER 361 * @return: effective radius value 362 */ 363 static PyObject * calculate_ER(CVesicleModel *self) { 364 367 365 PyObject* pars; 368 366 int npars; … … 385 383 self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict); 386 384 385 386 return Py_BuildValue("d",(*(self->model)).calculate_ER()); 387 388 } 389 /** 390 * Function to call to evaluate model in cartesian coordinates 391 * @param args: input q or [qx, qy]] 392 * @return: function value 393 */ 394 static PyObject * runXY(CVesicleModel *self, PyObject *args) { 395 double qx_value, qy_value; 396 PyObject* pars; 397 int npars; 398 399 // Get parameters 400 401 // Reader parameter dictionary 402 self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") ); 403 self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") ); 404 self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") ); 405 self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") ); 406 self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 407 self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") ); 408 // Read in dispersion parameters 409 PyObject* disp_dict; 410 DispersionVisitor* visitor = new DispersionVisitor(); 411 disp_dict = PyDict_GetItemString(self->dispersion, "radius"); 412 self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict); 413 disp_dict = PyDict_GetItemString(self->dispersion, "thickness"); 414 self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict); 415 387 416 388 417 // Get input and determine whether we have to supply a 1D or 2D return value. … … 462 491 {"runXY", (PyCFunction)runXY , METH_VARARGS, 463 492 "Evaluate the model at a given Q or Qx, Qy"}, 493 {"calculate_ER", (PyCFunction)calculate_ER , METH_VARARGS, 494 "Evaluate the model at a given Q or Q, phi"}, 464 495 465 496 {"evalDistribution", (PyCFunction)evalDistribution , METH_VARARGS,
Note: See TracChangeset
for help on using the changeset viewer.