Changeset 4628e31 in sasview for sansmodels/src/sans/models
- 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
- Files:
-
- 66 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/BCCrystalModel.py
rd5b6a9d r4628e31 43 43 sldSolv = 6.3e-006 [1/A^(2)] 44 44 background = 0.0 [1/cm] 45 theta = 0.0 [ rad]46 phi = 0.0 [ rad]47 psi = 0.0 [ rad]45 theta = 0.0 [deg] 46 phi = 0.0 [deg] 47 psi = 0.0 [deg] 48 48 49 49 """ … … 87 87 self.details['sldSolv'] = ['[1/A^(2)]', None, None] 88 88 self.details['background'] = ['[1/cm]', None, None] 89 self.details['theta'] = ['[ rad]', None, None]90 self.details['phi'] = ['[ rad]', None, None]91 self.details['psi'] = ['[ rad]', None, None]89 self.details['theta'] = ['[deg]', None, None] 90 self.details['phi'] = ['[deg]', None, None] 91 self.details['psi'] = ['[deg]', None, None] 92 92 93 93 ## fittable parameters -
sansmodels/src/sans/models/BarBellModel.py
r339ce67 r4628e31 43 43 sld_solv = 6.3e-006 [1/A^(2)] 44 44 background = 0.0 [1/cm] 45 theta = 0.0 [ rad]46 phi = 0.0 [ rad]45 theta = 0.0 [deg] 46 phi = 0.0 [deg] 47 47 48 48 """ … … 86 86 self.details['sld_solv'] = ['[1/A^(2)]', None, None] 87 87 self.details['background'] = ['[1/cm]', None, None] 88 self.details['theta'] = ['[ rad]', None, None]89 self.details['phi'] = ['[ rad]', None, None]88 self.details['theta'] = ['[deg]', None, None] 89 self.details['phi'] = ['[deg]', None, None] 90 90 91 91 ## fittable parameters -
sansmodels/src/sans/models/CSParallelepipedModel.py
r18f2ca1 r4628e31 49 49 sld_solv = 6e-006 [1/A^(2)] 50 50 background = 0.06 [1/cm] 51 parallel_theta = 0.0 [ rad]52 parallel_phi = 0.0 [ rad]53 parallel_psi = 0.0 [ rad]51 parallel_theta = 0.0 [deg] 52 parallel_phi = 0.0 [deg] 53 parallel_psi = 0.0 [deg] 54 54 55 55 """ … … 95 95 self.details['sld_solv'] = ['[1/A^(2)]', None, None] 96 96 self.details['background'] = ['[1/cm]', None, None] 97 self.details['parallel_theta'] = ['[ rad]', None, None]98 self.details['parallel_phi'] = ['[ rad]', None, None]99 self.details['parallel_psi'] = ['[ rad]', None, None]97 self.details['parallel_theta'] = ['[deg]', None, None] 98 self.details['parallel_phi'] = ['[deg]', None, None] 99 self.details['parallel_psi'] = ['[deg]', None, None] 100 100 101 101 ## fittable parameters -
sansmodels/src/sans/models/CappedCylinderModel.py
r18f2ca1 r4628e31 43 43 sld_solv = 6.3e-006 [1/A^(2)] 44 44 background = 0.0 [1/cm] 45 theta = 0.0 [ rad]46 phi = 0.0 [ rad]45 theta = 0.0 [deg] 46 phi = 0.0 [deg] 47 47 48 48 """ … … 84 84 self.details['sld_solv'] = ['[1/A^(2)]', None, None] 85 85 self.details['background'] = ['[1/cm]', None, None] 86 self.details['theta'] = ['[ rad]', None, None]87 self.details['phi'] = ['[ rad]', None, None]86 self.details['theta'] = ['[deg]', None, None] 87 self.details['phi'] = ['[deg]', None, None] 88 88 89 89 ## fittable parameters -
sansmodels/src/sans/models/CoreShellCylinderModel.py
r35aface r4628e31 44 44 solvent_sld = 1e-006 [1/A^(2)] 45 45 background = 0.0 [1/cm] 46 axis_theta = 1.57 [rad]47 axis_phi = 0.0 [ rad]46 axis_theta = 90.0 [deg] 47 axis_phi = 0.0 [deg] 48 48 49 49 """ … … 94 94 self.details['solvent_sld'] = ['[1/A^(2)]', None, None] 95 95 self.details['background'] = ['[1/cm]', None, None] 96 self.details['axis_theta'] = ['[ rad]', None, None]97 self.details['axis_phi'] = ['[ rad]', None, None]96 self.details['axis_theta'] = ['[deg]', None, None] 97 self.details['axis_phi'] = ['[deg]', None, None] 98 98 99 99 ## fittable parameters -
sansmodels/src/sans/models/CoreShellEllipsoidModel.py
r35aface r4628e31 45 45 sld_solvent = 6.3e-006 [1/A^(2)] 46 46 background = 0.001 [1/cm] 47 axis_theta = 0.0 [ rad]48 axis_phi = 0.0 [ rad]47 axis_theta = 0.0 [deg] 48 axis_phi = 0.0 [deg] 49 49 50 50 """ … … 92 92 self.details['sld_solvent'] = ['[1/A^(2)]', None, None] 93 93 self.details['background'] = ['[1/cm]', None, None] 94 self.details['axis_theta'] = ['[ rad]', None, None]95 self.details['axis_phi'] = ['[ rad]', None, None]94 self.details['axis_theta'] = ['[deg]', None, None] 95 self.details['axis_phi'] = ['[deg]', None, None] 96 96 97 97 ## fittable parameters -
sansmodels/src/sans/models/CylinderModel.py
r35aface r4628e31 42 42 sldSolv = 1e-006 [1/A^(2)] 43 43 background = 0.0 [1/cm] 44 cyl_theta = 1.0 [rad]45 cyl_phi = 1.0 [rad]44 cyl_theta = 60.0 [deg] 45 cyl_phi = 60.0 [deg] 46 46 47 47 """ … … 79 79 self.details['sldSolv'] = ['[1/A^(2)]', None, None] 80 80 self.details['background'] = ['[1/cm]', None, None] 81 self.details['cyl_theta'] = ['[ rad]', None, None]82 self.details['cyl_phi'] = ['[ rad]', None, None]81 self.details['cyl_theta'] = ['[deg]', None, None] 82 self.details['cyl_phi'] = ['[deg]', None, None] 83 83 84 84 ## fittable parameters -
sansmodels/src/sans/models/EllipsoidModel.py
r35aface r4628e31 42 42 sldSolv = 1e-006 [1/A^(2)] 43 43 background = 0.0 [1/cm] 44 axis_theta = 1.57 [rad]45 axis_phi = 0.0 [ rad]44 axis_theta = 90.0 [deg] 45 axis_phi = 0.0 [deg] 46 46 47 47 """ … … 83 83 self.details['sldSolv'] = ['[1/A^(2)]', None, None] 84 84 self.details['background'] = ['[1/cm]', None, None] 85 self.details['axis_theta'] = ['[ rad]', None, None]86 self.details['axis_phi'] = ['[ rad]', None, None]85 self.details['axis_theta'] = ['[deg]', None, None] 86 self.details['axis_phi'] = ['[deg]', None, None] 87 87 88 88 ## fittable parameters -
sansmodels/src/sans/models/EllipticalCylinderModel.py
r35aface r4628e31 43 43 sldSolv = 1e-006 [1/A^(2)] 44 44 background = 0.0 [1/cm] 45 cyl_theta = 1.57 [rad]46 cyl_phi = 0.0 [ rad]47 cyl_psi = 0.0 [ rad]45 cyl_theta = 90.0 [deg] 46 cyl_phi = 0.0 [deg] 47 cyl_psi = 0.0 [deg] 48 48 49 49 """ … … 75 75 self.details['sldSolv'] = ['[1/A^(2)]', None, None] 76 76 self.details['background'] = ['[1/cm]', None, None] 77 self.details['cyl_theta'] = ['[ rad]', None, None]78 self.details['cyl_phi'] = ['[ rad]', None, None]79 self.details['cyl_psi'] = ['[ rad]', None, None]77 self.details['cyl_theta'] = ['[deg]', None, None] 78 self.details['cyl_phi'] = ['[deg]', None, None] 79 self.details['cyl_psi'] = ['[deg]', None, None] 80 80 81 81 ## fittable parameters -
sansmodels/src/sans/models/FCCrystalModel.py
rd5b6a9d r4628e31 43 43 sldSolv = 6.3e-006 [1/A^(2)] 44 44 background = 0.0 [1/cm] 45 theta = 0.0 [ rad]46 phi = 0.0 [ rad]47 psi = 0.0 [ rad]45 theta = 0.0 [deg] 46 phi = 0.0 [deg] 47 psi = 0.0 [deg] 48 48 49 49 """ … … 87 87 self.details['sldSolv'] = ['[1/A^(2)]', None, None] 88 88 self.details['background'] = ['[1/cm]', None, None] 89 self.details['theta'] = ['[ rad]', None, None]90 self.details['phi'] = ['[ rad]', None, None]91 self.details['psi'] = ['[ rad]', None, None]89 self.details['theta'] = ['[deg]', None, None] 90 self.details['phi'] = ['[deg]', None, None] 91 self.details['psi'] = ['[deg]', None, None] 92 92 93 93 ## fittable parameters -
sansmodels/src/sans/models/HollowCylinderModel.py
r35aface r4628e31 43 43 sldSolv = 1e-006 [1/A^(2)] 44 44 background = 0.01 [1/cm] 45 axis_theta = 1.57 [rad]46 axis_phi = 0.0 [ rad]45 axis_theta = 90.0 [deg] 46 axis_phi = 0.0 [deg] 47 47 48 48 """ … … 75 75 self.details['sldSolv'] = ['[1/A^(2)]', None, None] 76 76 self.details['background'] = ['[1/cm]', None, None] 77 self.details['axis_theta'] = ['[ rad]', None, None]78 self.details['axis_phi'] = ['[ rad]', None, None]77 self.details['axis_theta'] = ['[deg]', None, None] 78 self.details['axis_phi'] = ['[deg]', None, None] 79 79 80 80 ## fittable parameters -
sansmodels/src/sans/models/OblateModel.py
r35aface r4628e31 44 44 sld_solvent = 6.3e-006 [1/A^(2)] 45 45 background = 0.001 [1/cm] 46 axis_theta = 1.0 [rad]47 axis_phi = 1.0 [rad]46 axis_theta = 57.325 [deg] 47 axis_phi = 57.325 [deg] 48 48 49 49 """ … … 87 87 self.details['sld_solvent'] = ['[1/A^(2)]', None, None] 88 88 self.details['background'] = ['[1/cm]', None, None] 89 self.details['axis_theta'] = ['[ rad]', None, None]90 self.details['axis_phi'] = ['[ rad]', None, None]89 self.details['axis_theta'] = ['[deg]', None, None] 90 self.details['axis_phi'] = ['[deg]', None, None] 91 91 92 92 ## fittable parameters -
sansmodels/src/sans/models/ParallelepipedModel.py
r35aface r4628e31 43 43 sldSolv = 1e-006 [1/A^(2)] 44 44 background = 0.0 [1/cm] 45 parallel_theta = 0.0 [ rad]46 parallel_phi = 0.0 [ rad]47 parallel_psi = 0.0 [ rad]45 parallel_theta = 0.0 [deg] 46 parallel_phi = 0.0 [deg] 47 parallel_psi = 0.0 [deg] 48 48 49 49 """ … … 78 78 self.details['sldSolv'] = ['[1/A^(2)]', None, None] 79 79 self.details['background'] = ['[1/cm]', None, None] 80 self.details['parallel_theta'] = ['[ rad]', None, None]81 self.details['parallel_phi'] = ['[ rad]', None, None]82 self.details['parallel_psi'] = ['[ rad]', None, None]80 self.details['parallel_theta'] = ['[deg]', None, None] 81 self.details['parallel_phi'] = ['[deg]', None, None] 82 self.details['parallel_psi'] = ['[deg]', None, None] 83 83 84 84 ## fittable parameters -
sansmodels/src/sans/models/SCCrystalModel.py
rd5b6a9d r4628e31 43 43 sldSolv = 6.3e-006 [1/A^(2)] 44 44 background = 0.0 [1/cm] 45 theta = 0.0 [ rad]46 phi = 0.0 [ rad]47 psi = 0.0 [ rad]45 theta = 0.0 [deg] 46 phi = 0.0 [deg] 47 psi = 0.0 [deg] 48 48 49 49 """ … … 87 87 self.details['sldSolv'] = ['[1/A^(2)]', None, None] 88 88 self.details['background'] = ['[1/cm]', None, None] 89 self.details['theta'] = ['[ rad]', None, None]90 self.details['phi'] = ['[ rad]', None, None]91 self.details['psi'] = ['[ rad]', None, None]89 self.details['theta'] = ['[deg]', None, None] 90 self.details['phi'] = ['[deg]', None, None] 91 self.details['psi'] = ['[deg]', None, None] 92 92 93 93 ## fittable parameters -
sansmodels/src/sans/models/TriaxialEllipsoidModel.py
r35aface r4628e31 43 43 sldSolv = 6.3e-006 [1/A^(2)] 44 44 background = 0.0 [1/cm] 45 axis_theta = 1.0 [rad]46 axis_phi = 1.0 [rad]47 axis_psi = 0.0 [ rad]45 axis_theta = 57.325 [deg] 46 axis_phi = 57.325 [deg] 47 axis_psi = 0.0 [deg] 48 48 49 49 """ … … 72 72 self.details['sldSolv'] = ['[1/A^(2)]', None, None] 73 73 self.details['background'] = ['[1/cm]', None, None] 74 self.details['axis_theta'] = ['[ rad]', None, None]75 self.details['axis_phi'] = ['[ rad]', None, None]76 self.details['axis_psi'] = ['[ rad]', None, None]74 self.details['axis_theta'] = ['[deg]', None, None] 75 self.details['axis_phi'] = ['[deg]', None, None] 76 self.details['axis_psi'] = ['[deg]', None, None] 77 77 78 78 ## fittable parameters -
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 -
sansmodels/src/sans/models/c_models/CCoreShellCylinderModel.cpp
r35aface r4628e31 91 91 // Initialize parameter dictionary 92 92 PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000)); 93 PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d", 1.570000000000));93 PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d",90.000000000000)); 94 94 PyDict_SetItemString(self->params,"solvent_sld",Py_BuildValue("d",0.000001000000)); 95 95 PyDict_SetItemString(self->params,"thickness",Py_BuildValue("d",10.000000000000)); -
sansmodels/src/sans/models/c_models/CCylinderModel.cpp
r35aface r4628e31 92 92 PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000)); 93 93 PyDict_SetItemString(self->params,"sldCyl",Py_BuildValue("d",0.000004000000)); 94 PyDict_SetItemString(self->params,"cyl_theta",Py_BuildValue("d", 1.000000000000));94 PyDict_SetItemString(self->params,"cyl_theta",Py_BuildValue("d",60.000000000000)); 95 95 PyDict_SetItemString(self->params,"length",Py_BuildValue("d",400.000000000000)); 96 96 PyDict_SetItemString(self->params,"sldSolv",Py_BuildValue("d",0.000001000000)); 97 97 PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000)); 98 98 PyDict_SetItemString(self->params,"radius",Py_BuildValue("d",20.000000000000)); 99 PyDict_SetItemString(self->params,"cyl_phi",Py_BuildValue("d", 1.000000000000));99 PyDict_SetItemString(self->params,"cyl_phi",Py_BuildValue("d",60.000000000000)); 100 100 // Initialize dispersion / averaging parameter dict 101 101 DispersionVisitor* visitor = new DispersionVisitor(); -
sansmodels/src/sans/models/c_models/CEllipsoidModel.cpp
r35aface r4628e31 91 91 // Initialize parameter dictionary 92 92 PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000)); 93 PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d", 1.570000000000));93 PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d",90.000000000000)); 94 94 PyDict_SetItemString(self->params,"radius_b",Py_BuildValue("d",400.000000000000)); 95 95 PyDict_SetItemString(self->params,"radius_a",Py_BuildValue("d",20.000000000000)); -
sansmodels/src/sans/models/c_models/CEllipticalCylinderModel.cpp
r35aface r4628e31 97 97 PyDict_SetItemString(self->params,"sldSolv",Py_BuildValue("d",0.000001000000)); 98 98 PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000)); 99 PyDict_SetItemString(self->params,"cyl_theta",Py_BuildValue("d", 1.570000000000));99 PyDict_SetItemString(self->params,"cyl_theta",Py_BuildValue("d",90.000000000000)); 100 100 PyDict_SetItemString(self->params,"r_ratio",Py_BuildValue("d",1.500000000000)); 101 101 PyDict_SetItemString(self->params,"cyl_phi",Py_BuildValue("d",0.000000000000)); -
sansmodels/src/sans/models/c_models/CHollowCylinderModel.cpp
r35aface r4628e31 93 93 PyDict_SetItemString(self->params,"sldCyl",Py_BuildValue("d",0.000006300000)); 94 94 PyDict_SetItemString(self->params,"core_radius",Py_BuildValue("d",20.000000000000)); 95 PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d", 1.570000000000));95 PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d",90.000000000000)); 96 96 PyDict_SetItemString(self->params,"length",Py_BuildValue("d",400.000000000000)); 97 97 PyDict_SetItemString(self->params,"axis_phi",Py_BuildValue("d",0.000000000000)); -
sansmodels/src/sans/models/c_models/COblateModel.cpp
r35aface r4628e31 93 93 PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000)); 94 94 PyDict_SetItemString(self->params,"minor_core",Py_BuildValue("d",20.000000000000)); 95 PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d", 1.000000000000));95 PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d",57.325000000000)); 96 96 PyDict_SetItemString(self->params,"sld_solvent",Py_BuildValue("d",0.000006300000)); 97 PyDict_SetItemString(self->params,"axis_phi",Py_BuildValue("d", 1.000000000000));97 PyDict_SetItemString(self->params,"axis_phi",Py_BuildValue("d",57.325000000000)); 98 98 PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.001000000000)); 99 99 PyDict_SetItemString(self->params,"major_shell",Py_BuildValue("d",250.000000000000)); -
sansmodels/src/sans/models/c_models/CTriaxialEllipsoidModel.cpp
r35aface r4628e31 92 92 PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000)); 93 93 PyDict_SetItemString(self->params,"axis_psi",Py_BuildValue("d",0.000000000000)); 94 PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d", 1.000000000000));94 PyDict_SetItemString(self->params,"axis_theta",Py_BuildValue("d",57.325000000000)); 95 95 PyDict_SetItemString(self->params,"semi_axisA",Py_BuildValue("d",35.000000000000)); 96 96 PyDict_SetItemString(self->params,"semi_axisB",Py_BuildValue("d",100.000000000000)); 97 97 PyDict_SetItemString(self->params,"semi_axisC",Py_BuildValue("d",400.000000000000)); 98 PyDict_SetItemString(self->params,"axis_phi",Py_BuildValue("d", 1.000000000000));98 PyDict_SetItemString(self->params,"axis_phi",Py_BuildValue("d",57.325000000000)); 99 99 PyDict_SetItemString(self->params,"sldSolv",Py_BuildValue("d",0.000006300000)); 100 100 PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000)); -
sansmodels/src/sans/models/c_models/barbell.cpp
r85bb870 r4628e31 198 198 } 199 199 if (weights_theta.size()>1) { 200 _ptvalue *= fabs(sin(weights_theta[l].value ));200 _ptvalue *= fabs(sin(weights_theta[l].value*pi/180.0)); 201 201 } 202 202 sum += _ptvalue; -
sansmodels/src/sans/models/c_models/bcc.cpp
r85bb870 r4628e31 118 118 dp.phi = phi(); 119 119 dp.psi = psi(); 120 120 double pi = 4.0*atan(1.0); 121 121 // Get the dispersion points for the radius 122 122 vector<WeightPoint> weights_rad; … … 166 166 } 167 167 if (weights_theta.size()>1) { 168 _ptvalue *= fabs(sin(weights_theta[j].value ));168 _ptvalue *= fabs(sin(weights_theta[j].value*pi/180.0)); 169 169 } 170 170 sum += _ptvalue; -
sansmodels/src/sans/models/c_models/capcyl.cpp
r85bb870 r4628e31 135 135 dp.theta = theta(); 136 136 dp.phi = phi(); 137 138 137 139 138 // Get the dispersion points for the rad_bar … … 198 197 } 199 198 if (weights_theta.size()>1) { 200 _ptvalue *= fabs(sin(weights_theta[l].value ));199 _ptvalue *= fabs(sin(weights_theta[l].value*pi/180.0)); 201 200 } 202 201 sum += _ptvalue; -
sansmodels/src/sans/models/c_models/coreshellcylinder.cpp
r85bb870 r4628e31 45 45 solvent_sld= Parameter(1.e-6); 46 46 background = Parameter(0.0); 47 axis_theta = Parameter( 0.0, true);47 axis_theta = Parameter(90.0, true); 48 48 axis_phi = Parameter(0.0, true); 49 49 } … … 167 167 double norm_vol = 0.0; 168 168 double vol = 0.0; 169 169 double pi = 4.0*atan(1.0); 170 170 // Loop over radius weight points 171 171 for(int i=0; i<weights_rad.size(); i++) { … … 199 199 200 200 if (weights_theta.size()>1) { 201 _ptvalue *= fabs(sin(weights_theta[k].value ));201 _ptvalue *= fabs(sin(weights_theta[k].value*pi/180.0)); 202 202 } 203 203 sum += _ptvalue; -
sansmodels/src/sans/models/c_models/csparallelepiped.cpp
r85bb870 r4628e31 188 188 double norm_vol = 0.0; 189 189 double vol = 0.0; 190 double pi = 4.0*atan(1.0); 190 191 191 192 // Loop over radius weight points … … 224 225 225 226 if (weights_parallel_theta.size()>1) { 226 _ptvalue *= fabs(sin(weights_parallel_theta[l].value ));227 _ptvalue *= fabs(sin(weights_parallel_theta[l].value*pi/180.0)); 227 228 } 228 229 sum += _ptvalue; -
sansmodels/src/sans/models/c_models/cylinder.cpp
r85bb870 r4628e31 142 142 double norm_vol = 0.0; 143 143 double vol = 0.0; 144 144 double pi = 4.0*atan(1.0); 145 145 // Loop over radius weight points 146 146 for(int i=0; i<weights_rad.size(); i++) { … … 167 167 *pow(weights_rad[i].value,2)*weights_len[j].value; 168 168 if (weights_theta.size()>1) { 169 _ptvalue *= fabs(sin(weights_theta[k].value ));169 _ptvalue *= fabs(sin(weights_theta[k].value*pi/180.0)); 170 170 } 171 171 sum += _ptvalue; -
sansmodels/src/sans/models/c_models/ellipsoid.cpp
r85bb870 r4628e31 42 42 sldSolv = Parameter(1.e-6); 43 43 background = Parameter(0.0); 44 axis_theta = Parameter( 1.57, true);44 axis_theta = Parameter(57.325, true); 45 45 axis_phi = Parameter(0.0, true); 46 46 } … … 145 145 double norm_vol = 0.0; 146 146 double vol = 0.0; 147 147 double pi = 4.0*atan(1.0); 148 148 // Loop over radius weight points 149 149 for(int i=0; i<weights_rad_a.size(); i++) { … … 170 170 * pow(weights_rad_b[j].value,2) * weights_rad_a[i].value; 171 171 if (weights_theta.size()>1) { 172 _ptvalue *= fabs(sin(weights_theta[k].value ));172 _ptvalue *= fabs(sin(weights_theta[k].value*pi/180.0)); 173 173 } 174 174 sum += _ptvalue; -
sansmodels/src/sans/models/c_models/ellipticalcylinder.cpp
r85bb870 r4628e31 44 44 sldSolv = Parameter(1.e-6); 45 45 background = Parameter(0.0); 46 cyl_theta = Parameter( 1.57, true);46 cyl_theta = Parameter(57.325, true); 47 47 cyl_phi = Parameter(0.0, true); 48 48 cyl_psi = Parameter(0.0, true); … … 170 170 double norm_vol = 0.0; 171 171 double vol = 0.0; 172 172 double pi = 4.0*atan(1.0); 173 173 // Loop over minor radius weight points 174 174 for(int i=0; i<weights_rad.size(); i++) { … … 207 207 * weights_rat[m].value; 208 208 if (weights_theta.size()>1) { 209 _ptvalue *= fabs(sin(weights_theta[k].value ));209 _ptvalue *= fabs(sin(weights_theta[k].value*pi/180.0)); 210 210 } 211 211 sum += _ptvalue; -
sansmodels/src/sans/models/c_models/fcc.cpp
r85bb870 r4628e31 140 140 double norm_vol = 0.0; 141 141 double vol = 0.0; 142 142 double pi = 4.0*atan(1.0); 143 143 // Loop over radius weight points 144 144 for(int i=0; i<weights_rad.size(); i++) { … … 165 165 } 166 166 if (weights_theta.size()>1) { 167 _ptvalue *= fabs(sin(weights_theta[j].value ));167 _ptvalue *= fabs(sin(weights_theta[j].value*pi/180.0)); 168 168 } 169 169 sum += _ptvalue; -
sansmodels/src/sans/models/c_models/hollowcylinder.cpp
r85bb870 r4628e31 164 164 double norm_vol = 0.0; 165 165 double vol = 0.0; 166 166 double pi = 4.0*atan(1.0); 167 167 // Loop over core radius weight points 168 168 for(int i=0; i<(int)weights_core_radius.size(); i++) { … … 192 192 * weights_phi[l].weight 193 193 * hollow_cylinder_analytical_2DXY(&dp, qx, qy) 194 *(pow(weights_radius[m].value,2)-pow(weights_core_radius[i].value,2))195 * weights_length[j].value ;194 / ((pow(weights_radius[m].value,2)-pow(weights_core_radius[i].value,2)) 195 * weights_length[j].value); 196 196 if (weights_theta.size()>1) { 197 _ptvalue *= fabs(sin(weights_theta[k].value ));197 _ptvalue *= fabs(sin(weights_theta[k].value * pi/180.0)); 198 198 } 199 199 sum += _ptvalue; … … 201 201 vol += weights_core_radius[i].weight 202 202 * weights_length[j].weight 203 * weights_radius[ k].weight203 * weights_radius[m].weight 204 204 * (pow(weights_radius[m].value,2)-pow(weights_core_radius[i].value,2)) 205 205 * weights_length[j].value; … … 223 223 // factor to account for the sin(theta) term in the 224 224 // integration (see documentation). 225 if (weights_theta.size()>1) norm = norm /asin(1.0);226 if (vol != 0.0 &&norm_vol != 0.0) {225 if (weights_theta.size()>1) norm = norm/asin(1.0); 226 if (vol != 0.0 || norm_vol != 0.0) { 227 227 //Re-normalize by avg volume 228 sum = sum /(vol/norm_vol);}228 sum = sum*(vol/norm_vol);} 229 229 return sum/norm + background(); 230 230 } -
sansmodels/src/sans/models/c_models/parallelepiped.cpp
r85bb870 r4628e31 172 172 double norm_vol = 0.0; 173 173 double vol = 0.0; 174 174 double pi = 4.0*atan(1.0); 175 175 // Loop over radius weight points 176 176 for(int i=0; i< (int)weights_short_a.size(); i++) { … … 208 208 209 209 if (weights_parallel_theta.size()>1) { 210 _ptvalue *= fabs(sin(weights_parallel_theta[l].value ));210 _ptvalue *= fabs(sin(weights_parallel_theta[l].value*pi/180.0)); 211 211 } 212 212 sum += _ptvalue; -
sansmodels/src/sans/models/c_models/sc.cpp
r85bb870 r4628e31 140 140 double norm_vol = 0.0; 141 141 double vol = 0.0; 142 142 double pi = 4.0*atan(1.0); 143 143 // Loop over radius weight points 144 144 for(int i=0; i<weights_rad.size(); i++) { … … 165 165 } 166 166 if (weights_theta.size()>1) { 167 _ptvalue *= fabs(sin(weights_theta[j].value ));167 _ptvalue *= fabs(sin(weights_theta[j].value*pi/180.0)); 168 168 } 169 169 sum += _ptvalue; -
sansmodels/src/sans/models/c_models/spheroid.cpp
r85bb870 r4628e31 209 209 double norm_vol = 0.0; 210 210 double vol = 0.0; 211 211 double pi = 4.0*atan(1.0); 212 212 // Loop over major core weight points 213 213 for(int i=0; i< (int)weights_equat_core.size(); i++) { … … 241 241 * pow(weights_equat_shell[k].value,2)*weights_polar_shell[l].value; 242 242 if (weights_theta.size()>1) { 243 _ptvalue *= fabs(sin(weights_theta[m].value ));243 _ptvalue *= fabs(sin(weights_theta[m].value*pi/180.0)); 244 244 } 245 245 sum += _ptvalue; -
sansmodels/src/sans/models/c_models/triaxialellipsoid.cpp
r85bb870 r4628e31 44 44 sldSolv = Parameter(6.3e-6); 45 45 background = Parameter(0.0); 46 axis_theta = Parameter( 1.0, true);47 axis_phi = Parameter( 1.0, true);46 axis_theta = Parameter(57.325, true); 47 axis_phi = Parameter(57.325, true); 48 48 axis_psi = Parameter(0.0, true); 49 49 } … … 166 166 double norm_vol = 0.0; 167 167 double vol = 0.0; 168 168 double pi = 4.0*atan(1.0); 169 169 // Loop over semi axis A weight points 170 170 for(int i=0; i< (int)weights_semi_axisA.size(); i++) { … … 199 199 * weights_semi_axisA[i].value*weights_semi_axisB[j].value*weights_semi_axisC[k].value; 200 200 if (weights_theta.size()>1) { 201 _ptvalue *= fabs(sin(weights_theta[k].value ));201 _ptvalue *= fabs(sin(weights_theta[k].value*pi/180.0)); 202 202 } 203 203 sum += _ptvalue; -
sansmodels/src/sans/models/test/validate_2D_3axes_shape_model.py
rbda194e3 r4628e31 91 91 weight = 0.0 92 92 for i_theta in range(npts): 93 theta = math.pi/npts*(i_theta+1)93 theta = 180.0/npts*(i_theta+1) 94 94 95 95 model.setParam(theta_label, theta) 96 96 97 97 for j in range(npts_alpha): 98 model.setParam(phi_label, math.pi* 2.0 / npts_alpha * j)98 model.setParam(phi_label, 180.0 * 2.0 / npts_alpha * j) 99 99 for k in range(npts): 100 model.setParam(psi_label, math.pi* 2.0 / npts * k)100 model.setParam(psi_label, 180.0 * 2.0 / npts * k) 101 101 if str(model.run([q, 0])).count("INF")>0: 102 print "ERROR", q, theta, math.pi* 2.0 / npts * k102 print "ERROR", q, theta, 180.0 * 2.0 / npts * k 103 103 104 104 # sin() is due to having not uniform bin number density wrt the q plane. 105 sum += model.run([q, 0])*math.sin(theta )106 weight += math.sin(theta )105 sum += model.run([q, 0])*math.sin(theta*math.pi/180.0) 106 weight += math.sin(theta*math.pi/180.0) 107 107 108 108 value = sum/weight #*math.pi/2.0
Note: See TracChangeset
for help on using the changeset viewer.