Changeset 5eb9154 in sasview for sansmodels/src/sans/models/c_models/CStackedDisksModel.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/CStackedDisksModel.cpp
r870f131 r5eb9154 396 396 } 397 397 } 398 399 398 /** 400 * Function to call to evaluate model in cartesian coordinates 401 * @param args: input q or [qx, qy]] 402 * @return: function value 399 * Function to call to calculate_ER 400 * @return: effective radius value 403 401 */ 404 static PyObject * runXY(CStackedDisksModel *self, PyObject *args) {405 double qx_value, qy_value; 402 static PyObject * calculate_ER(CStackedDisksModel *self) { 403 406 404 PyObject* pars; 407 405 int npars; … … 436 434 self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict); 437 435 436 437 return Py_BuildValue("d",(*(self->model)).calculate_ER()); 438 439 } 440 /** 441 * Function to call to evaluate model in cartesian coordinates 442 * @param args: input q or [qx, qy]] 443 * @return: function value 444 */ 445 static PyObject * runXY(CStackedDisksModel *self, PyObject *args) { 446 double qx_value, qy_value; 447 PyObject* pars; 448 int npars; 449 450 // Get parameters 451 452 // Reader parameter dictionary 453 self->model->core_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_sld") ); 454 self->model->core_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "core_thick") ); 455 self->model->layer_thick = PyFloat_AsDouble( PyDict_GetItemString(self->params, "layer_thick") ); 456 self->model->axis_theta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_theta") ); 457 self->model->layer_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "layer_sld") ); 458 self->model->axis_phi = PyFloat_AsDouble( PyDict_GetItemString(self->params, "axis_phi") ); 459 self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") ); 460 self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") ); 461 self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") ); 462 self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 463 self->model->sigma_d = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sigma_d") ); 464 self->model->n_stacking = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_stacking") ); 465 // Read in dispersion parameters 466 PyObject* disp_dict; 467 DispersionVisitor* visitor = new DispersionVisitor(); 468 disp_dict = PyDict_GetItemString(self->dispersion, "core_thick"); 469 self->model->core_thick.dispersion->accept_as_destination(visitor, self->model->core_thick.dispersion, disp_dict); 470 disp_dict = PyDict_GetItemString(self->dispersion, "layer_thick"); 471 self->model->layer_thick.dispersion->accept_as_destination(visitor, self->model->layer_thick.dispersion, disp_dict); 472 disp_dict = PyDict_GetItemString(self->dispersion, "radius"); 473 self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict); 474 disp_dict = PyDict_GetItemString(self->dispersion, "axis_theta"); 475 self->model->axis_theta.dispersion->accept_as_destination(visitor, self->model->axis_theta.dispersion, disp_dict); 476 disp_dict = PyDict_GetItemString(self->dispersion, "axis_phi"); 477 self->model->axis_phi.dispersion->accept_as_destination(visitor, self->model->axis_phi.dispersion, disp_dict); 478 438 479 439 480 // Get input and determine whether we have to supply a 1D or 2D return value. … … 519 560 {"runXY", (PyCFunction)runXY , METH_VARARGS, 520 561 "Evaluate the model at a given Q or Qx, Qy"}, 562 {"calculate_ER", (PyCFunction)calculate_ER , METH_VARARGS, 563 "Evaluate the model at a given Q or Q, phi"}, 521 564 522 565 {"evalDistribution", (PyCFunction)evalDistribution , METH_VARARGS,
Note: See TracChangeset
for help on using the changeset viewer.