Ejemplo n.º 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())
Ejemplo n.º 2
0
def setup_scatterer_rain(elev_radar):
    
    scatterer        = Scatterer()
    scatterer.psd_integrator   = psd.PSDIntegrator() 
    scatterer.psd_integrator.axis_ratio_func = lambda D: 1.0/drop_ar(D)   
    scatterer.alpha  = 0.0 
    scatterer.beta   = 0.0 
    scatterer.phi0   = 0.0 
    scatterer.thet   = 90.0 - elev_radar[0]
    scatterer.thet0  = 90.0 - elev_radar[0]
    scatterer.phi    = 0.0 
    geom_forw        = scatterer.get_geometry() 
    scatterer.phi    = 180.0 
    geom_back        = scatterer.get_geometry()     
    scatterer.or_pdf = orientation.gaussian_pdf(7.0)      # orientation PDF according to Bringi and Chandrasekar (2001)
    scatterer.orient = orientation.orient_averaged_fixed  # averaging method    

    return [scatterer, geom_forw, geom_back]   
Ejemplo n.º 3
0
def setup_scatterer_grau(elev_radar):
    scatterer                  = Scatterer()
    scatterer.psd_integrator   = psd.PSDIntegrator()    
    scatterer.axis_ratio       = 1.       # 1./0.8 (original); 
    scatterer.alpha  = 0.0 
    scatterer.beta   = 0.0 
    scatterer.phi0   = 0.0 
    scatterer.thet   = 90.0 - elev_radar[0]
    scatterer.thet0  = 90.0 - elev_radar[0]
    scatterer.phi    = 0.0 
    geom_forw        = scatterer.get_geometry() 
    scatterer.phi    = 180.0 
    geom_back        = scatterer.get_geometry()    
    
    # set up orientation averaging, Gaussian PDF with mean=0 and std=7 deg
    scatterer.or_pdf = orientation.gaussian_pdf(1)      # orientation PDF according to Bringi and Chandrasekar (2001)
    scatterer.orient = orientation.orient_averaged_fixed  # averaging method

    return [scatterer, geom_forw, geom_back]   
Ejemplo n.º 4
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())
Ejemplo n.º 5
0
# The zenith angle of the incident beam (thet0)
# The zenith angle of the scattered beam (thet)
# The azimuth angle of the incident beam (phi0)
# The azimuth angle of the scattered beam (phi)
# e.g. geom_horiz_back is (90.0, 90.0, 0.0, 180.0, 0.0, 0.0)

ref_indices_rain = [
    complex(8.983, 0.989),
    complex(8.590, 1.670),
    complex(7.718, 2.473)
]
scatterer = Scatterer()
theta_radar = (0.5, 0.9, 1.3, 1.9, 2.3, 3, 3.5, 5, 6.9, 9.1, 11.8, 15.1
               )  # The angles for the radar are:
scatterer.alpha = 0.0
scatterer.beta = 0.0
scatterer.phi0 = 0.0
scatterer.thet = 90.0 - theta_radar[0]
scatterer.thet0 = 90.0 - theta_radar[0]
scatterer.phi = 180.0
geom_back = scatterer.get_geometry()
scatterer.phi = 0.0
geom_forw = scatterer.get_geometry()

# so assuming perfect backscattering (no gaussian function)
# geom_tuple = (theta_radar, theta_radar, 0.0, 180.0, 0.0, 0.0)
# Set geometry to backscattering!
# CAREFUL: for Kdp need forward scattering. <-------------------------------------------------
scatterer.set_geometry(geom_back)

# set up orientation averaging, Gaussian PDF with mean=0 and std=7 deg