-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiono_check.py
More file actions
40 lines (33 loc) · 1.1 KB
/
iono_check.py
File metadata and controls
40 lines (33 loc) · 1.1 KB
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
import katfile
import katarchive
import matplotlib.pyplot as plt
from matplotlib.dates import HourLocator, DateFormatter, drange,epoch2num
import numpy as np
f = katarchive.get_archived_products('1327151141.h5,1327180529.h5,1327209599.h5')
h5 = katfile.open(f)
h5.select(channels = range(500,600), scans='track',ants='ant7',pol='HH')
HH = h5.vis[:]
h5.select(channels = range(500,600), scans='track',ants='ant7',pol='VV')
VV = h5.vis[:]
h5.select(channels = range(500,600), scans='track',ants='ant7',pol='VH')
VH = h5.vis[:]
I = VV + HH
Q = VV - HH
U = 2 * np.real(VH)
V = 2 * np.imag(VH)
chi = 0.5 * np.arctan(V/np.sqrt(np.power(U,2)+np.power(Q,2)))
psi = 0.5 * np.arctan(U/Q)
times = epoch2num(h5.timestamps[:])
plt.plot(times,I[:,80,0],label='I')
plt.plot(times,Q[:,80,0],label='Q')
plt.plot(times,U[:,80,0],label='U')
plt.plot(times,V[:,80,0],label='V')
plt.legend()
plt.figure()
plt.plot(times,chi[:,80,0],label='chi')
plt.plot(times,psi[:,80,0],label='psi')
plt.legend()
a = plt.gca()
a.xaxis.set_major_locator(HourLocator(range(0,24,2)))
a.xaxis.set_major_formatter(DateFormatter('%d/%m/%Y\n%H:%M:%S'))
plt.show()