Changeset 5eb9154 in sasview for sansmodels/src/sans/models/c_models/CCoreShellCylinderModel.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/CCoreShellCylinderModel.cpp
r870f131 r5eb9154 390 390 } 391 391 } 392 393 392 /** 394 * Function to call to evaluate model in cartesian coordinates 395 * @param args: input q or [qx, qy]] 396 * @return: function value 393 * Function to call to calculate_ER 394 * @return: effective radius value 397 395 */ 398 static PyObject * runXY(CCoreShellCylinderModel *self, PyObject *args) {399 double qx_value, qy_value; 396 static PyObject * calculate_ER(CCoreShellCylinderModel *self) { 397 400 398 PyObject* pars; 401 399 int npars; … … 428 426 self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict); 429 427 428 429 return Py_BuildValue("d",(*(self->model)).calculate_ER()); 430 431 } 432 /** 433 * Function to call to evaluate model in cartesian coordinates 434 * @param args: input q or [qx, qy]] 435 * @return: function value 436 */ 437 static PyObject * runXY(CCoreShellCylinderModel *self, PyObject *args) { 438 double qx_value, qy_value; 439 PyObject* pars; 440 int npars; 441 442 // Get parameters 443 444 // Reader parameter dictionary 445 self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") ); 446 self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") ); 447 self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") ); 448 self->model->thickness = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thickness") ); 449 self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") ); 450 self->model->length = PyFloat_AsDouble( PyDict_GetItemString(self->params, "length") ); 451 self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") ); 452 self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") ); 453 self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 454 self->model->shell_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "shell_sld") ); 455 // Read in dispersion parameters 456 PyObject* disp_dict; 457 DispersionVisitor* visitor = new DispersionVisitor(); 458 disp_dict = PyDict_GetItemString(self->dispersion, "radius"); 459 self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict); 460 disp_dict = PyDict_GetItemString(self->dispersion, "thickness"); 461 self->model->thickness.dispersion->accept_as_destination(visitor, self->model->thickness.dispersion, disp_dict); 462 disp_dict = PyDict_GetItemString(self->dispersion, "length"); 463 self->model->length.dispersion->accept_as_destination(visitor, self->model->length.dispersion, disp_dict); 464 disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta"); 465 self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict); 466 disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi"); 467 self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict); 468 430 469 431 470 // Get input and determine whether we have to supply a 1D or 2D return value. … … 511 550 {"runXY", (PyCFunction)runXY , METH_VARARGS, 512 551 "Evaluate the model at a given Q or Qx, Qy"}, 552 {"calculate_ER", (PyCFunction)calculate_ER , METH_VARARGS, 553 "Evaluate the model at a given Q or Q, phi"}, 513 554 514 555 {"evalDistribution", (PyCFunction)evalDistribution , METH_VARARGS,
Note: See TracChangeset
for help on using the changeset viewer.