Changeset 4628e31 in sasview for sansmodels/src/sans/models/test


Ignore:
Timestamp:
Oct 22, 2010 5:50:05 PM (14 years ago)
Author:
Jae Cho <jhjcho@…>
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
Message:

changed the unit of angles into degrees

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/sans/models/test/validate_2D_3axes_shape_model.py

    rbda194e3 r4628e31  
    9191            weight = 0.0 
    9292            for i_theta in range(npts): 
    93                 theta = math.pi/npts*(i_theta+1) 
     93                theta = 180.0/npts*(i_theta+1) 
    9494                 
    9595                model.setParam(theta_label, theta) 
    9696                 
    9797                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) 
    9999                    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) 
    101101                        if str(model.run([q, 0])).count("INF")>0:                         
    102                             print "ERROR", q, theta, math.pi * 2.0 / npts * k 
     102                            print "ERROR", q, theta, 180.0 * 2.0 / npts * k 
    103103                             
    104104                        # 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)  
    107107 
    108108            value = sum/weight #*math.pi/2.0 
Note: See TracChangeset for help on using the changeset viewer.