Changeset 3c102d4 in sasview for sansmodels/src/sans/models/c_models
- Timestamp:
- Aug 18, 2009 1:56:49 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:
- eddff027
- Parents:
- 7d11b81
- Location:
- sansmodels/src/sans/models/c_models
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/c_models/CTriaxialEllipsoidModel.cpp
r975ec8e r3c102d4 88 88 PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000)); 89 89 PyDict_SetItemString(self->params,"axis_psi",Py_BuildValue("d",0.000000)); 90 PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d", 0.000000));91 PyDict_SetItemString(self->params,"semi_axisA",Py_BuildValue("d", 100.000000));92 PyDict_SetItemString(self->params,"semi_axisB",Py_BuildValue("d", 35.000000));90 PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d",1.000000)); 91 PyDict_SetItemString(self->params,"semi_axisA",Py_BuildValue("d",35.000000)); 92 PyDict_SetItemString(self->params,"semi_axisB",Py_BuildValue("d",100.000000)); 93 93 PyDict_SetItemString(self->params,"semi_axisC",Py_BuildValue("d",400.000000)); 94 PyDict_SetItemString(self->params,"axis_phi",Py_BuildValue("d", 0.000000));94 PyDict_SetItemString(self->params,"axis_phi",Py_BuildValue("d",1.000000)); 95 95 PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000)); 96 96 PyDict_SetItemString(self->params,"contrast",Py_BuildValue("d",0.000005)); -
sansmodels/src/sans/models/c_models/parallelepiped.cpp
r975ec8e r3c102d4 35 35 ParallelepipedModel :: ParallelepipedModel() { 36 36 scale = Parameter(1.0); 37 short_ edgeA= Parameter(35.0, true);38 short_ edgeA.set_max(1.0);39 long er_edgeB= Parameter(75.0, true);40 long er_edgeB.set_min(1.0);41 long uest_edgeC= Parameter(400.0, true);42 long uest_edgeC.set_min(1.0);37 short_a = Parameter(35.0, true); 38 short_a.set_max(1.0); 39 long_b = Parameter(75.0, true); 40 long_b.set_min(1.0); 41 longer_c = Parameter(400.0, true); 42 longer_c.set_min(1.0); 43 43 contrast = Parameter(53.e-7); 44 44 background = Parameter(0.0); … … 60 60 // Add the background after averaging 61 61 dp[0] = scale(); 62 dp[1] = short_ edgeA();63 dp[2] = long er_edgeB();64 dp[3] = long uest_edgeC();62 dp[1] = short_a(); 63 dp[2] = long_b(); 64 dp[3] = longer_c(); 65 65 dp[4] = contrast(); 66 66 dp[5] = 0.0; 67 67 68 68 // Get the dispersion points for the short_edgeA 69 vector<WeightPoint> weights_short_ edgeA;70 short_ edgeA.get_weights(weights_short_edgeA);69 vector<WeightPoint> weights_short_a; 70 short_a.get_weights(weights_short_a); 71 71 72 72 // Get the dispersion points for the longer_edgeB 73 vector<WeightPoint> weights_long er_edgeB;74 long er_edgeB.get_weights(weights_longer_edgeB);73 vector<WeightPoint> weights_long_b; 74 long_b.get_weights(weights_long_b); 75 75 76 76 // Get the dispersion points for the longuest_edgeC 77 vector<WeightPoint> weights_long uest_edgeC;78 long uest_edgeC.get_weights(weights_longuest_edgeC);77 vector<WeightPoint> weights_longer_c; 78 longer_c.get_weights(weights_longer_c); 79 79 80 80 … … 85 85 86 86 // Loop over short_edgeA weight points 87 for(int i=0; i< (int)weights_short_ edgeA.size(); i++) {88 dp[1] = weights_short_ edgeA[i].value;87 for(int i=0; i< (int)weights_short_a.size(); i++) { 88 dp[1] = weights_short_a[i].value; 89 89 90 90 // Loop over longer_edgeB weight points 91 for(int j=0; j< (int)weights_long er_edgeB.size(); j++) {92 dp[2] = weights_long er_edgeB[i].value;91 for(int j=0; j< (int)weights_long_b.size(); j++) { 92 dp[2] = weights_long_b[j].value; 93 93 94 94 // Loop over longuest_edgeC weight points 95 for(int k=0; k< (int)weights_long uest_edgeC.size(); k++) {96 dp[3] = weights_long uest_edgeC[j].value;97 98 sum += weights_short_ edgeA[i].weight * weights_longer_edgeB[j].weight99 * weights_long uest_edgeC[k].weight * Parallelepiped(dp, q);100 101 norm += weights_short_ edgeA[i].weight102 * weights_long er_edgeB[j].weight * weights_longuest_edgeC[k].weight;95 for(int k=0; k< (int)weights_longer_c.size(); k++) { 96 dp[3] = weights_longer_c[k].value; 97 98 sum += weights_short_a[i].weight * weights_long_b[j].weight 99 * weights_longer_c[k].weight * Parallelepiped(dp, q); 100 101 norm += weights_short_a[i].weight 102 * weights_long_b[j].weight * weights_longer_c[k].weight; 103 103 } 104 104 } … … 116 116 // Fill parameter array 117 117 dp.scale = scale(); 118 dp.short_ edgeA = short_edgeA();119 dp.long er_edgeB = longer_edgeB();120 dp.long uest_edgeC = longuest_edgeC();118 dp.short_a = short_a(); 119 dp.long_b = long_b(); 120 dp.longer_c = longer_c(); 121 121 dp.contrast = contrast(); 122 122 dp.background = 0.0; … … 128 128 129 129 // Get the dispersion points for the short_edgeA 130 vector<WeightPoint> weights_short_ edgeA;131 short_ edgeA.get_weights(weights_short_edgeA);130 vector<WeightPoint> weights_short_a; 131 short_a.get_weights(weights_short_a); 132 132 133 133 // Get the dispersion points for the longer_edgeB 134 vector<WeightPoint> weights_long er_edgeB;135 long er_edgeB.get_weights(weights_longer_edgeB);134 vector<WeightPoint> weights_long_b; 135 long_b.get_weights(weights_long_b); 136 136 137 137 // Get angular averaging for the longuest_edgeC 138 vector<WeightPoint> weights_long uest_edgeC;139 long uest_edgeC.get_weights(weights_longuest_edgeC);138 vector<WeightPoint> weights_longer_c; 139 longer_c.get_weights(weights_longer_c); 140 140 141 141 // Get angular averaging for theta … … 156 156 157 157 // Loop over radius weight points 158 for(int i=0; i< (int)weights_short_ edgeA.size(); i++) {159 dp.short_ edgeA = weights_short_edgeA[i].value;158 for(int i=0; i< (int)weights_short_a.size(); i++) { 159 dp.short_a = weights_short_a[i].value; 160 160 161 161 // Loop over longer_edgeB weight points 162 for(int j=0; j< (int)weights_long er_edgeB.size(); j++) {163 dp.long er_edgeB = weights_longer_edgeB[j].value;162 for(int j=0; j< (int)weights_long_b.size(); j++) { 163 dp.long_b = weights_long_b[j].value; 164 164 165 165 // Average over longuest_edgeC distribution 166 for(int k=0; k< (int)weights_long uest_edgeC.size(); k++) {167 dp.long uest_edgeC = weights_longuest_edgeC[k].value;166 for(int k=0; k< (int)weights_longer_c.size(); k++) { 167 dp.longer_c = weights_longer_c[k].value; 168 168 169 169 // Average over theta distribution … … 179 179 dp.parallel_psi = weights_parallel_psi[n].value; 180 180 181 double _ptvalue = weights_short_ edgeA[i].weight182 * weights_long er_edgeB[j].weight183 * weights_long uest_edgeC[k].weight181 double _ptvalue = weights_short_a[i].weight 182 * weights_long_b[j].weight 183 * weights_longer_c[k].weight 184 184 * weights_parallel_theta[l].weight 185 185 * weights_parallel_phi[m].weight … … 191 191 sum += _ptvalue; 192 192 193 norm += weights_short_ edgeA[i].weight194 * weights_long er_edgeB[j].weight195 * weights_long uest_edgeC[k].weight193 norm += weights_short_a[i].weight 194 * weights_long_b[j].weight 195 * weights_longer_c[k].weight 196 196 * weights_parallel_theta[l].weight 197 197 * weights_parallel_phi[m].weight -
sansmodels/src/sans/models/c_models/triaxialellipsoid.cpp
r975ec8e r3c102d4 34 34 TriaxialEllipsoidModel :: TriaxialEllipsoidModel() { 35 35 scale = Parameter(1.0); 36 semi_axisA = Parameter( 20.0, true);36 semi_axisA = Parameter(35.0, true); 37 37 semi_axisA.set_min(0.0); 38 semi_axisB = Parameter( 20.0, true);38 semi_axisB = Parameter(100.0, true); 39 39 semi_axisB.set_min(0.0); 40 40 semi_axisC = Parameter(400.0, true); … … 42 42 contrast = Parameter(5.3e-6); 43 43 background = Parameter(0.0); 44 axis_theta = Parameter( 0.0, true);45 axis_phi = Parameter( 0.0, true);44 axis_theta = Parameter(1.0, true); 45 axis_phi = Parameter(1.0, true); 46 46 axis_psi = Parameter(0.0, true); 47 47 } … … 190 190 * weights_theta[l].weight 191 191 * weights_phi[m].weight 192 * weights_psi[ m].weight;192 * weights_psi[n].weight; 193 193 } 194 194 }
Note: See TracChangeset
for help on using the changeset viewer.