Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tammo Jan Dijkema
zonnedemo
Commits
a814c8f6
Unverified
Commit
a814c8f6
authored
Jun 04, 2021
by
Tammo Jan Dijkema
Browse files
Updates to eclipse demo
parent
ba0d4893
Changes
2
Hide whitespace changes
Inline
Side-by-side
eclipswaarneming.py
View file @
a814c8f6
...
...
@@ -31,7 +31,7 @@ signal = 0.
prev_signal
=
0.
datafile
=
open
(
f
"data
{
int
(
Time
.
now
().
unix
)
}
.txt"
,
"w"
)
print
(
"Time (UTC),Tracker,Offset az (deg),Offset el(deg),azimuth from north (deg),
elevation (deg),
signal 70cm"
,
file
=
datafile
)
print
(
"Time (UTC),Tracker,Offset az (deg),Offset el(deg),azimuth from north (deg),elevation (deg),signal 70cm
,signal 23cm
"
,
file
=
datafile
)
def
signal_thread
():
global
signal
...
...
@@ -56,6 +56,8 @@ dwl = EarthLocation(lon=Angle("6:23:46.21 degrees"),
plt
.
ion
()
fig
,
ax
=
plt
.
subplots
()
starttime
=
Time
.
now
()
+
2
*
u
.
hour
#ax.set_ylim((0, None))
ax
.
set_xlabel
(
"Lokale tijd (CEST)"
)
ax
.
set_ylabel
(
"Signaalsterkte (ongekalibreerd)"
)
...
...
@@ -67,7 +69,6 @@ separation = None
maxsignal
=
0.
scatterplot_70cm
=
ax
.
scatter
([],
[],
s
=
3
,
color
=
'black'
)
scatterplot_23cm
=
ax
.
scatter
([],
[],
s
=
3
,
color
=
'blue'
)
while
True
:
time
.
sleep
(
0.2
)
...
...
@@ -83,14 +84,15 @@ while True:
maxsignal
=
signal
scatter_data
=
scatterplot_70cm
.
get_offsets
()
scatter_data
=
np
.
vstack
((
scatter_data
,
[
mdates
.
date2num
(
now
.
datetime
),
signal
]))
scatter_data
=
np
.
vstack
((
scatter_data
,
[
mdates
.
date2num
(
(
now
+
2
*
u
.
hour
)
.
datetime
),
signal
]))
scatterplot_70cm
.
set_offsets
(
scatter_data
)
if
prev_points
is
not
None
:
prev_points
.
remove
()
prev_points
=
ax
.
scatter
([
now
.
datetime
],
[
signal
],
s
=
50
,
color
=
'red'
)
prev_points
=
ax
.
scatter
([
(
now
+
2
*
u
.
hour
)
.
datetime
],
[
signal
],
s
=
50
,
color
=
'red'
)
ax
.
set_ylim
((
2800
,
1.1
*
maxsignal
))
ax
.
set_xlim
(
starttime
.
datetime
,
(
now
+
2.5
*
u
.
hour
).
datetime
)
# show the plot
plt
.
show
()
...
...
zmqsend.py
0 → 100755
View file @
a814c8f6
#!/usr/bin/env python
import
zmq
import
sys
import
time
import
numpy
as
np
from
numpy.random
import
random
port
=
sys
.
argv
[
1
]
ctx
=
zmq
.
Context
()
sender
=
ctx
.
socket
(
zmq
.
PUSH
)
sender
.
bind
(
"tcp://127.0.0.1:5557"
)
while
True
:
time
.
sleep
(
0.5
)
sender
.
send
(
np
.
array
(
3000
+
random
()
*
500
,
dtype
=
"float32"
))
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment