Changeset 5eb9154 in sasview for sansmodels/src/sans/models/c_models/CLamellarPSModel.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/CLamellarPSModel.cpp
r870f131 r5eb9154 360 360 } 361 361 } 362 363 /** 364 * Function to call to evaluate model in cartesian coordinates 365 * @param args: input q or [qx, qy]] 366 * @return: function value 367 */ 368 static PyObject * runXY(CLamellarPSModel *self, PyObject *args) { 369 double qx_value, qy_value; 362 /** 363 * Function to call to calculate_ER 364 * @return: effective radius value 365 */ 366 static PyObject * calculate_ER(CLamellarPSModel *self) { 367 370 368 PyObject* pars; 371 369 int npars; … … 389 387 self->model->spacing.dispersion->accept_as_destination(visitor, self->model->spacing.dispersion, disp_dict); 390 388 389 390 return Py_BuildValue("d",(*(self->model)).calculate_ER()); 391 392 } 393 /** 394 * Function to call to evaluate model in cartesian coordinates 395 * @param args: input q or [qx, qy]] 396 * @return: function value 397 */ 398 static PyObject * runXY(CLamellarPSModel *self, PyObject *args) { 399 double qx_value, qy_value; 400 PyObject* pars; 401 int npars; 402 403 // Get parameters 404 405 // Reader parameter dictionary 406 self->model->n_plates = PyFloat_AsDouble( PyDict_GetItemString(self->params, "n_plates") ); 407 self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") ); 408 self->model->spacing = PyFloat_AsDouble( PyDict_GetItemString(self->params, "spacing") ); 409 self->model->caille = PyFloat_AsDouble( PyDict_GetItemString(self->params, "caille") ); 410 self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 411 self->model->delta = PyFloat_AsDouble( PyDict_GetItemString(self->params, "delta") ); 412 self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") ); 413 // Read in dispersion parameters 414 PyObject* disp_dict; 415 DispersionVisitor* visitor = new DispersionVisitor(); 416 disp_dict = PyDict_GetItemString(self->dispersion, "delta"); 417 self->model->delta.dispersion->accept_as_destination(visitor, self->model->delta.dispersion, disp_dict); 418 disp_dict = PyDict_GetItemString(self->dispersion, "spacing"); 419 self->model->spacing.dispersion->accept_as_destination(visitor, self->model->spacing.dispersion, disp_dict); 420 391 421 392 422 // Get input and determine whether we have to supply a 1D or 2D return value. … … 466 496 {"runXY", (PyCFunction)runXY , METH_VARARGS, 467 497 "Evaluate the model at a given Q or Qx, Qy"}, 498 {"calculate_ER", (PyCFunction)calculate_ER , METH_VARARGS, 499 "Evaluate the model at a given Q or Q, phi"}, 468 500 469 501 {"evalDistribution", (PyCFunction)evalDistribution , METH_VARARGS,
Note: See TracChangeset
for help on using the changeset viewer.