-
Notifications
You must be signed in to change notification settings - Fork 0
/
quarantine.py
72 lines (56 loc) · 2.11 KB
/
quarantine.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
""" THIS IS PISSING ME OFF!!! """
def static_wedge_vis(sim_dict, fs):
raise NotImplementedError("I have only updated" + \
" the dynamic wedge routine at this moment.")
"""
Read from the wedge data structure @sim_dict
(specifically, one using the format
established in load_wedge_sim)
and generate 3D points appropriate for a wedge plot.
i.e., return a list of triples:
(k_perpendicular, k_parallel, power*)
* currently, the implementation uses values that
should be proportional to power. The final constants
have not yet been considered.
This function is distinct from
dynamic_wedge_vis
in assuming that the simulation corresponding to
@sim_dict
runs over only one value of LST.
"""
wedge_data = []
etas = f2etas(fs)
center_f = np.average(fs)
z = fq2z(center_f)
lambda_ = C / center_f
k_par = k_parallel(etas, z)
k_starter = k_perp(z) / lambda_ # this will need to be
# multiplied on a per-baseline basis
### aliasing ###
nu_idxs = sim_dict['fs']
sim = sim_dict['sim']
for ant1 in sim.keys():
for ant2 in sim[ant1].keys():
"""
Since we only used one LST,
we do not need to do any averaging
(averaging is supposed to happen over LSTs,
not frequency)
"""
k_orth = k_starter * sf.ant.baselength(ant1, ant2)
for nu_idx in nu_idxs:
# this is a proportionality.
# The real deal uses the power equation 6
# from Nunhokee et al.
brightness = sim[ant1][ant2][nu_idx]
power_prop = np.log10(np.vdot(
brightness,
brightness
))
wedge_datum = np.array([
k_orth,
k_par[nu_idx],
float(power_prop)
])
wedge_data.append(wedge_datum)
return np.array(wedge_data)