Changeset 6e8b436 in sasview for sansmodels/src


Ignore:
Timestamp:
Mar 22, 2011 5:16:25 PM (13 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:
384647dc
Parents:
ec611aad
Message:

minor correction on 2d smearer and added smearer documentation

Location:
sansmodels/src
Files:
29 added
1 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/sans/models/smearing_2d.py

    rd4bf55e9 r6e8b436  
    200200                                    numpy.exp(-0.5 * ((r + bin_size / 2.0 ) *\ 
    201201                                    (r + bin_size / 2.0))) 
    202         weight_res /= numpy.sum(weight_res) 
     202        # No needs of normalization here. 
     203        #weight_res /= numpy.sum(weight_res) 
    203204        weight_res = weight_res.repeat(nphi).reshape(nr, nphi) 
    204205 
     
    218219        # The polar needs rotation by -q_phi 
    219220        if self.coords == 'polar': 
    220             qx_res = qx + (dqx*numpy.cos(dphi) * numpy.cos(-q_phi) +\ 
     221            q_r = numpy.sqrt(qx * qx + qy * qy) 
     222            qx_res = ((dqx*numpy.cos(dphi) + q_r) * numpy.cos(-q_phi) +\ 
    221223                           dqy*numpy.sin(dphi) * numpy.sin(-q_phi)) 
    222             qy_res = qy + (-dqx*numpy.cos(dphi) * numpy.sin(-q_phi) +\ 
     224            qy_res = (-(dqx*numpy.cos(dphi) + q_r) * numpy.sin(-q_phi) +\ 
    223225                           dqy*numpy.sin(dphi) * numpy.cos(-q_phi)) 
    224226        else: 
    225227            qx_res = qx +  dqx*numpy.cos(dphi) 
    226             qy_res = qx +  dqy*numpy.sin(dphi) 
     228            qy_res = qy +  dqy*numpy.sin(dphi) 
    227229 
    228230        ## Evaluate all points 
Note: See TracChangeset for help on using the changeset viewer.