-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_target_track.py
More file actions
executable file
·51 lines (37 loc) · 1.48 KB
/
plot_target_track.py
File metadata and controls
executable file
·51 lines (37 loc) · 1.48 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
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/python
#
#Script to plot the track of a source
import katpoint
import matplotlib.pyplot as plt
import time
import numpy as np
#You will need to start with an antenna object ... the simplest way I have found to get the most
#accurate version of an antenna object for one of the KAT7 antennas is simply to extract it out
#of a data file created by the antenna in question. For example if you have a data file <filename> for
#antenna 7 data you could use
#import scape
#d = scape.DataSet(<filename>,baseline='A7A7')
#ant = d.antenna
#If you do not have a file you can create an antenna object using katpoint.
#Parameters for the antennas are from code/conf/trunk/antennas.
#for the "center" of the array
cent = 'kat7,-30:43:17.34, 21:24:38.46, 1038,12.0' # name,lat,lon,elev,diameter
ant = katpoint.Antenna(cent)
#source
source_arr = []
#3C138
source_arr.append(katpoint.construct_radec_target('05:21:09.887', '+16:38:22.06'))
observation_sources = katpoint.Catalogue(antenna=ant)
observation_sources.add(source_arr)
for source in observation_sources.targets:
#set the timestamp array
timestamp = []
source_az = []
source_el = []
for i in range(0,24):
timestamp.append(katpoint.Timestamp(time.time()+i*3600))
source_az.append(np.rad2deg(source.azel(antenna=ant,timestamp=timestamp[i])[0]))
source_el.append(np.rad2deg(source.azel(antenna=ant,timestamp=timestamp[i])[1]))
plt.figure(1)
plt.scatter(source_az,source_el,c=np.array(range(0,24)),cmap='jet',s = 100)
plt.colorbar()