Changeset 4628e31 in sasview for sansmodels/src/sans/models/c_extensions
- Timestamp:
- Oct 22, 2010 5:50:05 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:
- d7b7156
- Parents:
- 67e258c
- Location:
- sansmodels/src/sans/models/c_extensions
- Files:
-
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/c_extensions/barbell.c
r339ce67 r4628e31 142 142 dp[6] = pars->background; 143 143 144 //convert angle degree to radian 145 double pi = 4.0*atan(1.0); 146 double theta = pars->theta * pi/180.0; 147 double phi = pars->phi * pi/180.0; 144 148 145 149 //double Pi = 4.0*atan(1.0); 146 150 // Cylinder orientation 147 cyl_x = sin( pars->theta) * cos(pars->phi);148 cyl_y = sin( pars->theta) * sin(pars->phi);149 cyl_z = cos( pars->theta);151 cyl_x = sin(theta) * cos(phi); 152 cyl_y = sin(theta) * sin(phi); 153 cyl_z = cos(theta); 150 154 151 155 // q vector -
sansmodels/src/sans/models/c_extensions/barbell.h
r339ce67 r4628e31 58 58 double background; 59 59 60 /// Angle of the main axis against z-axis in detector plane [ rad]61 // [DEFAULT]=theta=0.0 [ rad]60 /// Angle of the main axis against z-axis in detector plane [deg] 61 // [DEFAULT]=theta=0.0 [deg] 62 62 double theta; 63 /// Azimuthal angle around z-axis in detector plane [ rad]64 // [DEFAULT]=phi=0.0 [ rad]63 /// Azimuthal angle around z-axis in detector plane [deg] 64 // [DEFAULT]=phi=0.0 [deg] 65 65 double phi; 66 66 -
sansmodels/src/sans/models/c_extensions/bcc.c
r85bb870 r4628e31 74 74 dp[4] = 0.0; 75 75 76 //convert angle degree to radian 77 double pi = 4.0*atan(1.0); 78 double theta = pars->theta * pi/180.0; 79 double phi = pars->phi * pi/180.0; 80 double psi = pars->psi * pi/180.0; 81 76 82 aa = pars->dnn; 77 83 Da = pars->d_factor*aa; … … 85 91 /// instead of against q coordinate(PRB 36(46), 3(6), 1754(3854)) 86 92 // b3 axis orientation 87 b3_x = sin( pars->theta) * cos(pars->phi);//negative sign here???88 b3_y = sin( pars->theta) * sin(pars->phi);89 b3_z = cos( pars->theta);93 b3_x = sin(theta) * cos(phi);//negative sign here??? 94 b3_y = sin(theta) * sin(phi); 95 b3_z = cos(theta); 90 96 cos_val_b3 = b3_x*q_x + b3_y*q_y + b3_z*q_z; 91 97 92 98 alpha = acos(cos_val_b3); 93 99 // b1 axis orientation 94 b1_x = sin(p ars->psi);95 b1_y = cos(p ars->psi);100 b1_x = sin(psi); 101 b1_y = cos(psi); 96 102 cos_val_b1 = (b1_x*q_x + b1_y*q_y); 97 103 // b2 axis orientation -
sansmodels/src/sans/models/c_extensions/bcc.h
rd5b6a9d r4628e31 57 57 // [DEFAULT]=background=0 [1/cm] 58 58 double background; 59 /// Orientation of the a1 axis w/respect incoming beam [ rad]60 // [DEFAULT]=theta=0.0 [ rad]59 /// Orientation of the a1 axis w/respect incoming beam [deg] 60 // [DEFAULT]=theta=0.0 [deg] 61 61 double theta; 62 /// Orientation of the a2 in the plane of the detector [ rad]63 // [DEFAULT]=phi=0.0 [ rad]62 /// Orientation of the a2 in the plane of the detector [deg] 63 // [DEFAULT]=phi=0.0 [deg] 64 64 double phi; 65 /// Orientation of the a3 in the plane of the detector [ rad]66 // [DEFAULT]=psi=0.0 [ rad]65 /// Orientation of the a3 in the plane of the detector [deg] 66 // [DEFAULT]=psi=0.0 [deg] 67 67 double psi; 68 68 -
sansmodels/src/sans/models/c_extensions/capcyl.c
r339ce67 r4628e31 142 142 dp[6] = pars->background; 143 143 144 //convert angle degree to radian 145 double pi = 4.0*atan(1.0); 146 double theta = pars->theta * pi/180.0; 147 double phi = pars->phi * pi/180.0; 148 144 149 145 150 //double Pi = 4.0*atan(1.0); 146 151 // Cylinder orientation 147 cyl_x = sin( pars->theta) * cos(pars->phi);148 cyl_y = sin( pars->theta) * sin(pars->phi);149 cyl_z = cos( pars->theta);152 cyl_x = sin(theta) * cos(phi); 153 cyl_y = sin(theta) * sin(phi); 154 cyl_z = cos(theta); 150 155 151 156 // q vector -
sansmodels/src/sans/models/c_extensions/capcyl.h
r18f2ca1 r4628e31 56 56 double background; 57 57 58 /// Angle of the main axis against z-axis in detector plane [ rad]59 // [DEFAULT]=theta=0.0 [ rad]58 /// Angle of the main axis against z-axis in detector plane [deg] 59 // [DEFAULT]=theta=0.0 [deg] 60 60 double theta; 61 /// Azimuthal angle around z-axis in detector plane [ rad]62 // [DEFAULT]=phi=0.0 [ rad]61 /// Azimuthal angle around z-axis in detector plane [deg] 62 // [DEFAULT]=phi=0.0 [deg] 63 63 double phi; 64 64 -
sansmodels/src/sans/models/c_extensions/core_shell_cylinder.c
rae3ce4e r4628e31 18 18 double core_shell_cylinder_analytical_1D(CoreShellCylinderParameters *pars, double q) { 19 19 double dp[8]; 20 20 21 21 dp[0] = pars->scale; 22 22 dp[1] = pars->radius; … … 27 27 dp[6] = pars->solvent_sld; 28 28 dp[7] = pars->background; 29 29 30 30 return CoreShellCylinder(dp, q); 31 31 } 32 32 33 33 /** 34 34 * Function to evaluate 2D scattering function … … 41 41 q = sqrt(qx*qx+qy*qy); 42 42 return core_shell_cylinder_analytical_2D_scaled(pars, q, qx/q, qy/q); 43 } 43 } 44 44 45 45 /** … … 52 52 double core_shell_cylinder_analytical_2D(CoreShellCylinderParameters *pars, double q, double phi) { 53 53 return core_shell_cylinder_analytical_2D_scaled(pars, q, cos(phi), sin(phi)); 54 } 54 } 55 55 56 56 /** … … 65 65 double cyl_x, cyl_y, cyl_z; 66 66 double q_z, lenq; 67 double theta,alpha, f, vol, sin_val, cos_val;67 double alpha, f, vol, sin_val, cos_val; 68 68 double answer; 69 69 //convert angle degree to radian 70 double pi = 4.0*atan(1.0); 71 double theta = pars->axis_theta * pi/180.0; 72 double phi = pars->axis_phi * pi/180.0; 73 70 74 // Cylinder orientation 71 cyl_x = sin( pars->axis_theta) * cos(pars->axis_phi);72 cyl_y = sin( pars->axis_theta) * sin(pars->axis_phi);73 cyl_z = cos( pars->axis_theta);74 75 cyl_x = sin(theta) * cos(phi); 76 cyl_y = sin(theta) * sin(phi); 77 cyl_z = cos(theta); 78 75 79 // q vector 76 80 q_z = 0; 77 81 78 82 // Compute the angle btw vector q and the 79 83 // axis of the cylinder 80 84 cos_val = cyl_x*q_x + cyl_y*q_y + cyl_z*q_z; 81 85 82 86 // The following test should always pass 83 87 if (fabs(cos_val)>1.0) { … … 85 89 return 0; 86 90 } 87 91 88 92 alpha = acos( cos_val ); 89 93 90 94 // Call the IGOR library function to get the kernel 91 answer = CoreShellCylKernel(q, pars->radius, pars->thickness, 92 pars->core_sld,pars->shell_sld, 93 pars->solvent_sld, pars->length/2.0, alpha) / sin(alpha);94 95 answer = CoreShellCylKernel(q, pars->radius, pars->thickness, 96 pars->core_sld,pars->shell_sld, 97 pars->solvent_sld, pars->length/2.0, alpha) / fabs(sin(alpha)); 98 95 99 //normalize by cylinder volume 96 vol= acos(-1.0)*(pars->radius+pars->thickness)100 vol=pi*(pars->radius+pars->thickness) 97 101 *(pars->radius+pars->thickness) 98 102 *(pars->length+2.0*pars->thickness); 99 103 answer /= vol; 100 104 101 105 //convert to [cm-1] 102 106 answer *= 1.0e8; 103 107 104 108 //Scale 105 109 answer *= pars->scale; 106 110 107 111 // add in the background 108 112 answer += pars->background; 109 113 110 114 return answer; 111 115 } -
sansmodels/src/sans/models/c_extensions/core_shell_cylinder.h
r27972c1d r4628e31 69 69 double background; 70 70 71 /// Orientation of the long axis of the core-shell cylinder w/respect incoming beam [ rad]72 // [DEFAULT]=axis_theta= 1.57 [rad]71 /// Orientation of the long axis of the core-shell cylinder w/respect incoming beam [deg] 72 // [DEFAULT]=axis_theta=90.0 [deg] 73 73 double axis_theta; 74 74 75 /// Orientation of the long axis of the core-shell cylinder in the plane of the detector [ rad]76 // [DEFAULT]=axis_phi=0.0 [ rad]75 /// Orientation of the long axis of the core-shell cylinder in the plane of the detector [deg] 76 // [DEFAULT]=axis_phi=0.0 [deg] 77 77 double axis_phi; 78 78 -
sansmodels/src/sans/models/c_extensions/csparallelepiped.c
r18f2ca1 r4628e31 48 48 double rhoA,rhoB,rhoC, rhoP, rhosolv; 49 49 double dr0, drA,drB, drC; 50 double Pi,retVal;50 double retVal; 51 51 52 52 aa = dp[1]; … … 181 181 182 182 double answer; 183 double pi = 4.0*atan(1.0);184 183 185 184 edgeA = pars->shortA; … … 187 186 edgeC = pars->longC; 188 187 188 //convert angle degree to radian 189 double pi = 4.0*atan(1.0); 190 double theta = pars->parallel_theta * pi/180.0; 191 double phi = pars->parallel_phi * pi/180.0; 192 double psi = pars->parallel_psi* pi/180.0; 189 193 190 194 // parallelepiped c axis orientation 191 cparallel_x = sin( pars->parallel_theta) * cos(pars->parallel_phi);192 cparallel_y = sin( pars->parallel_theta) * sin(pars->parallel_phi);193 cparallel_z = cos( pars->parallel_theta);195 cparallel_x = sin(theta) * cos(phi); 196 cparallel_y = sin(theta) * sin(phi); 197 cparallel_z = cos(theta); 194 198 195 199 // q vector … … 202 206 203 207 // parallelepiped a axis orientation 204 parallel_x = sin(p ars->parallel_psi);//cos(pars->parallel_theta) * sin(pars->parallel_phi)*sin(pars->parallel_psi);205 parallel_y = cos(p ars->parallel_psi);//cos(pars->parallel_theta) * cos(pars->parallel_phi)*cos(pars->parallel_psi);208 parallel_x = sin(psi);//cos(pars->parallel_theta) * sin(pars->parallel_phi)*sin(pars->parallel_psi); 209 parallel_y = cos(psi);//cos(pars->parallel_theta) * cos(pars->parallel_phi)*cos(pars->parallel_psi); 206 210 207 211 cos_val_a = parallel_x*q_x + parallel_y*q_y; … … 210 214 211 215 // parallelepiped b axis orientation 212 bparallel_x = sqrt(1.0-sin( pars->parallel_theta)*cos(pars->parallel_phi))*cos(pars->parallel_psi);//cos(pars->parallel_theta) * cos(pars->parallel_phi)* cos(pars->parallel_psi);213 bparallel_y = sqrt(1.0-sin( pars->parallel_theta)*cos(pars->parallel_phi))*sin(pars->parallel_psi);//cos(pars->parallel_theta) * sin(pars->parallel_phi)* sin(pars->parallel_psi);216 bparallel_x = sqrt(1.0-sin(theta)*cos(phi))*cos(psi);//cos(pars->parallel_theta) * cos(pars->parallel_phi)* cos(pars->parallel_psi); 217 bparallel_y = sqrt(1.0-sin(theta)*cos(phi))*sin(psi);//cos(pars->parallel_theta) * sin(pars->parallel_phi)* sin(pars->parallel_psi); 214 218 // axis of the parallelepiped 215 219 cos_val_b = sin(acos(cos_val_a)) ; -
sansmodels/src/sans/models/c_extensions/csparallelepiped.h
r18f2ca1 r4628e31 68 68 // [DEFAULT]=background=0.06 [1/cm] 69 69 double background; 70 /// Orientation of the parallelepiped axis w/respect incoming beam [ rad]71 // [DEFAULT]=parallel_theta=0.0 [ rad]70 /// Orientation of the parallelepiped axis w/respect incoming beam [deg] 71 // [DEFAULT]=parallel_theta=0.0 [deg] 72 72 double parallel_theta; 73 /// Orientation of the longitudinal axis of the parallelepiped in the plane of the detector [ rad]74 // [DEFAULT]=parallel_phi=0.0 [ rad]73 /// Orientation of the longitudinal axis of the parallelepiped in the plane of the detector [deg] 74 // [DEFAULT]=parallel_phi=0.0 [deg] 75 75 double parallel_phi; 76 /// Orientation of the cross-sectional minor axis of the parallelepiped in the plane of the detector [ rad]77 // [DEFAULT]=parallel_psi=0.0 [ rad]76 /// Orientation of the cross-sectional minor axis of the parallelepiped in the plane of the detector [deg] 77 // [DEFAULT]=parallel_psi=0.0 [deg] 78 78 double parallel_psi; 79 79 -
sansmodels/src/sans/models/c_extensions/cylinder.c
rf10063e r4628e31 69 69 double alpha, vol, cos_val; 70 70 double answer; 71 //convert angle degree to radian 72 double pi = 4.0*atan(1.0); 73 double theta = pars->cyl_theta * pi/180.0; 74 double phi = pars->cyl_phi * pi/180.0; 71 75 72 76 // Cylinder orientation 73 cyl_x = sin( pars->cyl_theta) * cos(pars->cyl_phi);74 cyl_y = sin( pars->cyl_theta) * sin(pars->cyl_phi);75 cyl_z = cos( pars->cyl_theta);77 cyl_x = sin(theta) * cos(phi); 78 cyl_y = sin(theta) * sin(phi); 79 cyl_z = cos(theta); 76 80 77 81 // q vector -
sansmodels/src/sans/models/c_extensions/cylinder.h
rf10063e r4628e31 42 42 // [DEFAULT]=background=0.0 [1/cm] 43 43 double background; 44 /// Orientation of the cylinder axis w/respect incoming beam [ rad]45 // [DEFAULT]=cyl_theta= 1.0 [rad]44 /// Orientation of the cylinder axis w/respect incoming beam [deg] 45 // [DEFAULT]=cyl_theta=60.0 [deg] 46 46 double cyl_theta; 47 /// Orientation of the cylinder in the plane of the detector [ rad]48 // [DEFAULT]=cyl_phi= 1.0 [rad]47 /// Orientation of the cylinder in the plane of the detector [deg] 48 // [DEFAULT]=cyl_phi=60.0 [deg] 49 49 double cyl_phi; 50 50 -
sansmodels/src/sans/models/c_extensions/ellipsoid.c
r8f20419d r4628e31 90 90 double cyl_x, cyl_y, cyl_z; 91 91 double q_z, lenq; 92 double theta,alpha, f, vol, sin_val, cos_val;92 double alpha, f, vol, sin_val, cos_val; 93 93 double answer; 94 //convert angle degree to radian 95 double pi = 4.0*atan(1.0); 96 double theta = pars->axis_theta * pi/180.0; 97 double phi = pars->axis_phi * pi/180.0; 94 98 95 99 // Ellipsoid orientation 96 cyl_x = sin( pars->axis_theta) * cos(pars->axis_phi);97 cyl_y = sin( pars->axis_theta) * sin(pars->axis_phi);98 cyl_z = cos( pars->axis_theta);100 cyl_x = sin(theta) * cos(phi); 101 cyl_y = sin(theta) * sin(phi); 102 cyl_z = cos(theta); 99 103 100 104 // q vector -
sansmodels/src/sans/models/c_extensions/ellipsoid.h
rf10063e r4628e31 58 58 double background; 59 59 60 /// Orientation of the long axis of the ellipsoid w/respect incoming beam [ rad]61 // [DEFAULT]=axis_theta= 1.57 [rad]60 /// Orientation of the long axis of the ellipsoid w/respect incoming beam [deg] 61 // [DEFAULT]=axis_theta=90.0 [deg] 62 62 double axis_theta; 63 /// Orientation of the long axis of the ellipsoid in the plane of the detector [ rad]64 // [DEFAULT]=axis_phi=0.0 [ rad]63 /// Orientation of the long axis of the ellipsoid in the plane of the detector [deg] 64 // [DEFAULT]=axis_phi=0.0 [deg] 65 65 double axis_phi; 66 66 } EllipsoidParameters; -
sansmodels/src/sans/models/c_extensions/elliptical_cylinder.c
rf10063e r4628e31 99 99 double nu, cos_nu; 100 100 double answer; 101 //convert angle degree to radian 102 double pi = 4.0*atan(1.0); 103 double theta = pars->cyl_theta * pi/180.0; 104 double phi = pars->cyl_phi * pi/180.0; 105 double psi = pars->cyl_psi * pi/180.0; 101 106 102 107 //Cylinder orientation 103 cyl_x = sin( pars->cyl_theta) * cos(pars->cyl_phi);104 cyl_y = sin( pars->cyl_theta) * sin(pars->cyl_phi);105 cyl_z = cos( pars->cyl_theta);108 cyl_x = sin(theta) * cos(phi); 109 cyl_y = sin(theta) * sin(phi); 110 cyl_z = cos(theta); 106 111 107 112 // q vector … … 130 135 131 136 //x- y- component on the detector plane. 132 ell_x = cos(p ars->cyl_psi);133 ell_y = sin(p ars->cyl_psi);137 ell_x = cos(psi); 138 ell_y = sin(psi); 134 139 135 140 // calculate the axis of the ellipse wrt q-coord. -
sansmodels/src/sans/models/c_extensions/elliptical_cylinder.h
rf10063e r4628e31 41 41 // [DEFAULT]=background=0 [1/cm] 42 42 double background; 43 /// Orientation of the cylinder axis w/respect incoming beam [ rad]44 // [DEFAULT]=cyl_theta= 1.57 [rad]43 /// Orientation of the cylinder axis w/respect incoming beam [deg] 44 // [DEFAULT]=cyl_theta=90.0 [deg] 45 45 double cyl_theta; 46 /// Orientation of the cylinder in the plane of the detector [ rad]47 // [DEFAULT]=cyl_phi=0.0 [ rad]46 /// Orientation of the cylinder in the plane of the detector [deg] 47 // [DEFAULT]=cyl_phi=0.0 [deg] 48 48 double cyl_phi; 49 /// Orientation of major radius of the cross-section w/respect vector q [ rad]50 // [DEFAULT]=cyl_psi=0.0 [ rad]49 /// Orientation of major radius of the cross-section w/respect vector q [deg] 50 // [DEFAULT]=cyl_psi=0.0 [deg] 51 51 double cyl_psi; 52 52 } EllipticalCylinderParameters; -
sansmodels/src/sans/models/c_extensions/fcc.c
r85bb870 r4628e31 73 73 dp[3] = pars->sldSolv; 74 74 dp[4] = 0.0; 75 //convert angle degree to radian 76 double theta = pars->theta * Pi/180.0; 77 double phi = pars->phi * Pi/180.0; 78 double psi = pars->psi * Pi/180.0; 75 79 76 80 aa = pars->dnn; … … 85 89 /// instead of against q coordinate in PRB 36(46), 3(6), 1754(3854) 86 90 // b3 axis orientation 87 b3_x = sin( pars->theta) * cos(pars->phi);//negative sign here???88 b3_y = sin( pars->theta) * sin(pars->phi);89 b3_z = cos( pars->theta);91 b3_x = sin(theta) * cos(phi);//negative sign here??? 92 b3_y = sin(theta) * sin(phi); 93 b3_z = cos(theta); 90 94 cos_val_b3 = b3_x*q_x + b3_y*q_y + b3_z*q_z; 91 95 alpha = acos(cos_val_b3); 92 96 // b1 axis orientation 93 b1_x = sin(p ars->psi);94 b1_y = cos(p ars->psi);97 b1_x = sin(psi); 98 b1_y = cos(psi); 95 99 cos_val_b1 = (b1_x*q_x + b1_y*q_y); 96 100 // b2 axis orientation -
sansmodels/src/sans/models/c_extensions/fcc.h
rd5b6a9d r4628e31 57 57 // [DEFAULT]=background=0 [1/cm] 58 58 double background; 59 /// Orientation of the a1 axis w/respect incoming beam [ rad]60 // [DEFAULT]=theta=0.0 [ rad]59 /// Orientation of the a1 axis w/respect incoming beam [deg] 60 // [DEFAULT]=theta=0.0 [deg] 61 61 double theta; 62 /// Orientation of the a2 in the plane of the detector [ rad]63 // [DEFAULT]=phi=0.0 [ rad]62 /// Orientation of the a2 in the plane of the detector [deg] 63 // [DEFAULT]=phi=0.0 [deg] 64 64 double phi; 65 /// Orientation of the a3 in the plane of the detector [ rad]66 // [DEFAULT]=psi=0.0 [ rad]65 /// Orientation of the a3 in the plane of the detector [deg] 66 // [DEFAULT]=psi=0.0 [deg] 67 67 double psi; 68 68 -
sansmodels/src/sans/models/c_extensions/hollow_cylinder.c
r2339249f r4628e31 66 66 double alpha,vol, cos_val; 67 67 double answer; 68 //convert angle degree to radian 69 double pi = 4.0*atan(1.0); 70 double theta = pars->axis_theta * pi/180.0; 71 double phi = pars->axis_phi * pi/180.0; 68 72 69 73 // Cylinder orientation 70 cyl_x = sin( pars->axis_theta) * cos(pars->axis_phi);71 cyl_y = sin( pars->axis_theta) * sin(pars->axis_phi);72 cyl_z = cos( pars->axis_theta);74 cyl_x = sin(theta) * cos(phi); 75 cyl_y = sin(theta) * sin(phi); 76 cyl_z = cos(theta); 73 77 74 78 // q vector … … 94 98 95 99 //normalize by cylinder volume 96 vol= acos(-1.0)*((pars->radius*pars->radius)-(pars->core_radius *pars->core_radius))100 vol=pi*((pars->radius*pars->radius)-(pars->core_radius *pars->core_radius)) 97 101 *(pars->length); 98 answer /= vol;102 answer *= vol; 99 103 100 104 //convert to [cm-1] -
sansmodels/src/sans/models/c_extensions/hollow_cylinder.h
rf10063e r4628e31 48 48 double background; 49 49 50 /// Orientation of the long axis of the hollow cylinder w/respect incoming beam [ rad]51 // [DEFAULT]=axis_theta= 1.57 [rad]50 /// Orientation of the long axis of the hollow cylinder w/respect incoming beam [deg] 51 // [DEFAULT]=axis_theta=90.0 [deg] 52 52 double axis_theta; 53 53 54 /// Orientation of the long axis of the hollow cylinder in the plane of the detector [ rad]55 // [DEFAULT]=axis_phi=0.0 [ rad]54 /// Orientation of the long axis of the hollow cylinder in the plane of the detector [deg] 55 // [DEFAULT]=axis_phi=0.0 [deg] 56 56 double axis_phi; 57 57 -
sansmodels/src/sans/models/c_extensions/oblate.h
r27972c1d r4628e31 53 53 double background; 54 54 //Disable for now 55 /// Orientation of the oblate axis w/respect incoming beam [ rad]56 // [DEFAULT]=axis_theta= 1.0 [rad]55 /// Orientation of the oblate axis w/respect incoming beam [deg] 56 // [DEFAULT]=axis_theta=57.325 [deg] 57 57 double axis_theta; 58 /// Orientation of the oblate in the plane of the detector [ rad]59 // [DEFAULT]=axis_phi= 1.0 [rad]58 /// Orientation of the oblate in the plane of the detector [deg] 59 // [DEFAULT]=axis_phi=57.325 [deg] 60 60 double axis_phi; 61 61 -
sansmodels/src/sans/models/c_extensions/parallelepiped.c
ra1ecfc3 r4628e31 110 110 edgeC = pars->long_c; 111 111 112 //convert angle degree to radian 113 double theta = pars->parallel_theta * pi/180.0; 114 double phi = pars->parallel_phi * pi/180.0; 115 double psi = pars->parallel_psi * pi/180.0; 112 116 113 117 // parallelepiped c axis orientation 114 cparallel_x = sin( pars->parallel_theta) * cos(pars->parallel_phi);115 cparallel_y = sin( pars->parallel_theta) * sin(pars->parallel_phi);116 cparallel_z = cos( pars->parallel_theta);118 cparallel_x = sin(theta) * cos(phi); 119 cparallel_y = sin(theta) * sin(phi); 120 cparallel_z = cos(theta); 117 121 118 122 // q vector … … 125 129 126 130 // parallelepiped a axis orientation 127 parallel_x = sin(p ars->parallel_psi);//cos(pars->parallel_theta) * sin(pars->parallel_phi)*sin(pars->parallel_psi);128 parallel_y = cos(p ars->parallel_psi);//cos(pars->parallel_theta) * cos(pars->parallel_phi)*cos(pars->parallel_psi);131 parallel_x = sin(psi);//cos(pars->parallel_theta) * sin(pars->parallel_phi)*sin(pars->parallel_psi); 132 parallel_y = cos(psi);//cos(pars->parallel_theta) * cos(pars->parallel_phi)*cos(pars->parallel_psi); 129 133 130 134 cos_val_a = parallel_x*q_x + parallel_y*q_y; … … 133 137 134 138 // parallelepiped b axis orientation 135 bparallel_x = sqrt(1.0-sin( pars->parallel_theta)*cos(pars->parallel_phi))*cos(pars->parallel_psi);//cos(pars->parallel_theta) * cos(pars->parallel_phi)* cos(pars->parallel_psi);136 bparallel_y = sqrt(1.0-sin( pars->parallel_theta)*cos(pars->parallel_phi))*sin(pars->parallel_psi);//cos(pars->parallel_theta) * sin(pars->parallel_phi)* sin(pars->parallel_psi);139 bparallel_x = sqrt(1.0-sin(theta)*cos(phi))*cos(psi);//cos(pars->parallel_theta) * cos(pars->parallel_phi)* cos(pars->parallel_psi); 140 bparallel_y = sqrt(1.0-sin(theta)*cos(phi))*sin(psi);//cos(pars->parallel_theta) * sin(pars->parallel_phi)* sin(pars->parallel_psi); 137 141 // axis of the parallelepiped 138 142 cos_val_b = sin(acos(cos_val_a)) ; -
sansmodels/src/sans/models/c_extensions/parallelepiped.h
rf10063e r4628e31 45 45 // [DEFAULT]=background=0.0 [1/cm] 46 46 double background; 47 /// Orientation of the parallelepiped axis w/respect incoming beam [ rad]48 // [DEFAULT]=parallel_theta=0.0 [ rad]47 /// Orientation of the parallelepiped axis w/respect incoming beam [deg] 48 // [DEFAULT]=parallel_theta=0.0 [deg] 49 49 double parallel_theta; 50 /// Orientation of the longitudinal axis of the parallelepiped in the plane of the detector [ rad]51 // [DEFAULT]=parallel_phi=0.0 [ rad]50 /// Orientation of the longitudinal axis of the parallelepiped in the plane of the detector [deg] 51 // [DEFAULT]=parallel_phi=0.0 [deg] 52 52 double parallel_phi; 53 /// Orientation of the cross-sectional minor axis of the parallelepiped in the plane of the detector [ rad]54 // [DEFAULT]=parallel_psi=0.0 [ rad]53 /// Orientation of the cross-sectional minor axis of the parallelepiped in the plane of the detector [deg] 54 // [DEFAULT]=parallel_psi=0.0 [deg] 55 55 double parallel_psi; 56 56 -
sansmodels/src/sans/models/c_extensions/sc.c
r18f2ca1 r4628e31 73 73 dp[4] = 0.0; 74 74 75 //convert angle degree to radian 76 double theta = pars->theta * Pi/180.0; 77 double phi = pars->phi * Pi/180.0; 78 double psi = pars->psi * Pi/180.0; 79 75 80 aa = pars->dnn; 76 81 Da = pars->d_factor*aa; … … 80 85 /// Angles here are respect to detector coordinate instead of against q coordinate(PRB 36, 3, 1754) 81 86 // a3 axis orientation 82 a3_x = sin( pars->theta) * cos(pars->phi);//negative sign here???83 a3_y = sin( pars->theta) * sin(pars->phi);84 a3_z = cos( pars->theta);87 a3_x = sin(theta) * cos(phi);//negative sign here??? 88 a3_y = sin(theta) * sin(phi); 89 a3_z = cos(theta); 85 90 86 91 // q vector … … 93 98 a3_dot_q = aa*q*cos_val_a3; 94 99 // a1 axis orientation 95 a1_x = sin(p ars->psi);96 a1_y = cos(p ars->psi);100 a1_x = sin(psi); 101 a1_y = cos(psi); 97 102 98 103 cos_val_a1 = a1_x*q_x + a1_y*q_y; … … 100 105 101 106 // a2 axis orientation 102 a2_x = sqrt(1.0-sin( pars->theta)*cos(pars->phi))*cos(pars->psi);103 a2_y = sqrt(1.0-sin( pars->theta)*cos(pars->phi))*sin(pars->psi);107 a2_x = sqrt(1.0-sin(theta)*cos(phi))*cos(psi); 108 a2_y = sqrt(1.0-sin(theta)*cos(phi))*sin(psi); 104 109 // a2 axis 105 110 cos_val_a2 = sin(acos(cos_val_a1));//a2_x*q_x + a2_y*q_y; -
sansmodels/src/sans/models/c_extensions/sc.h
rd5b6a9d r4628e31 57 57 // [DEFAULT]=background=0 [1/cm] 58 58 double background; 59 /// Orientation of the a1 axis w/respect incoming beam [ rad]60 // [DEFAULT]=theta=0.0 [ rad]59 /// Orientation of the a1 axis w/respect incoming beam [deg] 60 // [DEFAULT]=theta=0.0 [deg] 61 61 double theta; 62 /// Orientation of the a2 in the plane of the detector [ rad]63 // [DEFAULT]=phi=0.0 [ rad]62 /// Orientation of the a2 in the plane of the detector [deg] 63 // [DEFAULT]=phi=0.0 [deg] 64 64 double phi; 65 /// Orientation of the a3 in the plane of the detector [ rad]66 // [DEFAULT]=psi=0.0 [ rad]65 /// Orientation of the a3 in the plane of the detector [deg] 66 // [DEFAULT]=psi=0.0 [deg] 67 67 double psi; 68 68 -
sansmodels/src/sans/models/c_extensions/spheroid.c
rf10063e r4628e31 75 75 double sldcs,sldss; 76 76 77 //convert angle degree to radian 78 double theta = pars->axis_theta * Pi/180.0; 79 double phi = pars->axis_phi * Pi/180.0; 80 81 77 82 // ellipsoid orientation, the axis of the rotation is consistent with the ploar axis. 78 cyl_x = sin( pars->axis_theta) * cos(pars->axis_phi);79 cyl_y = sin( pars->axis_theta) * sin(pars->axis_phi);80 cyl_z = cos( pars->axis_theta);83 cyl_x = sin(theta) * cos(phi); 84 cyl_y = sin(theta) * sin(phi); 85 cyl_z = cos(theta); 81 86 //del sld 82 87 sldcs = pars->sld_core - pars->sld_shell; -
sansmodels/src/sans/models/c_extensions/spheroid.h
rf10063e r4628e31 59 59 double background; 60 60 //Disable for now 61 /// Orientation of the oblate axis w/respect incoming beam [ rad]62 // [DEFAULT]=axis_theta=0.0 [ rad]61 /// Orientation of the oblate axis w/respect incoming beam [deg] 62 // [DEFAULT]=axis_theta=0.0 [deg] 63 63 double axis_theta; 64 /// Orientation of the oblate in the plane of the detector [ rad]65 // [DEFAULT]=axis_phi=0.0 [ rad]64 /// Orientation of the oblate in the plane of the detector [deg] 65 // [DEFAULT]=axis_phi=0.0 [deg] 66 66 double axis_phi; 67 67 -
sansmodels/src/sans/models/c_extensions/triaxial_ellipsoid.c
r8f20419d r4628e31 90 90 double alpha, vol, cos_val; 91 91 double answer; 92 double pi = acos(-1.0); 92 double pi = 4.0*atan(1.0); 93 94 //convert angle degree to radian 95 double theta = pars->axis_theta * pi/180.0; 96 double phi = pars->axis_phi * pi/180.0; 97 double psi = pars->axis_psi * pi/180.0; 98 93 99 // Cylinder orientation 94 cyl_x = sin( pars->axis_theta) * cos(pars->axis_phi);95 cyl_y = sin( pars->axis_theta) * sin(pars->axis_phi);96 cyl_z = cos( pars->axis_theta);100 cyl_x = sin(theta) * cos(phi); 101 cyl_y = sin(theta) * sin(phi); 102 cyl_z = cos(theta); 97 103 98 104 // q vector … … 123 129 124 130 //x- y- component on the detector plane. 125 ell_x = cos(p ars->axis_psi);126 ell_y = sin(p ars->axis_psi);131 ell_x = cos(psi); 132 ell_y = sin(psi); 127 133 128 134 // calculate the axis of the ellipse wrt q-coord. -
sansmodels/src/sans/models/c_extensions/triaxial_ellipsoid.h
r186c4eb r4628e31 33 33 // [DEFAULT]=background=0.0 [1/cm] 34 34 double background; 35 /// Orientation of the triaxial_ellipsoid axis w/respect incoming beam [ rad]36 // [DEFAULT]=axis_theta= 1.0 [rad]35 /// Orientation of the triaxial_ellipsoid axis w/respect incoming beam [deg] 36 // [DEFAULT]=axis_theta=57.325 [deg] 37 37 double axis_theta; 38 /// Orientation of the triaxial_ellipsoid in the plane of the detector [ rad]39 // [DEFAULT]=axis_phi= 1.0 [rad]38 /// Orientation of the triaxial_ellipsoid in the plane of the detector [deg] 39 // [DEFAULT]=axis_phi=57.325 [deg] 40 40 double axis_phi; 41 /// Orientation of the cross section of the triaxial_ellipsoid in the plane of the detector [ rad]42 // [DEFAULT]=axis_psi=0.0 [ rad]41 /// Orientation of the cross section of the triaxial_ellipsoid in the plane of the detector [deg] 42 // [DEFAULT]=axis_psi=0.0 [deg] 43 43 double axis_psi; 44 44
Note: See TracChangeset
for help on using the changeset viewer.