Changeset 5eb9154 in sasview for sansmodels/src/sans/models/c_models/CBinaryHSPSF11Model.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/CBinaryHSPSF11Model.cpp
r870f131 r5eb9154 363 363 } 364 364 } 365 366 /** 367 * Function to call to evaluate model in cartesian coordinates 368 * @param args: input q or [qx, qy]] 369 * @return: function value 370 */ 371 static PyObject * runXY(CBinaryHSPSF11Model *self, PyObject *args) { 372 double qx_value, qy_value; 365 /** 366 * Function to call to calculate_ER 367 * @return: effective radius value 368 */ 369 static PyObject * calculate_ER(CBinaryHSPSF11Model *self) { 370 373 371 PyObject* pars; 374 372 int npars; … … 393 391 self->model->s_radius.dispersion->accept_as_destination(visitor, self->model->s_radius.dispersion, disp_dict); 394 392 393 394 return Py_BuildValue("d",(*(self->model)).calculate_ER()); 395 396 } 397 /** 398 * Function to call to evaluate model in cartesian coordinates 399 * @param args: input q or [qx, qy]] 400 * @return: function value 401 */ 402 static PyObject * runXY(CBinaryHSPSF11Model *self, PyObject *args) { 403 double qx_value, qy_value; 404 PyObject* pars; 405 int npars; 406 407 // Get parameters 408 409 // Reader parameter dictionary 410 self->model->vol_frac_ls = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ls") ); 411 self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 412 self->model->vol_frac_ss = PyFloat_AsDouble( PyDict_GetItemString(self->params, "vol_frac_ss") ); 413 self->model->solvent_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "solvent_sld") ); 414 self->model->ls_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ls_sld") ); 415 self->model->ss_sld = PyFloat_AsDouble( PyDict_GetItemString(self->params, "ss_sld") ); 416 self->model->s_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "s_radius") ); 417 self->model->l_radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "l_radius") ); 418 // Read in dispersion parameters 419 PyObject* disp_dict; 420 DispersionVisitor* visitor = new DispersionVisitor(); 421 disp_dict = PyDict_GetItemString(self->dispersion, "l_radius"); 422 self->model->l_radius.dispersion->accept_as_destination(visitor, self->model->l_radius.dispersion, disp_dict); 423 disp_dict = PyDict_GetItemString(self->dispersion, "s_radius"); 424 self->model->s_radius.dispersion->accept_as_destination(visitor, self->model->s_radius.dispersion, disp_dict); 425 395 426 396 427 // Get input and determine whether we have to supply a 1D or 2D return value. … … 470 501 {"runXY", (PyCFunction)runXY , METH_VARARGS, 471 502 "Evaluate the model at a given Q or Qx, Qy"}, 503 {"calculate_ER", (PyCFunction)calculate_ER , METH_VARARGS, 504 "Evaluate the model at a given Q or Q, phi"}, 472 505 473 506 {"evalDistribution", (PyCFunction)evalDistribution , METH_VARARGS,
Note: See TracChangeset
for help on using the changeset viewer.