Changeset 5eb9154 in sasview for sansmodels/src/sans/models/c_models/CSphereModel.cpp
- Timestamp:
- Aug 31, 2009 3: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/CSphereModel.cpp
r870f131 r5eb9154 344 344 } 345 345 } 346 346 /** 347 * Function to call to calculate_ER 348 * @return: effective radius value 349 */ 350 static PyObject * calculate_ER(CSphereModel *self) { 351 352 PyObject* pars; 353 int npars; 354 355 // Get parameters 356 357 // Reader parameter dictionary 358 self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") ); 359 self->model->radius = PyFloat_AsDouble( PyDict_GetItemString(self->params, "radius") ); 360 self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 361 self->model->contrast = PyFloat_AsDouble( PyDict_GetItemString(self->params, "contrast") ); 362 // Read in dispersion parameters 363 PyObject* disp_dict; 364 DispersionVisitor* visitor = new DispersionVisitor(); 365 disp_dict = PyDict_GetItemString(self->dispersion, "radius"); 366 self->model->radius.dispersion->accept_as_destination(visitor, self->model->radius.dispersion, disp_dict); 367 368 369 return Py_BuildValue("d",(*(self->model)).calculate_ER()); 370 371 } 347 372 /** 348 373 * Function to call to evaluate model in cartesian coordinates … … 443 468 {"runXY", (PyCFunction)runXY , METH_VARARGS, 444 469 "Evaluate the model at a given Q or Qx, Qy"}, 470 {"calculate_ER", (PyCFunction)calculate_ER , METH_VARARGS, 471 "Evaluate the model at a given Q or Q, phi"}, 445 472 446 473 {"evalDistribution", (PyCFunction)evalDistribution , METH_VARARGS,
Note: See TracChangeset
for help on using the changeset viewer.