Unverified Commit e24d127a authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Add rolling average

parent cbe61b5f
......@@ -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",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment