-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmatrix_tests.py
57 lines (50 loc) · 1.48 KB
/
tmatrix_tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 6 12:37:33 2017
@author: dori
"""
from pytmatrix import tmatrix, scatter, psd, tmatrix_aux, orientation, tmatrix_psd, refractive, radar
import numpy as np
import matplotlib.pyplot as plt
plt.close('all')
wl = tmatrix_aux.wl_Ku
sd = 0.2 # snow density
scatt = tmatrix.Scatterer(radius=10.0,
radius_type=2,
wavelength=wl,
axis_ratio=1.0/0.15,
m=refractive.mi(wl,sd),
thet0=90.0,
thet=90.0,
phi0=0.0,
phi=180.0)
radii = np.linspace(1.0,10,1000)
Zh = []
Zv = []
for r in radii:
scatt.radius = r
scatt.set_geometry(tmatrix_aux.geom_horiz_back)
Zh.append(10.0*np.log10(radar.refl(scatt,h_pol=True)))
Zv.append(10.0*np.log10(radar.refl(scatt,h_pol=False)))
plt.figure()
plt.plot(radii,Zh,label='Zh')
plt.plot(radii,Zv,label='Zv')
Zdr = np.array(Zh)-np.array(Zv)
plt.plot(radii,Zdr,label='Zdr')
plt.legend()
plt.grid()
thetas = np.linspace(0.0,90.0,200)
Zh = []
Zv = []
for th in thetas:
scatt.radius = 10.0
scatt.set_geometry((th,th,0.0,180.0,0.0,0.0))
Zh.append(10.0*np.log10(radar.refl(scatt,h_pol=True)))
Zv.append(10.0*np.log10(radar.refl(scatt,h_pol=False)))
plt.figure()
plt.plot(thetas,Zh,label='Zh')
plt.plot(thetas,Zv,label='Zv')
Zdr = np.array(Zh)-np.array(Zv)
plt.plot(thetas,Zdr,label='Zdr')
plt.legend()
plt.grid()