diff --git a/pilot_plots.py b/pilot_plots.py index cde2980..f29f6b9 100644 --- a/pilot_plots.py +++ b/pilot_plots.py @@ -34,6 +34,7 @@ def battery_plots(combined_nav_file, out_dir): fig.savefig(filename, format='png', transparent=True) # Prediction plot + df = df.dropna() df_3day = df[df.index > df.index.max() - datetime.timedelta(days=3)] regr = linear_model.LinearRegression() regr.fit(df_3day.index.values.reshape(-1, 1), df_3day['Voltage'].values.reshape(-1, 1)) @@ -89,3 +90,9 @@ def battery_plots(combined_nav_file, out_dir): dline = f"{datetime.datetime.now()},{glider},{mission},{v_per_day},{recover},{end}\n" with open("/data/plots/nrt/battery_prediction.csv", "a") as file: file.write(dline) + + +if __name__ == '__main__': + from pathlib import Path + battery_plots(Path('/data/data_l0_pyglider/nrt/SEA44/M85/rawnc/Martorn-rawgli.parquet'), '.') + \ No newline at end of file diff --git a/requirements-dev.txt b/requirements-dev.txt index c73ebf9..e1c166f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,9 +4,11 @@ matplotlib xarray netcdf4 cmocean -boto3 gsw cartopy scipy geopy tqdm +polars +scikit-learn +pyarrow diff --git a/requirements.txt b/requirements.txt index 17a9f72..ffda1bc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,9 +3,11 @@ matplotlib xarray netcdf4 cmocean -boto3 gsw cartopy scipy geopy tqdm +polars +scikit-learn +pyarrow