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
071c69bb
Unverified
Commit
071c69bb
authored
Jun 06, 2021
by
Tammo Jan Dijkema
Browse files
Append to existing file
parent
29465b1d
Changes
1
Show whitespace changes
Inline
Side-by-side
eclipswaarneming.py
View file @
071c69bb
...
...
@@ -10,6 +10,7 @@ Tammo Jan Dijkema, 29 June 2020
import
time
import
matplotlib.pyplot
as
plt
import
sys
import
zmq
import
struct
import
numpy
as
np
...
...
@@ -30,9 +31,6 @@ logger.setLevel(level=logging.INFO)
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,signal 23cm"
,
file
=
datafile
)
def
signal_thread
():
global
signal
context
=
zmq
.
Context
()
...
...
@@ -68,8 +66,12 @@ prev_points = None
separation
=
None
maxsignal
=
0.
scatterplot
=
ax
.
scatter
([],
[],
s
=
3
,
color
=
'black'
)
calplot
=
ax
.
scatter
([],
[],
s
=
3
,
color
=
'lightgrey'
)
file_dates
=
[]
file_data
=
[]
file_caldata
=
[]
scatterplot
=
ax
.
scatter
(
file_dates
,
file_data
,
s
=
3
,
color
=
'black'
)
calplot
=
ax
.
scatter
(
file_dates
,
file_caldata
,
s
=
3
,
color
=
'lightgrey'
)
ax
.
xaxis
.
set_major_formatter
(
mdates
.
DateFormatter
(
'%H:%M'
))
eclipse_starttime
=
Time
(
"2021-06-10T11:21"
)
+
2
*
u
.
hour
...
...
@@ -81,6 +83,12 @@ if starttime < eclipse_endtime < starttime + 3*u.hour:
ax
.
axvline
(
eclipse_endtime
.
datetime
,
linestyle
=
'--'
,
linewidth
=
1
,
color
=
'lightgrey'
)
ax
.
text
(
eclipse_endtime
.
datetime
,
0.1
,
'Einde: '
+
eclipse_endtime
.
isot
[
11
:
16
],
rotation
=
90
,
color
=
'black'
,
transform
=
ax
.
get_xaxis_transform
())
if
len
(
sys
.
argv
)
==
1
:
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,signal 23cm"
,
file
=
datafile
)
else
:
datafile
=
open
(
f
"
{
sys
.
argv
[
1
]
}
"
,
"a"
)
while
True
:
time
.
sleep
(
0.2
)
if
signal
==
prev_signal
:
...
...
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