Changeset c451be9 in sasview for sansmodels/src/sans/models/c_models/spheroid.cpp
- Timestamp:
- Jan 7, 2010 3:04:25 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:
- dfa8832
- Parents:
- 4cbaf35
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/c_models/spheroid.cpp
rf9bf661 rc451be9 91 91 double sum = 0.0; 92 92 double norm = 0.0; 93 double vol = 0.0; 93 94 94 95 // Loop over major core weight points … … 107 108 for(int l=0; l<(int)weights_polar_shell.size(); l++) { 108 109 dp[4] = weights_polar_shell[l].value; 109 110 //Un-normalize by volume 110 111 sum += weights_equat_core[i].weight* weights_polar_core[j].weight * weights_equat_shell[k].weight 111 * weights_polar_shell[l].weight * ProlateForm(dp, q); 112 * weights_polar_shell[l].weight * ProlateForm(dp, q) 113 * pow(weights_equat_shell[k].value,2)*weights_polar_shell[l].value; 114 //Find average volume 115 vol += weights_equat_core[i].weight* weights_polar_core[j].weight 116 * weights_equat_shell[k].weight 117 * weights_polar_shell[l].weight 118 * pow(weights_equat_shell[k].value,2)*weights_polar_shell[l].value; 112 119 norm += weights_equat_core[i].weight* weights_polar_core[j].weight * weights_equat_shell[k].weight 113 120 * weights_polar_shell[l].weight; … … 116 123 } 117 124 } 125 if (vol != 0.0 && norm != 0.0) { 126 //Re-normalize by avg volume 127 sum = sum/(vol/norm);} 118 128 return sum/norm + background(); 119 129 } … … 194 204 double sum = 0.0; 195 205 double norm = 0.0; 206 double norm_vol = 0.0; 207 double vol = 0.0; 196 208 197 209 // Loop over major core weight points … … 218 230 for(int n=0; n< (int)weights_phi.size(); n++) { 219 231 dp.axis_phi = weights_phi[n].value; 220 232 //Un-normalize by volume 221 233 double _ptvalue = weights_equat_core[i].weight *weights_polar_core[j].weight 222 234 * weights_equat_shell[k].weight * weights_polar_shell[l].weight 223 235 * weights_theta[m].weight 224 236 * weights_phi[n].weight 225 * spheroid_analytical_2DXY(&dp, qx, qy); 237 * spheroid_analytical_2DXY(&dp, qx, qy) 238 * pow(weights_equat_shell[k].value,2)*weights_polar_shell[l].value; 226 239 if (weights_theta.size()>1) { 227 240 _ptvalue *= sin(weights_theta[m].value); 228 241 } 229 242 sum += _ptvalue; 243 //Find average volume 244 vol += weights_equat_shell[k].weight 245 * weights_polar_shell[l].weight 246 * pow(weights_equat_shell[k].value,2)*weights_polar_shell[l].value; 247 //Find norm for volume 248 norm_vol += weights_equat_shell[k].weight 249 * weights_polar_shell[l].weight; 230 250 231 251 norm += weights_equat_core[i].weight *weights_polar_core[j].weight … … 242 262 // integration (see documentation). 243 263 if (weights_theta.size()>1) norm = norm / asin(1.0); 264 265 if (vol != 0.0 && norm_vol != 0.0) { 266 //Re-normalize by avg volume 267 sum = sum/(vol/norm_vol);} 268 244 269 return sum/norm + background(); 245 270 }
Note: See TracChangeset
for help on using the changeset viewer.