Changeset 4628e31 in sasview for sansmodels/src/sans/models/test
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.