Changeset 339ce67 in sasview for sansmodels/src/sans/models/c_models
- Timestamp:
- Oct 12, 2010 6:22:08 PM (14 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:
- 20f00bed
- Parents:
- aaad3098
- Location:
- sansmodels/src/sans/models/c_models
- Files:
-
- 5 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/c_models/CCoreFourShellModel.cpp
r35aface r339ce67 97 97 PyDict_SetItemString(self->params,"thick_shell2",Py_BuildValue("d",10.000000000000)); 98 98 PyDict_SetItemString(self->params,"sld_shell1",Py_BuildValue("d",0.000001000000)); 99 PyDict_SetItemString(self->params," rad_core",Py_BuildValue("d",60.000000000000));100 PyDict_SetItemString(self->params,"sld_core ",Py_BuildValue("d",0.000006400000));99 PyDict_SetItemString(self->params,"thick_shell3",Py_BuildValue("d",10.000000000000)); 100 PyDict_SetItemString(self->params,"sld_core0",Py_BuildValue("d",0.000006400000)); 101 101 PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.001000000000)); 102 PyDict_SetItemString(self->params," thick_shell3",Py_BuildValue("d",10.000000000000));102 PyDict_SetItemString(self->params,"rad_core0",Py_BuildValue("d",60.000000000000)); 103 103 PyDict_SetItemString(self->params,"sld_solv",Py_BuildValue("d",0.000006400000)); 104 104 PyDict_SetItemString(self->params,"sld_shell3",Py_BuildValue("d",0.000003000000)); … … 107 107 PyObject * disp_dict; 108 108 disp_dict = PyDict_New(); 109 self->model->rad_core .dispersion->accept_as_source(visitor, self->model->rad_core.dispersion, disp_dict);110 PyDict_SetItemString(self->dispersion, "rad_core ", disp_dict);109 self->model->rad_core0.dispersion->accept_as_source(visitor, self->model->rad_core0.dispersion, disp_dict); 110 PyDict_SetItemString(self->dispersion, "rad_core0", disp_dict); 111 111 disp_dict = PyDict_New(); 112 112 self->model->thick_shell1.dispersion->accept_as_source(visitor, self->model->thick_shell1.dispersion, disp_dict); … … 257 257 self->model->thick_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell2") ); 258 258 self->model->sld_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell1") ); 259 self->model-> rad_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core") );260 self->model->sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core") );259 self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") ); 260 self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") ); 261 261 self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 262 self->model-> thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") );262 self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") ); 263 263 self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") ); 264 264 self->model->sld_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell3") ); … … 266 266 PyObject* disp_dict; 267 267 DispersionVisitor* visitor = new DispersionVisitor(); 268 disp_dict = PyDict_GetItemString(self->dispersion, "rad_core ");269 self->model->rad_core .dispersion->accept_as_destination(visitor, self->model->rad_core.dispersion, disp_dict);268 disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0"); 269 self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict); 270 270 disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell1"); 271 271 self->model->thick_shell1.dispersion->accept_as_destination(visitor, self->model->thick_shell1.dispersion, disp_dict); … … 345 345 self->model->thick_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell2") ); 346 346 self->model->sld_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell1") ); 347 self->model-> rad_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core") );348 self->model->sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core") );347 self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") ); 348 self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") ); 349 349 self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 350 self->model-> thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") );350 self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") ); 351 351 self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") ); 352 352 self->model->sld_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell3") ); … … 354 354 PyObject* disp_dict; 355 355 DispersionVisitor* visitor = new DispersionVisitor(); 356 disp_dict = PyDict_GetItemString(self->dispersion, "rad_core ");357 self->model->rad_core .dispersion->accept_as_destination(visitor, self->model->rad_core.dispersion, disp_dict);356 disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0"); 357 self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict); 358 358 disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell1"); 359 359 self->model->thick_shell1.dispersion->accept_as_destination(visitor, self->model->thick_shell1.dispersion, disp_dict); … … 420 420 self->model->thick_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell2") ); 421 421 self->model->sld_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell1") ); 422 self->model-> rad_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core") );423 self->model->sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core") );422 self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") ); 423 self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") ); 424 424 self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 425 self->model-> thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") );425 self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") ); 426 426 self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") ); 427 427 self->model->sld_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell3") ); … … 429 429 PyObject* disp_dict; 430 430 DispersionVisitor* visitor = new DispersionVisitor(); 431 disp_dict = PyDict_GetItemString(self->dispersion, "rad_core ");432 self->model->rad_core .dispersion->accept_as_destination(visitor, self->model->rad_core.dispersion, disp_dict);431 disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0"); 432 self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict); 433 433 disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell1"); 434 434 self->model->thick_shell1.dispersion->accept_as_destination(visitor, self->model->thick_shell1.dispersion, disp_dict); … … 464 464 self->model->thick_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell2") ); 465 465 self->model->sld_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell1") ); 466 self->model-> rad_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core") );467 self->model->sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core") );466 self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") ); 467 self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") ); 468 468 self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 469 self->model-> thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") );469 self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") ); 470 470 self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") ); 471 471 self->model->sld_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell3") ); … … 473 473 PyObject* disp_dict; 474 474 DispersionVisitor* visitor = new DispersionVisitor(); 475 disp_dict = PyDict_GetItemString(self->dispersion, "rad_core ");476 self->model->rad_core .dispersion->accept_as_destination(visitor, self->model->rad_core.dispersion, disp_dict);475 disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0"); 476 self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict); 477 477 disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell1"); 478 478 self->model->thick_shell1.dispersion->accept_as_destination(visitor, self->model->thick_shell1.dispersion, disp_dict); … … 538 538 // Ugliness necessary to go from python to C 539 539 // TODO: refactor this 540 if (!strcmp(par_name, "rad_core ")) {541 self->model->rad_core .dispersion = dispersion;540 if (!strcmp(par_name, "rad_core0")) { 541 self->model->rad_core0.dispersion = dispersion; 542 542 } else if (!strcmp(par_name, "thick_shell1")) { 543 543 self->model->thick_shell1.dispersion = dispersion; -
sansmodels/src/sans/models/c_models/CReflModel.cpp
r35aface r339ce67 90 90 91 91 // Initialize parameter dictionary 92 PyDict_SetItemString(self->params,"sldIM_flat4",Py_BuildValue("d",0.000000000000)); 92 93 PyDict_SetItemString(self->params,"thick_flat8",Py_BuildValue("d",100.000000000000)); 93 94 PyDict_SetItemString(self->params,"thick_flat9",Py_BuildValue("d",100.000000000000)); 95 PyDict_SetItemString(self->params,"sldIM_flat7",Py_BuildValue("d",0.000000000000)); 96 PyDict_SetItemString(self->params,"sldIM_flat10",Py_BuildValue("d",0.000000000000)); 97 PyDict_SetItemString(self->params,"sldIM_flat5",Py_BuildValue("d",0.000000000000)); 94 98 PyDict_SetItemString(self->params,"thick_flat1",Py_BuildValue("d",10.000000000000)); 95 99 PyDict_SetItemString(self->params,"thick_flat3",Py_BuildValue("d",100.000000000000)); … … 109 113 PyDict_SetItemString(self->params,"thick_inter8",Py_BuildValue("d",1.000000000000)); 110 114 PyDict_SetItemString(self->params,"thick_inter9",Py_BuildValue("d",1.000000000000)); 115 PyDict_SetItemString(self->params,"sldIM_flat1",Py_BuildValue("d",0.000000000000)); 111 116 PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000)); 117 PyDict_SetItemString(self->params,"sldIM_flat2",Py_BuildValue("d",0.000000000000)); 112 118 PyDict_SetItemString(self->params,"func_inter9",Py_BuildValue("d",0.000000000000)); 113 119 PyDict_SetItemString(self->params,"thick_inter10",Py_BuildValue("d",1.000000000000)); 120 PyDict_SetItemString(self->params,"sldIM_flat3",Py_BuildValue("d",0.000000000000)); 114 121 PyDict_SetItemString(self->params,"func_inter8",Py_BuildValue("d",0.000000000000)); 115 122 PyDict_SetItemString(self->params,"thick_flat2",Py_BuildValue("d",100.000000000000)); … … 129 136 PyDict_SetItemString(self->params,"sld_flat2",Py_BuildValue("d",0.000003500000)); 130 137 PyDict_SetItemString(self->params,"sld_flat3",Py_BuildValue("d",0.000004000000)); 138 PyDict_SetItemString(self->params,"sldIM_flat8",Py_BuildValue("d",0.000000000000)); 131 139 PyDict_SetItemString(self->params,"sld_flat8",Py_BuildValue("d",0.000003500000)); 132 140 PyDict_SetItemString(self->params,"sld_flat9",Py_BuildValue("d",0.000004000000)); 141 PyDict_SetItemString(self->params,"sldIM_flat9",Py_BuildValue("d",0.000000000000)); 133 142 PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000)); 134 143 PyDict_SetItemString(self->params,"func_inter1",Py_BuildValue("d",0.000000000000)); 144 PyDict_SetItemString(self->params,"sldIM_sub0",Py_BuildValue("d",0.000000000000)); 145 PyDict_SetItemString(self->params,"sldIM_medium",Py_BuildValue("d",0.000000000000)); 135 146 PyDict_SetItemString(self->params,"sld_flat10",Py_BuildValue("d",0.000003500000)); 136 147 PyDict_SetItemString(self->params,"thick_inter0",Py_BuildValue("d",1.000000000000)); 148 PyDict_SetItemString(self->params,"sldIM_flat6",Py_BuildValue("d",0.000000000000)); 137 149 PyDict_SetItemString(self->params,"func_inter4",Py_BuildValue("d",0.000000000000)); 138 150 PyDict_SetItemString(self->params,"func_inter10",Py_BuildValue("d",0.000000000000)); … … 272 284 273 285 // Reader parameter dictionary 286 self->model->sldIM_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat4") ); 274 287 self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") ); 275 288 self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") ); 289 self->model->sldIM_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat7") ); 290 self->model->sldIM_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat10") ); 291 self->model->sldIM_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat5") ); 276 292 self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") ); 277 293 self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") ); … … 291 307 self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") ); 292 308 self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") ); 309 self->model->sldIM_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat1") ); 293 310 self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") ); 311 self->model->sldIM_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat2") ); 294 312 self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") ); 295 313 self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") ); 314 self->model->sldIM_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat3") ); 296 315 self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") ); 297 316 self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") ); … … 311 330 self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") ); 312 331 self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") ); 332 self->model->sldIM_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat8") ); 313 333 self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") ); 314 334 self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") ); 335 self->model->sldIM_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat9") ); 315 336 self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 316 337 self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") ); 338 self->model->sldIM_sub0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_sub0") ); 339 self->model->sldIM_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_medium") ); 317 340 self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") ); 318 341 self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") ); 342 self->model->sldIM_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat6") ); 319 343 self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") ); 320 344 self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") ); … … 386 410 387 411 // Reader parameter dictionary 412 self->model->sldIM_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat4") ); 388 413 self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") ); 389 414 self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") ); 415 self->model->sldIM_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat7") ); 416 self->model->sldIM_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat10") ); 417 self->model->sldIM_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat5") ); 390 418 self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") ); 391 419 self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") ); … … 405 433 self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") ); 406 434 self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") ); 435 self->model->sldIM_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat1") ); 407 436 self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") ); 437 self->model->sldIM_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat2") ); 408 438 self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") ); 409 439 self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") ); 440 self->model->sldIM_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat3") ); 410 441 self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") ); 411 442 self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") ); … … 425 456 self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") ); 426 457 self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") ); 458 self->model->sldIM_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat8") ); 427 459 self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") ); 428 460 self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") ); 461 self->model->sldIM_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat9") ); 429 462 self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 430 463 self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") ); 464 self->model->sldIM_sub0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_sub0") ); 465 self->model->sldIM_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_medium") ); 431 466 self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") ); 432 467 self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") ); 468 self->model->sldIM_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat6") ); 433 469 self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") ); 434 470 self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") ); … … 487 523 488 524 // Reader parameter dictionary 525 self->model->sldIM_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat4") ); 489 526 self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") ); 490 527 self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") ); 528 self->model->sldIM_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat7") ); 529 self->model->sldIM_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat10") ); 530 self->model->sldIM_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat5") ); 491 531 self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") ); 492 532 self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") ); … … 506 546 self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") ); 507 547 self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") ); 548 self->model->sldIM_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat1") ); 508 549 self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") ); 550 self->model->sldIM_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat2") ); 509 551 self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") ); 510 552 self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") ); 553 self->model->sldIM_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat3") ); 511 554 self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") ); 512 555 self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") ); … … 526 569 self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") ); 527 570 self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") ); 571 self->model->sldIM_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat8") ); 528 572 self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") ); 529 573 self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") ); 574 self->model->sldIM_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat9") ); 530 575 self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 531 576 self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") ); 577 self->model->sldIM_sub0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_sub0") ); 578 self->model->sldIM_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_medium") ); 532 579 self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") ); 533 580 self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") ); 581 self->model->sldIM_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat6") ); 534 582 self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") ); 535 583 self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") ); … … 557 605 558 606 // Reader parameter dictionary 607 self->model->sldIM_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat4") ); 559 608 self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") ); 560 609 self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") ); 610 self->model->sldIM_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat7") ); 611 self->model->sldIM_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat10") ); 612 self->model->sldIM_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat5") ); 561 613 self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") ); 562 614 self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") ); … … 576 628 self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") ); 577 629 self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") ); 630 self->model->sldIM_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat1") ); 578 631 self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") ); 632 self->model->sldIM_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat2") ); 579 633 self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") ); 580 634 self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") ); 635 self->model->sldIM_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat3") ); 581 636 self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") ); 582 637 self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") ); … … 596 651 self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") ); 597 652 self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") ); 653 self->model->sldIM_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat8") ); 598 654 self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") ); 599 655 self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") ); 656 self->model->sldIM_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat9") ); 600 657 self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 601 658 self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") ); 659 self->model->sldIM_sub0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_sub0") ); 660 self->model->sldIM_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_medium") ); 602 661 self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") ); 603 662 self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") ); 663 self->model->sldIM_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat6") ); 604 664 self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") ); 605 665 self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") ); -
sansmodels/src/sans/models/c_models/corefourshell.cpp
rc724ccd r339ce67 33 33 CoreFourShellModel :: CoreFourShellModel() { 34 34 scale = Parameter(1.0); 35 rad_core = Parameter(60.0, true);36 rad_core .set_min(0.0);37 sld_core = Parameter(6.4e-6);35 rad_core0 = Parameter(60.0, true); 36 rad_core0.set_min(0.0); 37 sld_core0 = Parameter(6.4e-6); 38 38 thick_shell1 = Parameter(10.0, true); 39 39 thick_shell1.set_min(0.0); … … 64 64 // Add the background after averaging 65 65 dp[0] = scale(); 66 dp[1] = rad_core ();67 dp[2] = sld_core ();66 dp[1] = rad_core0(); 67 dp[2] = sld_core0(); 68 68 dp[3] = thick_shell1(); 69 69 dp[4] = sld_shell1(); … … 79 79 // Get the dispersion points for the radius 80 80 vector<WeightPoint> weights_rad; 81 rad_core .get_weights(weights_rad);81 rad_core0.get_weights(weights_rad); 82 82 83 83 // Get the dispersion points for the thick 1 … … 167 167 168 168 dp.scale = scale(); 169 dp.rad_core = rad_core();170 dp.sld_core = sld_core();169 dp.rad_core0 = rad_core0(); 170 dp.sld_core0 = sld_core0(); 171 171 dp.thick_shell1 = thick_shell1(); 172 172 dp.sld_shell1 = sld_shell1(); … … 182 182 // Get the dispersion points for the radius 183 183 vector<WeightPoint> weights_rad; 184 rad_core .get_weights(weights_rad);184 rad_core0.get_weights(weights_rad); 185 185 186 186 // Get the dispersion points for the thick 1 … … 207 207 // Loop over radius weight points 208 208 for(int i=0; i<weights_rad.size(); i++) { 209 dp.rad_core = weights_rad[i].value;209 dp.rad_core0 = weights_rad[i].value; 210 210 // Loop over radius weight points 211 211 for(int j=0; j<weights_s1.size(); j++) { … … 222 222 //Un-normalize FourShell by volume 223 223 sum += weights_rad[i].weight*weights_s1[j].weight*weights_s2[k].weight*weights_s3[l].weight*weights_s4[m].weight 224 * (dp.rad_core +dp.thick_shell1+dp.thick_shell2+dp.thick_shell3+dp.thick_shell4);224 * (dp.rad_core0+dp.thick_shell1+dp.thick_shell2+dp.thick_shell3+dp.thick_shell4); 225 225 norm += weights_rad[i].weight*weights_s1[j].weight*weights_s2[k].weight*weights_s3[l].weight*weights_s4[m].weight; 226 226 } … … 234 234 else{ 235 235 //return normal value 236 rad_out = dp.rad_core +dp.thick_shell1+dp.thick_shell2+dp.thick_shell3+dp.thick_shell4;}236 rad_out = dp.rad_core0+dp.thick_shell1+dp.thick_shell2+dp.thick_shell3+dp.thick_shell4;} 237 237 238 238 return rad_out; -
sansmodels/src/sans/models/c_models/models.hh
rd5b6a9d r339ce67 49 49 }; 50 50 51 class BarBellModel{ 52 public: 53 // Model parameters 54 Parameter scale; 55 Parameter rad_bar; 56 Parameter len_bar; 57 Parameter rad_bell; 58 Parameter sld_barbell; 59 Parameter sld_solv; 60 Parameter background; 61 Parameter theta; 62 Parameter phi; 63 64 // Constructor 65 BarBellModel(); 66 67 // Operators to get I(Q) 68 double operator()(double q); 69 double operator()(double qx, double qy); 70 double calculate_ER(); 71 double evaluate_rphi(double q, double phi); 72 }; 73 74 class CappedCylinderModel{ 75 public: 76 // Model parameters 77 Parameter scale; 78 Parameter rad_cyl; 79 Parameter len_cyl; 80 Parameter rad_cap; 81 Parameter sld_capcyl; 82 Parameter sld_solv; 83 Parameter background; 84 Parameter theta; 85 Parameter phi; 86 87 // Constructor 88 CappedCylinderModel(); 89 90 // Operators to get I(Q) 91 double operator()(double q); 92 double operator()(double qx, double qy); 93 double calculate_ER(); 94 double evaluate_rphi(double q, double phi); 95 }; 96 97 51 98 class ParallelepipedModel{ 52 99 public: … … 80 127 Parameter n_shells; 81 128 Parameter scale; 82 Parameter rad_core ;83 Parameter sld_core ;129 Parameter rad_core0; 130 Parameter sld_core0; 84 131 Parameter sld_solv; 85 132 Parameter background; … … 256 303 Parameter func_inter10; 257 304 305 Parameter sldIM_flat1; 306 Parameter sldIM_flat2; 307 Parameter sldIM_flat3; 308 Parameter sldIM_flat4; 309 Parameter sldIM_flat5; 310 Parameter sldIM_flat6; 311 Parameter sldIM_flat7; 312 Parameter sldIM_flat8; 313 Parameter sldIM_flat9; 314 Parameter sldIM_flat10; 315 316 Parameter sldIM_sub0; 317 Parameter sldIM_medium; 318 258 319 // Constructor 259 320 ReflModel(); … … 511 572 // Model parameters 512 573 Parameter scale; 513 Parameter rad_core ;514 Parameter sld_core ;574 Parameter rad_core0; 575 Parameter sld_core0; 515 576 Parameter thick_shell1; 516 577 Parameter sld_shell1; -
sansmodels/src/sans/models/c_models/onion.cpp
re096270 r339ce67 33 33 n_shells = Parameter(1.0); 34 34 scale = Parameter(1.0); 35 rad_core = Parameter(200.0);36 sld_core = Parameter(1e-06);35 rad_core0 = Parameter(200.0); 36 sld_core0 = Parameter(1e-06); 37 37 sld_solv = Parameter(6.4e-06); 38 38 background = Parameter(0.0); … … 112 112 dp[0] = n_shells(); 113 113 dp[1] = scale(); 114 dp[2] = rad_core ();115 dp[3] = sld_core ();114 dp[2] = rad_core0(); 115 dp[3] = sld_core0(); 116 116 dp[4] = sld_solv(); 117 117 dp[5] = 0.0; … … 175 175 // Get the dispersion points for the radius 176 176 vector<WeightPoint> weights_rad; 177 rad_core .get_weights(weights_rad);177 rad_core0.get_weights(weights_rad); 178 178 179 179 // Get the dispersion points for the thick 1 … … 313 313 double OnionModel :: calculate_ER() { 314 314 OnionParameters dp; 315 dp.rad_core = rad_core();315 dp.rad_core0 = rad_core0(); 316 316 dp.thick_shell1 = thick_shell1(); 317 317 dp.thick_shell2 = thick_shell2(); … … 333 333 // Get the dispersion points for the radius 334 334 vector<WeightPoint> weights_rad; 335 rad_core .get_weights(weights_rad);335 rad_core0.get_weights(weights_rad); 336 336 337 337 // Get the dispersion points for the thick 1 … … 376 376 // Loop over radius weight points 377 377 for(int i=0; i<weights_rad.size(); i++) { 378 dp.rad_core = weights_rad[i].value;378 dp.rad_core0 = weights_rad[i].value; 379 379 // Loop over radius weight points 380 380 for(int j=0; j<weights_s1.size(); j++) { … … 411 411 *weights_s5[n].weight*weights_s6[o].weight*weights_s7[p].weight*weights_s8[t].weight 412 412 *weights_s9[r].weight*weights_s10[s].weight 413 * (dp.rad_core +dp.thick_shell1+dp.thick_shell2+dp.thick_shell3+dp.thick_shell4+dp.thick_shell5413 * (dp.rad_core0+dp.thick_shell1+dp.thick_shell2+dp.thick_shell3+dp.thick_shell4+dp.thick_shell5 414 414 +dp.thick_shell6+dp.thick_shell7+dp.thick_shell8+dp.thick_shell9+dp.thick_shell10); 415 415 norm += weights_rad[i].weight*weights_s1[j].weight*weights_s2[k].weight*weights_s3[l].weight … … 433 433 else{ 434 434 //return normal value 435 rad_out = dp.rad_core +dp.thick_shell1+dp.thick_shell2+dp.thick_shell3+dp.thick_shell4435 rad_out = dp.rad_core0+dp.thick_shell1+dp.thick_shell2+dp.thick_shell3+dp.thick_shell4 436 436 +dp.thick_shell5+dp.thick_shell6+dp.thick_shell7+dp.thick_shell8+dp.thick_shell9+dp.thick_shell10;} 437 437 return rad_out; -
sansmodels/src/sans/models/c_models/refl.cpp
r35aface r339ce67 67 67 func_inter10 = Parameter(0); 68 68 69 sldIM_flat1 = Parameter(0); 70 sldIM_flat2 = Parameter(0); 71 sldIM_flat3 = Parameter(0); 72 sldIM_flat4 = Parameter(0); 73 sldIM_flat5 = Parameter(0); 74 sldIM_flat6 = Parameter(0); 75 sldIM_flat7 = Parameter(0); 76 sldIM_flat8 = Parameter(0); 77 sldIM_flat9 = Parameter(0); 78 sldIM_flat10 = Parameter(0); 79 80 sldIM_sub0 = Parameter(0); 81 sldIM_medium = Parameter(0); 69 82 } 70 83 … … 75 88 */ 76 89 double ReflModel :: operator()(double q) { 77 double dp[ 47];90 double dp[59]; 78 91 // Fill parameter array for IGOR library 79 92 // Add the background after averaging … … 130 143 dp[46] = func_inter10(); 131 144 145 dp[47] = sldIM_flat1(); 146 dp[48] = sldIM_flat2(); 147 dp[49] = sldIM_flat3(); 148 dp[50] = sldIM_flat4(); 149 dp[51] = sldIM_flat5(); 150 dp[52] = sldIM_flat6(); 151 dp[53] = sldIM_flat7(); 152 dp[54] = sldIM_flat8(); 153 dp[55] = sldIM_flat9(); 154 dp[56] = sldIM_flat10(); 155 156 dp[57] = sldIM_sub0(); 157 dp[58] = sldIM_medium(); 158 132 159 // Get the dispersion points for the radius 133 160 //vector<WeightPoint> weights_thick;
Note: See TracChangeset
for help on using the changeset viewer.