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
f44a37ec
Commit
f44a37ec
authored
Jul 02, 2020
by
Tammo Jan Dijkema
Browse files
Use two scatterplots instead of n
parent
b390612b
Changes
1
Hide whitespace changes
Inline
Side-by-side
zonnewaarneming.py
View file @
f44a37ec
...
...
@@ -67,11 +67,13 @@ ax.set_ylabel("Signaalsterkte (ongekalibreerd)")
fig
.
canvas
.
set_window_title
(
'Live waarneming Dwingeloo radiotelescoop op 1330 MHz'
)
ax
.
set_title
(
'Live waarneming Dwingeloo radiotelescoop op 1330 MHz'
)
prev_points
=
None
separation
=
None
maxsignal
=
0.
scatterplot_sun
=
ax
.
scatter
([
1
,
2
,
3
],
[
4
,
5
,
6
],
s
=
3
,
color
=
'black'
)
scatterplot_cas
=
ax
.
scatter
([
1
,
2
,
3
],
[
4
,
5
,
6
],
s
=
3
,
color
=
'blue'
)
while
True
:
time
.
sleep
(
0.2
)
if
signal
==
prev_signal
:
...
...
@@ -88,21 +90,17 @@ while True:
az
=
Angle
(
az
+
180
*
u
.
deg
)
color
=
'black'
if
SEPARATION_AZ
:
dwl_altaz
=
AltAz
(
location
=
dwl
,
obstime
=
Time
.
now
())
az_sun
=
get_sun
(
Time
.
now
()).
transform_to
(
dwl_altaz
).
az
az_cas
=
cas_a
.
transform_to
(
dwl_altaz
).
az
separation_sun
=
(
az
-
az_sun
).
wrap_at
(
180
*
u
.
deg
).
degree
*
np
.
cos
(
el
)
separation_cas
=
(
az
-
az_cas
).
wrap_at
(
180
*
u
.
deg
).
degree
*
np
.
cos
(
el
)
if
abs
(
separation_sun
)
<
abs
(
separation_cas
):
separation
=
separation_sun
else
:
separation
=
separation_cas
color
=
'blue'
dwl_altaz
=
AltAz
(
location
=
dwl
,
obstime
=
Time
.
now
())
az_sun
=
get_sun
(
Time
.
now
()).
transform_to
(
dwl_altaz
).
az
az_cas
=
cas_a
.
transform_to
(
dwl_altaz
).
az
separation_sun
=
(
az
-
az_sun
).
wrap_at
(
180
*
u
.
deg
).
degree
*
np
.
cos
(
el
)
separation_cas
=
(
az
-
az_cas
).
wrap_at
(
180
*
u
.
deg
).
degree
*
np
.
cos
(
el
)
if
abs
(
separation_sun
)
<
abs
(
separation_cas
):
separation
=
separation_sun
scatterplot
=
scatterplot_sun
else
:
separation_sun
=
get_sun
(
Time
.
now
()).
separation
(
pos
).
deg
separation_cas
=
cas_a
.
separation
(
pos
).
deg
separation
=
min
(
separation_sun
,
separation_cas
)
separation
=
separation_cas
scatterplot
=
scatterplot_cas
print
(
signal
,
flush
=
True
)
...
...
@@ -114,13 +112,15 @@ while True:
print
(
f
"Out of range, separation is
{
separation
:
.
1
f
}
"
)
continue
scatter_data
=
scatterplot
.
get_offsets
()
scatter_data
=
np
.
vstack
((
scatter_data
,
[
separation
,
signal
]))
scatterplot
.
set_offsets
(
scatter_data
)
if
prev_points
is
not
None
:
prev_points
.
remove
()
ax
.
scatter
([
separation
],
[
signal
],
s
=
3
,
color
=
color
)
prev_points
=
ax
.
scatter
([
separation
],
[
signal
],
s
=
30
,
color
=
'red'
)
ax
.
set_ylim
((
3000
,
1.3
*
maxsignal
))
# show the plot
plt
.
show
()
plt
.
pause
(
0.0001
)
# <-- sets the current plot until refreshed
plt
.
pause
(
0.0001
)
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