Changeset d459d4e in sasmodels for sasmodels/sesans.py


Ignore:
Timestamp:
Mar 19, 2016 4:11:16 AM (8 years ago)
Author:
jhbakker
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
3a45c2c
Parents:
daa669b
Message:

Preparing for acceptance angle integration for single angle case

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/sesans.py

    ra06430c rd459d4e  
    11""" 
    2 Conversion of scattering cross section from SANS in absolute 
    3 units into SESANS using a Hankel transformation 
     2Conversion of scattering cross section from SANS (I(q), or rather, ds/dO) in absolute 
     3units (cm-1)into SESANS correlation function G using a Hankel transformation, then converting 
     4the SESANS correlation function into polarisation from the SESANS experiment 
    45 
    5 Everything is in units of metres except specified otherwise 
     6Everything is in units of metres except specified otherwise (NOT TRUE!!!) 
     7Everything is in conventional units (nm for spin echo length) 
    68 
    79Wim Bouwman (w.g.bouwman@tudelft.nl), June 2013 
     
    1820    r""" 
    1921    Return a $q$ vector suitable for SESANS covering from $2\pi/ (10 R_{\max})$ 
    20     to $q_max$. 
     22    to $q_max$. This is the integration range of the Hankel transform; bigger range and  
     23    more points makes a better numerical integration. 
     24    Smaller q_min will increase reliable spin echo length range.  
     25    Rmax is the "radius" of the largest expected object and can be set elsewhere. 
     26    q_max is determined by the acceptance angle of the SESANS instrument. 
    2127    """ 
    2228    q_min = dq = 0.1 * 2*pi / Rmax 
     
    2430     
    2531def make_all_q(data): 
    26     if not data.needs_all_q: 
     32    """ 
     33    Return a $q$ vector suitable for calculating the total scattering cross section for 
     34    calculating the effect of finite acceptance angles on Time of Flight SESANS instruments. 
     35    If no acceptance is given, or unwanted (set "unwanted" flag in paramfile), no all_q vector is needed. 
     36    If the instrument has a rectangular acceptance, 2 all_q vectors are needed. 
     37    If the instrument has a circular acceptance, 1 all_q vector is needed 
     38     
     39    """ 
     40    if not data.has_no_finite_acceptance: 
    2741        return [] 
    28     elif needs_Iqxy(data): 
     42    elif data.has_yz_acceptance(data): 
    2943        # compute qx, qy 
    3044        Qx, Qy = np.meshgrid(qx, qy) 
     
    3246    else: 
    3347        # else only need q 
     48        # data.has_z_acceptance 
    3449        return [q] 
    3550 
    3651def transform(data, q_calc, Iq_calc, qmono, Iq_mono): 
     52    """ 
     53    Decides which transform type is to be used, based on the experiment data file contents (header) 
     54    (2016-03-19: currently controlled from parameters script) 
     55    nqmono is the number of q vectors to be used for the detector integration 
     56    """ 
    3757    nqmono = len(qmono) 
    3858    if nqmono == 0: 
     
    6282                  q_calc, Iq_calc) 
    6383                   
    64 def Cosine2D(data, q_calc, Iq_calc, qx, qy, Iq_mono): 
     84def call_Cosine2D(data, q_calc, Iq_calc, qx, qy, Iq_mono): 
    6585    return hankel(data.x, data.y, data.lam * 1e-9, 
    6686                  data.sample.thickness / 10, 
Note: See TracChangeset for help on using the changeset viewer.