Changeset a5e14410 in sasview
- Timestamp:
- Sep 16, 2011 4:48:48 PM (13 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:
- b9958b3
- Parents:
- fafdfd3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/c_models/parameters.cpp
r0ad5703 ra5e14410 91 91 92 92 GaussianDispersion :: GaussianDispersion() { 93 npts = 1 1;93 npts = 100; 94 94 width = 0.0; 95 nsigmas = 2.5;95 nsigmas = 10; 96 96 }; 97 97 … … 123 123 width = 0.0; 124 124 npts = 1; 125 nsigmas = 2.5;125 nsigmas = 10; 126 126 } 127 127 … … 158 158 159 159 RectangleDispersion :: RectangleDispersion() { 160 npts = 1 1;160 npts = 100; 161 161 width = 0.0; 162 162 nsigmas = 1.73205; … … 228 228 229 229 LogNormalDispersion :: LogNormalDispersion() { 230 npts = 1 5;230 npts = 100; 231 231 width = 0.0; 232 nsigmas = 4.0;232 nsigmas = 10.0; 233 233 }; 234 234 … … 243 243 244 244 double sigma2 = pow(sigma, 2.0); 245 return 1.0/(x*sigma) * exp( -pow((log(x) - log(mean)), 2.0) / (2.0*sigma2));245 return 1.0/(x*sigma) * exp( -pow((log(x) - mean), 2.0) / (2.0*sigma2)); 246 246 247 247 } … … 259 259 width = 0.0; 260 260 npts = 1; 261 nsigmas = 4.0;261 nsigmas = 10.0; 262 262 } 263 263 … … 265 265 double value = (*par)(); 266 266 double sig; 267 double log_value; 267 268 if (npts<2) { 268 269 weights.insert(weights.end(), WeightPoint(value, 1.0)); … … 272 273 if ((*par).has_min==false){ 273 274 // sig for angles 274 sig = width / value;275 sig = width; 275 276 } 276 277 else{ 277 278 // by lognormal definition, PD is same as sigma 278 sig = width ;279 } 280 279 sig = width * value; 280 } 281 281 282 // We cover n(nsigmas) times sigmas on each side of the mean 283 //constant bin in real space 282 284 double val = value + sig * (2.0*nsigmas*double(i)/double(npts-1) - nsigmas); 283 285 // sigma in the lognormal function is in ln(R) space, thus needs converting 286 sig = fabs(sig/value); 284 287 if ( ((*par).has_min==false || val>(*par).min) 285 288 && ((*par).has_max==false || val<(*par).max) ) { 286 double _w = lognormal_weight( value, sig, val);289 double _w = lognormal_weight(log(value), sig, val); 287 290 weights.insert(weights.end(), WeightPoint(val, _w)); 291 //printf("%g \t %g\n",val,_w); 292 288 293 } 289 294 } … … 298 303 299 304 SchulzDispersion :: SchulzDispersion() { 300 npts = 1 1;305 npts = 100; 301 306 width = 0.0; 302 nsigmas = 3.0;307 nsigmas = 10.0; 303 308 }; 304 309 … … 332 337 width = 0.0; 333 338 npts = 1; 334 nsigmas = 3.0;339 nsigmas = 10.0; 335 340 } 336 341
Note: See TracChangeset
for help on using the changeset viewer.