From 4f7c6e2954b1aefe308aafdb8ef8b4130c2d41c7 Mon Sep 17 00:00:00 2001 From: Callum Rollo Date: Fri, 10 May 2024 13:46:23 +0200 Subject: [PATCH] env and local proc --- environment.yml | 6 ++++++ glidertools_plots.py | 7 ++++++- gridded_plots.py | 5 +++++ pilot_plots.py | 2 +- requirements.txt | 13 ------------- 5 files changed, 18 insertions(+), 15 deletions(-) delete mode 100644 requirements.txt diff --git a/environment.yml b/environment.yml index 5417adc..137a966 100644 --- a/environment.yml +++ b/environment.yml @@ -13,3 +13,9 @@ dependencies: - pandas - tqdm - geopy + - pyaml + - ioos_qc + - polars + - scikit-learn + - plotly + - pyarrow diff --git a/glidertools_plots.py b/glidertools_plots.py index 9088781..5016505 100644 --- a/glidertools_plots.py +++ b/glidertools_plots.py @@ -18,7 +18,7 @@ def public_plots(nc, plots_dir): end = pd.to_datetime(ds.time.max().values) ds = ds.sel(time=slice(end - datetime.timedelta(days=60), end)) # Apply flags from ioos - ds = apply_flags(ds, var_max_flags={"oxygen_concentration": 4, "cdom": 3}) + ds = apply_flags(ds, var_max_flags={"oxygen_concentration": 4, "cdom": 4}) # Prepare a variable of averaged time per profile. This is used in plotting later profile_time = ds.time.values.copy() profile_index = ds.profile_index @@ -73,3 +73,8 @@ def public_plots(nc, plots_dir): plt.tight_layout() filename = plots_dir / f'SEA{ds.glider_serial}_M{ds.deployment_id}_gt.png' plt.savefig(filename, format='png', transparent=True) + + +if __name__ == '__main__': + from pathlib import Path + public_plots(Path("/data/data_l0_pyglider/nrt/SEA76/M25/timeseries/mission_timeseries.nc"), Path("/home/callum/Downloads")) \ No newline at end of file diff --git a/gridded_plots.py b/gridded_plots.py index ddf810a..705ba18 100644 --- a/gridded_plots.py +++ b/gridded_plots.py @@ -362,3 +362,8 @@ def make_map(nc, filename): _log.info(f"writing map to {filename_map}") fig.savefig(filename_map, format='png', transparent=True) return filename_map + + + +if __name__ == '__main__': + create_plots(Path("/data/data_l0_pyglider/nrt/SEA76/M25/gridfiles/mission_grid.nc"), Path("/home/callum/Downloads"), True) \ No newline at end of file diff --git a/pilot_plots.py b/pilot_plots.py index df93fd5..073c02b 100644 --- a/pilot_plots.py +++ b/pilot_plots.py @@ -98,4 +98,4 @@ def battery_plots(combined_nav_file, out_dir): if __name__ == '__main__': from pathlib import Path - battery_plots(Path('/data/data_l0_pyglider/nrt/SEA76/M25/rawnc/Fibbla-rawgli.parquet'), '.') + battery_plots(Path('/data/data_l0_pyglider/nrt/SEA63/M73/rawnc/Fibbla-rawgli.parquet'), '.') diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index ffda1bc..0000000 --- a/requirements.txt +++ /dev/null @@ -1,13 +0,0 @@ -numpy -matplotlib -xarray -netcdf4 -cmocean -gsw -cartopy -scipy -geopy -tqdm -polars -scikit-learn -pyarrow