-
Notifications
You must be signed in to change notification settings - Fork 0
/
drxFormatConfirmation.py
117 lines (94 loc) · 3.78 KB
/
drxFormatConfirmation.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import numpy
import math
from lsl.reader import drx
from lsl.correlator import fx as fxc
from lsl.misc.mathutil import to_dB
from matplotlib import pyplot as plt
from datetime import datetime
file = open('/u/data/leap/observations/056777_000085152','rb')
frame1 = drx.readFrame(file)
frame2 = drx.readFrame(file)
frame3 = drx.readFrame(file)
frame4 = drx.readFrame(file)
b1, t1, p1 = frame1.parseID()
b2, t2, p2 = frame2.parseID()
b3, t3, p3 = frame3.parseID()
b4, t4, p4 = frame4.parseID()
print "THIS IS HF ON MOON DATA"
print "frame 1 stuff: " + str(b1) + ":" + str(t1) + ":" + str(p1)
print "Tuning is: " + str(frame1.getCentralFreq())
print str(frame1.data.iq.real[:])
print "frame 2 stuff: " + str(b2) + ":" + str(t2) + ":" + str(p2)
print "Tuning is: " + str(frame2.getCentralFreq())
print str(frame2.data.iq.real[:])
print "frame 3 stuff: " + str(b3) + ":" + str(t3) + ":" + str(p3)
print "Tuning is: " + str(frame3.getCentralFreq())
print str(frame3.data.iq.real[:])
print "frame 4 stuff: " + str(b4) + ":" + str(t4) + ":" + str(p4)
print "Tuning is: " + str(frame4.getCentralFreq())
print str(frame4.data.iq.real[:])
print "BEGIN NEXT FRAME SET FOR HF ON"
frame1 = drx.readFrame(file)
frame2 = drx.readFrame(file)
frame3 = drx.readFrame(file)
frame4 = drx.readFrame(file)
b1, t1, p1 = frame1.parseID()
b2, t2, p2 = frame2.parseID()
b3, t3, p3 = frame3.parseID()
b4, t4, p4 = frame4.parseID()
print "frame 1 stuff: " + str(b1) + ":" + str(t1) + ":" + str(p1)
print "Tuning is: " + str(frame1.getCentralFreq())
print str(frame1.data.iq.real[:])
print "frame 2 stuff: " + str(b2) + ":" + str(t2) + ":" + str(p2)
print "Tuning is: " + str(frame2.getCentralFreq())
print str(frame2.data.iq.real[:])
print "frame 3 stuff: " + str(b3) + ":" + str(t3) + ":" + str(p3)
print "Tuning is: " + str(frame3.getCentralFreq())
print str(frame3.data.iq.real[:])
print "frame 4 stuff: " + str(b4) + ":" + str(t4) + ":" + str(p4)
print "Tuning is: " + str(frame4.getCentralFreq())
print str(frame4.data.iq.real[:])
print "CHANGE TO HF OFF"
file1 = open('/u/data/leap/observations/056777_000085153','rb')
frame1 = drx.readFrame(file1)
frame2 = drx.readFrame(file1)
frame3 = drx.readFrame(file1)
frame4 = drx.readFrame(file1)
b1, t1, p1 = frame1.parseID()
b2, t2, p2 = frame2.parseID()
b3, t3, p3 = frame3.parseID()
b4, t4, p4 = frame4.parseID()
print "THIS IS HF OFF MOON DATA"
print "frame 1 stuff: " + str(b1) + ":" + str(t1) + ":" + str(p1)
print "Tuning is: " + str(frame1.getCentralFreq())
print str(frame1.data.iq.real[:])
print "frame 2 stuff: " + str(b2) + ":" + str(t2) + ":" + str(p2)
print "Tuning is: " + str(frame2.getCentralFreq())
print str(frame2.data.iq.real[:])
print "frame 3 stuff: " + str(b3) + ":" + str(t3) + ":" + str(p3)
print "Tuning is: " + str(frame3.getCentralFreq())
print str(frame3.data.iq.real[:])
print "frame 4 stuff: " + str(b4) + ":" + str(t4) + ":" + str(p4)
print "Tuning is: " + str(frame4.getCentralFreq())
print str(frame4.data.iq.real[:])
print "BEGIN NEXT FRAME SET FOR HF OFF"
frame1 = drx.readFrame(file)
frame2 = drx.readFrame(file)
frame3 = drx.readFrame(file)
frame4 = drx.readFrame(file)
b1, t1, p1 = frame1.parseID()
b2, t2, p2 = frame2.parseID()
b3, t3, p3 = frame3.parseID()
b4, t4, p4 = frame4.parseID()
print "frame 1 stuff: " + str(b1) + ":" + str(t1) + ":" + str(p1)
print "Tuning is: " + str(frame1.getCentralFreq())
print str(frame1.data.iq.real[:])
print "frame 2 stuff: " + str(b2) + ":" + str(t2) + ":" + str(p2)
print "Tuning is: " + str(frame2.getCentralFreq())
print str(frame2.data.iq.real[:])
print "frame 3 stuff: " + str(b3) + ":" + str(t3) + ":" + str(p3)
print "Tuning is: " + str(frame3.getCentralFreq())
print str(frame3.data.iq.real[:])
print "frame 4 stuff: " + str(b4) + ":" + str(t4) + ":" + str(p4)
print "Tuning is: " + str(frame4.getCentralFreq())
print str(frame4.data.iq.real[:])