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
3a8c5691
Unverified
Commit
3a8c5691
authored
Jun 06, 2021
by
Tammo Jan Dijkema
Browse files
Make filename argument
parent
4b907b7c
Changes
1
Hide whitespace changes
Inline
Side-by-side
eclipswaarneming.py
View file @
3a8c5691
...
...
@@ -12,6 +12,7 @@ import time
import
matplotlib.pyplot
as
plt
import
datetime
import
sys
import
os.path
import
zmq
import
struct
import
pandas
as
pd
...
...
@@ -72,7 +73,7 @@ file_cal_times = []
file_caldata
=
[]
starttime
=
Time
.
now
()
+
2
*
u
.
hour
if
len
(
sys
.
argv
)
>
1
:
if
len
(
sys
.
argv
)
>
1
and
os
.
path
.
isfile
(
sys
.
argv
[
1
])
:
df
=
pd
.
read_csv
(
sys
.
argv
[
1
],
parse_dates
=
[
0
])
is_data
=
(
df
[
"tracker"
]
==
'suntracker'
)
&
\
(
df
[
"offset az (deg)"
]
<
0.01
)
&
\
...
...
@@ -96,10 +97,16 @@ 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"
)
if
len
(
sys
.
argv
)
==
1
or
not
(
os
.
path
.
isfile
(
sys
.
argv
[
1
])):
# Create new file
if
len
(
sys
.
argv
)
==
1
:
datafilename
=
f
"data
{
int
(
Time
.
now
().
unix
)
}
.txt"
else
:
datafilename
=
sys
.
argv
[
1
]
datafile
=
open
(
datafilename
,
"w"
)
print
(
"time (UTC),tracker,offset az (deg),offset el (deg),azimuth from north (deg),elevation (deg),signal"
,
file
=
datafile
)
else
:
# Append to existing file
datafile
=
open
(
f
"
{
sys
.
argv
[
1
]
}
"
,
"a"
)
while
True
:
...
...
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