示例#1
0
def test_backend():
    """Replicate the test run of the backend T-Matrix code.
       
       Replicates the results of the default test run of the backend code
       by Mishchenko. The user can use the function to manually check that 
       the results match. Small errors may be present due to different compiler
       optimizations.
    """
    scatterer = Scatterer(radius=10.0,
                          rat=0.1,
                          wavelength=2 * np.pi,
                          m=complex(1.5, 0.02),
                          axis_ratio=0.5,
                          ddelt=1e-3,
                          ndgs=2,
                          np=-1)
    scatterer.thet0 = 56.0
    scatterer.thet = 65.0
    scatterer.phi0 = 114.0
    scatterer.phi = 128.0
    scatterer.alpha = 145.0
    scatterer.beta = 52.0

    print("Amplitude matrix S:")
    print(scatterer.get_S())
    print("Phase matrix Z:")
    print(scatterer.get_Z())
示例#2
0
def test_backend():
    """Replicate the test run of the backend T-Matrix code.
       
       Replicates the results of the default test run of the backend code
       by Mishchenko. The user can use the function to manually check that 
       the results match. Small errors may be present due to different compiler
       optimizations.
    """    
    scatterer = Scatterer(radius=10.0, rat=0.1, wavelength=2*np.pi, 
        m=complex(1.5,0.02), axis_ratio=0.5, ddelt=1e-3, ndgs=2, np=-1)
    scatterer.thet0 = 56.0
    scatterer.thet = 65.0
    scatterer.phi0 = 114.0
    scatterer.phi = 128.0
    scatterer.alpha = 145.0
    scatterer.beta = 52.0
        
    print("Amplitude matrix S:")
    print(scatterer.get_S())
    print("Phase matrix Z:")
    print(scatterer.get_Z())
示例#3
0
    m_func2= a2.get_m_func(270,f)     
    geom_back=(90-elevation, 180-(90-elevation), 0., 180, 0.0,0.0)
    geom_forw=(90-elevation, 90-elevation, 0., 0.0, 0.0,0.0)
    

    for i,d in enumerate(D):
        
        ar = a1.get_axis_ratio(d)
        
        scatt.radius = d/2.
        scatt.m = m_func1(d)
        scatt.axis_ratio = ar

        # Backward scattering (note that we do not need amplitude matrix for backward scattering)
        scatt.set_geometry(geom_back)
        Z_back = scatt.get_Z()
        # Forward scattering (note that we do not need phase matrix for forward scattering)
        scatt.set_geometry(geom_forw)
        S_forw=scatt.get_S()

        list_SZ_1.append(Z_back[0,0])

        ar = a2.get_axis_ratio(d)
        
        scatt.radius = d/2.
        scatt.m = m_func2(d)
        scatt.axis_ratio = ar

        # Backward scattering (note that we do not need amplitude matrix for backward scattering)
        scatt.set_geometry(geom_back)
        Z_back=scatt.get_Z()