| from pathlib import Path | |
| import pandas as pd | |
| import xarray as xr | |
| ROOT = Path(__file__).resolve().parents[1] | |
| profiles = pd.read_parquet(ROOT / "indices/profiles.parquet") | |
| subset = profiles[ | |
| (profiles["profile_date"] >= 20100101) | |
| & (profiles["profile_date"] <= 20101231) | |
| & (profiles["latitude"].between(30.0, 46.0)) | |
| & (profiles["longitude"].between(-6.0, 37.0)) | |
| ] | |
| ds = xr.open_zarr(ROOT / "data/argo_glors_ostia_ssh.zarr", consolidated=None) | |
| subset_ds = ds.sel(profile=subset["profile"].to_numpy()) | |
| print(subset_ds) | |