File size: 534 Bytes
619931a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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)