Changeset b5a0509 in sasview for sansmodels/src/sans/models
- Timestamp:
- Jul 19, 2011 11:25:29 AM (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:
- ff18c58
- Parents:
- da987e1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/test/validate_2D_elliptical_cyl.py
rae3ce4e rb5a0509 102 102 103 103 cyl = CylinderModel() 104 cyl.setParam("cyl_theta", 1.57)104 cyl.setParam("cyl_theta", 90) 105 105 cyl.setParam("cyl_phi", 0.0) 106 106 cyl.setParam("radius", 20) 107 107 cyl.setParam("length", 400) 108 cyl.setParam("contrast", 1.0e-6) 108 cyl.setParam("sldCyl", 2.0e-6) 109 cyl.setParam("sldSolv", 1.0e-6) 109 110 110 111 ell = EllipticalCylinderModel() 111 112 ell.setParam("r_ratio", 1.0) 112 113 ell.setParam("r_minor", 20) 113 ell.setParam("cyl_theta", 1.57)114 ell.setParam("cyl_theta", 90) 114 115 ell.setParam("cyl_phi", 0.0) 115 116 ell.setParam("length", 400) 116 ell.setParam("contrast", 1.0e-6) 117 ell.setParam("sldCyl", 2.0e-6) 118 ell.setParam("sldSolv", 1.0e-6) 117 119 118 120 passed = True … … 146 148 model.setParam('r_ratio', 1.0) 147 149 model.setParam("r_minor", 20) 148 model.setParam("cyl_theta", 1.57)150 model.setParam("cyl_theta", 90) 149 151 model.setParam("cyl_phi", 0.0) 150 152 model.setParam("length", 400) 151 model.setParam("contrast", 1.0e-6) 153 model.setParam("sldEll", 2.0e-6) 154 model.setParam("sldSolv", 1.0e-6) 152 155 153 156 cyl = CylinderModel() 154 cyl.setParam("cyl_theta", 1.57)157 cyl.setParam("cyl_theta", 90) 155 158 cyl.setParam("cyl_phi", 0.0) 156 159 cyl.setParam("radius", 20) 157 160 cyl.setParam("length", 400) 158 cyl.setParam("contrast", 1.0e-6) 161 cyl.setParam("sldCyl", 2.0e-6) 162 cyl.setParam("sldSolv", 1.0e-6) 163 159 164 160 165 output_f = open("average_func.txt",'w') … … 191 196 for i_theta in range(npts): 192 197 theta = math.pi/npts*i_theta 193 model.setParam('cyl_theta', theta )198 model.setParam('cyl_theta', theta * 180 / math.pi) 194 199 195 200 for j in range(npts): 196 model.setParam('cyl_phi', math.pi* 2.0 / npts * j)201 model.setParam('cyl_phi', 180 * 2.0 / npts * j) 197 202 198 203 if str(model.run([q, 0])).count("IN")>0: 199 204 if self.verbose: 200 print "ERROR", q, theta, math.pi* 2.0 / npts * j205 print "ERROR", q, theta, 180 * 2.0 / npts * j 201 206 else: 202 207 sum += math.sin(theta)*model.run([q, 0])
Note: See TracChangeset
for help on using the changeset viewer.