euroargodev / euroargodev/argopy
New API design for indexing Argo profiles from xarray accessor
- Dominant language
- Python
- Stars
- 229
- Forks
- 52
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 8
Description
### Discussed in https://github.com/euroargodev/argopy/discussions/297
Originally posted by **gmaze** September 29, 2023
Given a standard xarray dataset loaded with argopy as a collection of samples, i.e. with a single dimension ``N_POINTS``.
Would it be nice to have an easy indexing and selecting API for Argo profiles using our ``argo`` accessor ?
This may look like this:
```python
ds.argo.sel(PLATFORM_NUMBER=1902605, CYCLE_NUMBER=4)
ds.argo.sel(wmo=1902605, cyc=4)
ds.argo.isel(PLATFORM_NUMBER=2, CYCLE_NUMBER=1)
ds.argo.isel(n_prof=12)
ds.argo.isel(wmo=2, cyc=1)
ds.argo[12] # n-eme profile
ds.argo[3, 123] # i-eme float, j-eme profile
```
This should require an efficient way to naviguate the ragged array structure of Argo samples.
May be Akward Array could be used here.
Contributor guide
Research direction
Start by reading discussion 297 and the proposed xarray accessor examples in this issue. Determine which sel, isel, and indexing forms should be supported for datasets with a single N_POINTS dimension, and evaluate the mention of Awkward Array for navigating ragged Argo samples. Done means the API scope and efficient indexing approach are agreed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100