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
e24d127a
Unverified
Commit
e24d127a
authored
Jun 11, 2021
by
Tammo Jan Dijkema
Browse files
Add rolling average
parent
cbe61b5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
plot_eclipse_data.py
100644 → 100755
View file @
e24d127a
...
...
@@ -11,8 +11,14 @@ from pandas.plotting import register_matplotlib_converters
register_matplotlib_converters
()
df_23
=
pd
.
read_csv
(
"data1623310995.txt"
,
parse_dates
=
[
0
],
skiprows
=
1
)
df_70
=
pd
.
read_csv
(
"data1623311707.txt"
,
parse_dates
=
[
0
],
skiprows
=
1
)
df_23
=
pd
.
read_csv
(
"data1623310995.txt"
,
parse_dates
=
[
0
],
skiprows
=
1
,
index_col
=
0
).
rolling
(
10
).
mean
()
df_70
=
pd
.
read_csv
(
"data1623311707.txt"
,
parse_dates
=
[
0
],
skiprows
=
1
,
index_col
=
0
).
rolling
(
10
).
mean
()
eclipse_starttime
=
datetime
(
2021
,
6
,
10
,
9
,
21
)
eclipse_endtime
=
datetime
(
2021
,
6
,
10
,
11
,
34
)
...
...
@@ -22,14 +28,12 @@ matplotlib.rcParams.update({'font.size': 16})
plot_start
=
datetime
(
2021
,
6
,
10
,
8
,
30
,
0
)
plot_end
=
datetime
(
2021
,
6
,
10
,
12
,
0
,
0
)
df_70_selected
=
df_70
[(
df_70
[
"time (UTC)"
]
>
plot_start
)
&
(
df_70
[
"time (UTC)"
]
<
plot_end
)]
df_23_selected
=
df_23
[(
df_23
[
"time (UTC)"
]
>
plot_start
)
&
(
df_23
[
"time (UTC)"
]
<
plot_end
)]
df_70_selected
=
df_70
[(
df_70
.
index
>
plot_start
)
&
(
df_70
.
index
<
plot_end
)]
df_23_selected
=
df_23
[(
df_23
.
index
>
plot_start
)
&
(
df_23
.
index
<
plot_end
)]
fig
,
ax
=
plt
.
subplots
(
figsize
=
(
16
,
9
))
sc1
=
ax
.
scatter
(
df_23_selected
[
"time (UTC)"
]
,
df_23_selected
.
index
,
df_23_selected
[
"signal"
]
/
5050
,
s
=
2
,
label
=
"Signal at 1330MHz"
,
...
...
@@ -39,7 +43,7 @@ ax2 = ax.twinx()
ax
.
xaxis
.
set_major_formatter
(
mdates
.
DateFormatter
(
"%H:%M:%S"
))
ax2
.
xaxis
.
set_major_formatter
(
mdates
.
DateFormatter
(
"%H:%M:%S"
))
sc2
=
ax2
.
scatter
(
df_70_selected
[
"time (UTC)"
]
,
df_70_selected
.
index
,
df_70_selected
[
"signal"
]
/
8e6
,
s
=
2
,
color
=
"red"
,
...
...
Write
Preview
Markdown
is supported
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