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
240fcb06
Commit
240fcb06
authored
Jul 04, 2020
by
Tammo Jan Dijkema
Browse files
Leave out bad elevation points
parent
6ef6aeeb
Changes
1
Hide whitespace changes
Inline
Side-by-side
zonnewaarneming.py
View file @
240fcb06
...
...
@@ -46,7 +46,7 @@ s = Thread(target=signal_thread)
s
.
daemon
=
True
s
.
start
()
dt
=
telescope
(
consoleHost
=
'
localhost
'
)
dt
=
telescope
(
consoleHost
=
'
console
'
)
cas_a
=
SkyCoord
.
from_name
(
"Cassiopeia A"
)
dwl
=
EarthLocation
(
lon
=
Angle
(
"6:23:46.21 degrees"
),
...
...
@@ -74,8 +74,8 @@ 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'
)
scatterplot_sun
=
ax
.
scatter
([
],
[
],
s
=
3
,
color
=
'black'
)
scatterplot_cas
=
ax
.
scatter
([
],
[
],
s
=
3
,
color
=
'blue'
)
while
True
:
time
.
sleep
(
0.2
)
...
...
@@ -94,10 +94,17 @@ while True:
color
=
'black'
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
altaz_sun
=
get_sun
(
Time
.
now
()).
transform_to
(
dwl_altaz
)
az_sun
,
alt_sun
=
altaz_sun
.
az
,
altaz_sun
.
alt
altaz_cas
=
cas_a
.
transform_to
(
dwl_altaz
)
az_cas
,
alt_cas
=
altaz_cas
.
az
,
altaz_cas
.
alt
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
min
(
abs
((
alt_sun
-
el
).
degree
),
abs
((
alt_cas
-
el
).
degree
))
>
0.2
:
print
(
"Elevation off, skipping"
)
continue
if
abs
(
separation_sun
)
<
abs
(
separation_cas
):
separation
=
separation_sun
scatterplot
=
scatterplot_sun
...
...
@@ -121,8 +128,9 @@ while True:
if
prev_points
is
not
None
:
prev_points
.
remove
()
prev_points
=
ax
.
scatter
([
separation
],
[
signal
],
s
=
30
,
color
=
'red'
)
ax
.
set_ylim
((
3000
,
1.3
*
maxsignal
))
prev_points
=
ax
.
scatter
([
separation
],
[
signal
],
s
=
50
,
color
=
'red'
)
ax
.
set_ylim
((
2800
,
1.1
*
maxsignal
))
# show the plot
plt
.
show
()
...
...
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