ziphy 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ziphy-0.1.0/.agents/skills/ziphy-animate/SKILL.md +74 -0
- ziphy-0.1.0/.agents/skills/ziphy-animate/references/wmo-cf-parameters.md +35 -0
- ziphy-0.1.0/.github/CODEOWNERS +1 -0
- ziphy-0.1.0/.github/workflows/ci.yml +37 -0
- ziphy-0.1.0/.github/workflows/docs.yml +55 -0
- ziphy-0.1.0/.github/workflows/release.yml +50 -0
- ziphy-0.1.0/.gitignore +13 -0
- ziphy-0.1.0/.pre-commit-config.yaml +15 -0
- ziphy-0.1.0/.python-version +1 -0
- ziphy-0.1.0/LICENSE +21 -0
- ziphy-0.1.0/PKG-INFO +123 -0
- ziphy-0.1.0/README.md +70 -0
- ziphy-0.1.0/docs/api.md +10 -0
- ziphy-0.1.0/docs/cli.md +41 -0
- ziphy-0.1.0/docs/implementation_plan.md +209 -0
- ziphy-0.1.0/docs/index.md +27 -0
- ziphy-0.1.0/docs/use-cases.md +89 -0
- ziphy-0.1.0/mkdocs.yml +55 -0
- ziphy-0.1.0/pyproject.toml +88 -0
- ziphy-0.1.0/src/ziphy/__init__.py +28 -0
- ziphy-0.1.0/src/ziphy/cli.py +378 -0
- ziphy-0.1.0/src/ziphy/coords.py +607 -0
- ziphy-0.1.0/src/ziphy/gif.py +53 -0
- ziphy-0.1.0/src/ziphy/params.py +551 -0
- ziphy-0.1.0/src/ziphy/prep.py +189 -0
- ziphy-0.1.0/src/ziphy/projection.py +185 -0
- ziphy-0.1.0/src/ziphy/render.py +456 -0
- ziphy-0.1.0/src/ziphy/store.py +320 -0
- ziphy-0.1.0/tests/conftest.py +253 -0
- ziphy-0.1.0/tests/test_cli.py +101 -0
- ziphy-0.1.0/tests/test_coords.py +128 -0
- ziphy-0.1.0/tests/test_params.py +74 -0
- ziphy-0.1.0/tests/test_render_gif.py +195 -0
- ziphy-0.1.0/tests/test_store.py +137 -0
- ziphy-0.1.0/uv.lock +3878 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ziphy-animate
|
|
3
|
+
description: >-
|
|
4
|
+
Animate meteorological Zarr, Icechunk, and virtual Zarr (Kerchunk/VirtualiZarr)
|
|
5
|
+
datastores (e.g., AIFS, MOGREPS-G, GOES) into GIFs using the ziphy CLI. Use
|
|
6
|
+
whenever the user asks to inspect a weather datastore or generate an animated
|
|
7
|
+
forecast/satellite GIF over a date range, across multiple parameters, or across
|
|
8
|
+
ensemble realizations.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# `ziphy` Meteorological GIF Workflow
|
|
12
|
+
|
|
13
|
+
Use `ziphy` (via `uv run ziphy` from the repository root) to inspect meteorological datastores and render animated GIFs over temporal dimensions, date ranges, multi-parameter subplots, and ensemble realizations.
|
|
14
|
+
|
|
15
|
+
## Step 1: Inspect the Datastore First
|
|
16
|
+
|
|
17
|
+
Always inspect an unfamiliar store before rendering to verify variable names, WMO/CF identifiers, temporal dimension names and bounds, realization dimensions, and unpinned extra dimensions (such as `init_time` or `pressure_level`):
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
uv run ziphy inspect <source> [--format auto|zarr|icechunk|kerchunk] [--branch main] [--anon]
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Step 2: Choose Parameters, Time Range, and Ensemble Mode
|
|
24
|
+
|
|
25
|
+
1. **Parameters (`-p / --param`)**:
|
|
26
|
+
- Pass variable names (`t2m`), CF `standard_name`s (`air_temperature`), WMO/ecCodes `paramId`s (`167`, `151`), or WMO GRIB2 triplets (`0-0-0`, `0-3-1`).
|
|
27
|
+
- See [WMO & CF Parameter Reference](./references/wmo-cf-parameters.md) for the built-in crosswalk.
|
|
28
|
+
2. **Temporal Dimension & Date Range (`-t`, `--start-date`, `--end-date`)**:
|
|
29
|
+
- Specify `-t <time_dim>` when multiple temporal axes exist (e.g., `-t lead_time` vs `init_time`).
|
|
30
|
+
- Filter with `--start-date` and `--end-date` using ISO 8601 dates/timestamps (`2026-12-01`, `2026-12-01T12:00`) or lead-time durations (`0h`, `48h`). Date-only `--end-date` values are inclusive of the full day.
|
|
31
|
+
- When `-t lead_time` is paired with ISO dates, pin `init_time` (e.g., `--isel init_time=-1`) so `ziphy` maps `init_time + lead_time` to `valid_time`.
|
|
32
|
+
3. **Ensemble / Realization Handling**:
|
|
33
|
+
- **Single parameter** with a realization/ensemble coordinate (`realization`, `ensemble_member`, `number`) automatically plots **all realizations** in a grid with a shared colorbar. Use `--max-realizations` or `--realizations 0,1,2,3` to subset large ensembles (e.g., 51-member AIFS).
|
|
34
|
+
- **Multiple parameters** (`-p var1 -p var2`) on an ensemble dataset require either `--realization <id>` or `--reduce <mean|std|min|max|median>`.
|
|
35
|
+
4. **Pin Extra Dimensions & Large Grids**:
|
|
36
|
+
- Pin any extra dimension of size > 1 with `--sel dim=value` or `--isel dim=index` (e.g., `--sel pressure_level=500`).
|
|
37
|
+
- Crop large domains with `--bbox lon_min,lat_min,lon_max,lat_max`, adjust `--max-pixels` / `--coarsen` for high-resolution satellite grids (e.g., GOES ABI), or use `--proj none` for fast raw-grid rendering without Cartopy coastlines.
|
|
38
|
+
|
|
39
|
+
## Common Recipes
|
|
40
|
+
|
|
41
|
+
### Single parameter across all ensemble realizations (MOGREPS-G / AIFS)
|
|
42
|
+
```bash
|
|
43
|
+
uv run ziphy render /path/to/aifs.icechunk \
|
|
44
|
+
-p 167 -t lead_time --isel init_time=-1 \
|
|
45
|
+
--start-date 2026-12-05T00:00 --end-date 2026-12-07T00:00 \
|
|
46
|
+
-o aifs_t2m_ens.gif
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Multi-parameter multiplot with WMO IDs and CF names
|
|
50
|
+
```bash
|
|
51
|
+
uv run ziphy render /path/to/surface.zarr \
|
|
52
|
+
-p air_temperature -p 151 -p 0-1-8 \
|
|
53
|
+
-t time --start-date 2026-12-01 --end-date 2026-12-03 \
|
|
54
|
+
--robust -o surface_multi.gif
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### GOES geostationary imagery (virtual Kerchunk or Zarr)
|
|
58
|
+
```bash
|
|
59
|
+
uv run ziphy render /path/to/goes_refs.json \
|
|
60
|
+
-p toa_brightness_temperature -t t --max-pixels 800 \
|
|
61
|
+
--proj geostationary -o goes_ir.gif
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Step 3: Verify Output
|
|
65
|
+
|
|
66
|
+
After rendering, verify the output GIF exists and check its frame count and dimensions:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
uv run python -c "
|
|
70
|
+
from PIL import Image
|
|
71
|
+
with Image.open('out.gif') as im:
|
|
72
|
+
print(im.format, im.size, 'animated=', getattr(im, 'is_animated', False), 'frames=', im.n_frames)
|
|
73
|
+
"
|
|
74
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# WMO ID & CF Parameter Reference
|
|
2
|
+
|
|
3
|
+
`ziphy` resolves `-p / --param` using:
|
|
4
|
+
1. Exact or case-insensitive dataset variable name
|
|
5
|
+
2. Dataset attributes (`GRIB_paramId`, `paramId`, `wmo_id`, `wmo_code`, `grib_param_id`, GRIB2 `discipline`/`parameterCategory`/`parameterNumber`, `standard_name`, `GRIB_cfName`, `long_name`)
|
|
6
|
+
3. `cf_xarray` lookup
|
|
7
|
+
4. Built-in WMO ↔ CF crosswalk registry (shown below)
|
|
8
|
+
|
|
9
|
+
| Parameter | WMO / ecCodes ID | GRIB2 Triplet | CF `standard_name` | Common Short Names |
|
|
10
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
11
|
+
| 2m Air Temperature | `167` | `0-0-0` | `air_temperature` | `t2m`, `2t`, `tas`, `temp_2m` |
|
|
12
|
+
| Air Temperature | `130` | `0-0-0` | `air_temperature` | `t`, `ta`, `temp` |
|
|
13
|
+
| 2m Dew Point Temperature | `168` | `0-0-6` | `dew_point_temperature` | `d2m`, `2d`, `tdps` |
|
|
14
|
+
| Mean Sea Level Pressure | `151` | `0-3-1` | `air_pressure_at_mean_sea_level` | `msl`, `mslp`, `prmsl`, `psl` |
|
|
15
|
+
| Surface Air Pressure | `134` | `0-3-0` | `surface_air_pressure` | `sp`, `ps` |
|
|
16
|
+
| 10m Eastward Wind | `165` | `0-2-2` | `eastward_wind` | `u10`, `10u`, `uas` |
|
|
17
|
+
| 10m Northward Wind | `166` | `0-2-3` | `northward_wind` | `v10`, `10v`, `vas` |
|
|
18
|
+
| Eastward Wind | `131` | `0-2-2` | `eastward_wind` | `u`, `ua`, `ugrd` |
|
|
19
|
+
| Northward Wind | `132` | `0-2-3` | `northward_wind` | `v`, `va`, `vgrd` |
|
|
20
|
+
| 10m Wind Speed | `207`, `10` | `0-2-1` | `wind_speed` | `si10`, `ws10`, `sfcWind` |
|
|
21
|
+
| Total Precipitation | `228`, `228228` | `0-1-8` | `precipitation_amount`, `lwe_thickness_of_precipitation_amount` | `tp`, `pr`, `apcp`, `precip` |
|
|
22
|
+
| Precipitation Rate | `260018` | `0-1-52` | `rainfall_rate`, `lwe_precipitation_rate` | `tprate`, `prate` |
|
|
23
|
+
| Geopotential | `129` | `0-3-4` | `geopotential` | `z` |
|
|
24
|
+
| Geopotential Height | `156` | `0-3-5` | `geopotential_height` | `gh`, `zg`, `hgt` |
|
|
25
|
+
| Specific Humidity | `133` | `0-1-0` | `specific_humidity` | `q`, `hus`, `spfh` |
|
|
26
|
+
| Relative Humidity | `157` | `0-1-1` | `relative_humidity` | `r`, `rh`, `hur` |
|
|
27
|
+
| Total Cloud Cover | `164` | `0-6-1` | `cloud_area_fraction` | `tcc`, `clt`, `cloud_cover` |
|
|
28
|
+
| CAPE | `59` | `0-7-6` | `atmosphere_convective_available_potential_energy` | `cape` |
|
|
29
|
+
| Sea Surface Temperature | `34` | `10-3-0` | `sea_surface_temperature` | `sst`, `tos` |
|
|
30
|
+
| Sea Ice Fraction | `31` | `10-2-0` | `sea_ice_area_fraction` | `siconc`, `ci`, `sic` |
|
|
31
|
+
| Snow Depth | `141` | `0-1-11` | `lwe_thickness_of_surface_snow_amount` | `sd`, `snw` |
|
|
32
|
+
| Surface Solar Radiation | `169` | `0-4-7` | `surface_downwelling_shortwave_flux_in_air` | `ssrd`, `rsds` |
|
|
33
|
+
| TOA Outgoing Longwave | `179` | `0-5-4` | `toa_outgoing_longwave_flux` | `ttr`, `olr`, `rlut` |
|
|
34
|
+
| TOA Brightness Temp (GOES) | - | `3-1-14` | `toa_brightness_temperature` | `CMI`, `CMI_C13`, `Rad` |
|
|
35
|
+
| TOA Reflectance (GOES) | - | `3-1-1` | `toa_bidirectional_reflectance` | `CMI_C02`, `reflectance` |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* s-boardman
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
lint-and-test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- name: Check out repository
|
|
14
|
+
uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- name: Install uv
|
|
17
|
+
uses: astral-sh/setup-uv@v5
|
|
18
|
+
with:
|
|
19
|
+
enable-cache: true
|
|
20
|
+
|
|
21
|
+
- name: Set up Python 3.12
|
|
22
|
+
run: uv python install 3.12
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: uv sync --all-extras --locked
|
|
26
|
+
|
|
27
|
+
- name: Run pre-commit hooks
|
|
28
|
+
run: uv run pre-commit run --all-files
|
|
29
|
+
|
|
30
|
+
- name: Run pytest
|
|
31
|
+
run: uv run pytest -v
|
|
32
|
+
|
|
33
|
+
- name: Build package distributions
|
|
34
|
+
run: uv build
|
|
35
|
+
|
|
36
|
+
- name: Validate package metadata
|
|
37
|
+
run: uvx twine check dist/*
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
name: Docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
pages: write
|
|
12
|
+
id-token: write
|
|
13
|
+
|
|
14
|
+
concurrency:
|
|
15
|
+
group: pages
|
|
16
|
+
cancel-in-progress: false
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
build:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- name: Check out repository
|
|
23
|
+
uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
- name: Install uv
|
|
26
|
+
uses: astral-sh/setup-uv@v5
|
|
27
|
+
with:
|
|
28
|
+
enable-cache: true
|
|
29
|
+
|
|
30
|
+
- name: Set up Python 3.12
|
|
31
|
+
run: uv python install 3.12
|
|
32
|
+
|
|
33
|
+
- name: Install dependencies
|
|
34
|
+
run: uv sync --all-extras --locked
|
|
35
|
+
|
|
36
|
+
- name: Build MkDocs site
|
|
37
|
+
run: uv run mkdocs build --strict
|
|
38
|
+
|
|
39
|
+
- name: Upload GitHub Pages artifact
|
|
40
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
41
|
+
uses: actions/upload-pages-artifact@v3
|
|
42
|
+
with:
|
|
43
|
+
path: site
|
|
44
|
+
|
|
45
|
+
deploy:
|
|
46
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
47
|
+
needs: build
|
|
48
|
+
runs-on: ubuntu-latest
|
|
49
|
+
environment:
|
|
50
|
+
name: github-pages
|
|
51
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
52
|
+
steps:
|
|
53
|
+
- name: Deploy to GitHub Pages
|
|
54
|
+
id: deployment
|
|
55
|
+
uses: actions/deploy-pages@v4
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- name: Check out repository
|
|
12
|
+
uses: actions/checkout@v4
|
|
13
|
+
|
|
14
|
+
- name: Install uv
|
|
15
|
+
uses: astral-sh/setup-uv@v5
|
|
16
|
+
with:
|
|
17
|
+
enable-cache: true
|
|
18
|
+
|
|
19
|
+
- name: Set up Python 3.12
|
|
20
|
+
run: uv python install 3.12
|
|
21
|
+
|
|
22
|
+
- name: Build sdist and wheel
|
|
23
|
+
run: uv build
|
|
24
|
+
|
|
25
|
+
- name: Check distributions
|
|
26
|
+
run: uvx twine check dist/*
|
|
27
|
+
|
|
28
|
+
- name: Upload distribution artifacts
|
|
29
|
+
uses: actions/upload-artifact@v4
|
|
30
|
+
with:
|
|
31
|
+
name: dist
|
|
32
|
+
path: dist/
|
|
33
|
+
|
|
34
|
+
publish-pypi:
|
|
35
|
+
needs: build
|
|
36
|
+
runs-on: ubuntu-latest
|
|
37
|
+
environment:
|
|
38
|
+
name: pypi
|
|
39
|
+
url: https://pypi.org/p/ziphy
|
|
40
|
+
permissions:
|
|
41
|
+
id-token: write
|
|
42
|
+
steps:
|
|
43
|
+
- name: Download distribution artifacts
|
|
44
|
+
uses: actions/download-artifact@v4
|
|
45
|
+
with:
|
|
46
|
+
name: dist
|
|
47
|
+
path: dist/
|
|
48
|
+
|
|
49
|
+
- name: Publish to PyPI
|
|
50
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
ziphy-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v6.0.0 # Use the ref you want to point at
|
|
4
|
+
hooks:
|
|
5
|
+
- id: check-toml
|
|
6
|
+
- id: end-of-file-fixer
|
|
7
|
+
- id: name-tests-test
|
|
8
|
+
args: ["--pytest-test-first"]
|
|
9
|
+
- id: trailing-whitespace
|
|
10
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
11
|
+
rev: v0.5.1
|
|
12
|
+
hooks:
|
|
13
|
+
- id: ruff
|
|
14
|
+
args: [--fix]
|
|
15
|
+
- id: ruff-format
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
ziphy-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Simon Boardman
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
ziphy-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: ziphy
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Animate meteorological Zarr, Icechunk, and virtual Zarr datastores into GIFs across time, parameters, and ensemble realizations.
|
|
5
|
+
Project-URL: Homepage, https://github.com/s-boardman/ziphy
|
|
6
|
+
Project-URL: Documentation, https://s-boardman.github.io/ziphy/
|
|
7
|
+
Project-URL: Repository, https://github.com/s-boardman/ziphy
|
|
8
|
+
Project-URL: Issues, https://github.com/s-boardman/ziphy/issues
|
|
9
|
+
Author-email: Simon Boardman <simonboardman@gmail.com>
|
|
10
|
+
License: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
20
|
+
Requires-Python: >=3.12
|
|
21
|
+
Requires-Dist: aiohttp>=3.10
|
|
22
|
+
Requires-Dist: cartopy>=0.24
|
|
23
|
+
Requires-Dist: cf-xarray>=0.9
|
|
24
|
+
Requires-Dist: dask>=2024.8
|
|
25
|
+
Requires-Dist: fsspec>=2024.9
|
|
26
|
+
Requires-Dist: gcsfs>=2024.9
|
|
27
|
+
Requires-Dist: h5netcdf>=1.4
|
|
28
|
+
Requires-Dist: h5py>=3.12
|
|
29
|
+
Requires-Dist: icechunk>=2.0
|
|
30
|
+
Requires-Dist: kerchunk>=0.2.7
|
|
31
|
+
Requires-Dist: matplotlib>=3.9
|
|
32
|
+
Requires-Dist: netcdf4>=1.7
|
|
33
|
+
Requires-Dist: numpy>=2.0
|
|
34
|
+
Requires-Dist: pandas>=2.2
|
|
35
|
+
Requires-Dist: pillow>=10.4
|
|
36
|
+
Requires-Dist: pyproj>=3.7
|
|
37
|
+
Requires-Dist: rich>=13.9
|
|
38
|
+
Requires-Dist: s3fs>=2024.9
|
|
39
|
+
Requires-Dist: shapely>=2.0
|
|
40
|
+
Requires-Dist: typer>=0.15
|
|
41
|
+
Requires-Dist: virtualizarr>=2.0
|
|
42
|
+
Requires-Dist: xarray>=2025.1
|
|
43
|
+
Requires-Dist: zarr>=3.0
|
|
44
|
+
Provides-Extra: dev
|
|
45
|
+
Requires-Dist: pytest>=8.3; extra == 'dev'
|
|
46
|
+
Requires-Dist: ruff>=0.8; extra == 'dev'
|
|
47
|
+
Requires-Dist: scipy>=1.14; extra == 'dev'
|
|
48
|
+
Provides-Extra: docs
|
|
49
|
+
Requires-Dist: mkdocs-material>=9.5; extra == 'docs'
|
|
50
|
+
Requires-Dist: mkdocs>=1.6; extra == 'docs'
|
|
51
|
+
Requires-Dist: mkdocstrings[python]>=0.26; extra == 'docs'
|
|
52
|
+
Description-Content-Type: text/markdown
|
|
53
|
+
|
|
54
|
+
# ziphy
|
|
55
|
+
|
|
56
|
+
[](https://github.com/s-boardman/ziphy/actions/workflows/ci.yml)
|
|
57
|
+
[](https://github.com/s-boardman/ziphy/actions/workflows/docs.yml)
|
|
58
|
+
[](https://github.com/s-boardman/ziphy/actions/workflows/release.yml)
|
|
59
|
+
[](https://pypi.org/project/ziphy/)
|
|
60
|
+
[](https://www.python.org/downloads/)
|
|
61
|
+
|
|
62
|
+
Animate meteorological **Zarr**, **Icechunk**, and **virtual Zarr** (Kerchunk / VirtualiZarr) datastores (e.g., AIFS, MOGREPS-G, GOES) into GIFs across a temporal dimension.
|
|
63
|
+
|
|
64
|
+
> **Disclaimer:** This project was agentically generated by Simon Boardman using Gemini.
|
|
65
|
+
|
|
66
|
+
## Features
|
|
67
|
+
|
|
68
|
+
- **Datastore Support**: Standard Zarr v2/v3 (local, HTTP/HTTPS, S3, GCS), Icechunk repositories (branches, tags, snapshots, virtual chunks), Kerchunk reference files (`.json` / `.parquet`), and VirtualiZarr virtual Icechunk stores.
|
|
69
|
+
- **WMO ID & CF Parameter Selection**: Specify parameters by raw variable name (`t2m`), CF `standard_name` (`air_temperature`), WMO/ecCodes `paramId` (`167`, `151`), or WMO GRIB2 triplet (`0-0-0`, `0-3-1`).
|
|
70
|
+
- **Date-Range Filtering**: Filter frames with `--start-date` / `--end-date` (ISO 8601 dates/timestamps, `cftime`, duration bounds like `0h`–`72h`, or `valid_time` mapping over `lead_time`/`step`).
|
|
71
|
+
- **Ensemble Realizations & Multi-Parameter Plots**:
|
|
72
|
+
- Single parameter + realization/ensemble coordinate → automatically plots **all realizations** in a grid with a shared colorbar.
|
|
73
|
+
- Multiple parameters → creates a **multiplot** with per-parameter colormaps, units, and non-flickering global color bounds.
|
|
74
|
+
- **Cartopy Projections & Fast Fallback**: Auto-detects CF `grid_mapping` projections (`goes_imager_projection`, `rotated_latitude_longitude`, `lambert_conformal_conic`, `PlateCarree`) with `--proj none` raw-grid fallback.
|
|
75
|
+
|
|
76
|
+
## Installation
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
uv pip install ziphy
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Or for local development:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
git clone https://github.com/s-boardman/ziphy.git
|
|
86
|
+
cd ziphy
|
|
87
|
+
uv sync --all-extras
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Quick Start
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Inspect variables, WMO IDs, CF names, temporal bounds, and realizations
|
|
94
|
+
uv run ziphy inspect /path/to/forecast.zarr
|
|
95
|
+
|
|
96
|
+
# Single parameter across all ensemble realizations with a date range
|
|
97
|
+
uv run ziphy render /path/to/aifs.icechunk \
|
|
98
|
+
-p 167 -t lead_time --isel init_time=-1 \
|
|
99
|
+
--start-date 2026-12-05T00:00 --end-date 2026-12-07T00:00 \
|
|
100
|
+
-o aifs_t2m.gif
|
|
101
|
+
|
|
102
|
+
# Multi-parameter multiplot mixing CF names, WMO IDs, and GRIB2 triplets
|
|
103
|
+
uv run ziphy render /path/to/surface.zarr \
|
|
104
|
+
-p air_temperature -p 151 -p 0-1-8 \
|
|
105
|
+
-t time --start-date 2026-12-01 --end-date 2026-12-03 \
|
|
106
|
+
-o multi.gif
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Documentation & Agent Skill
|
|
110
|
+
|
|
111
|
+
- Full documentation: [https://s-boardman.github.io/ziphy/](https://s-boardman.github.io/ziphy/)
|
|
112
|
+
- Agent skill for automated workflows: [.agents/skills/ziphy-animate/SKILL.md](.agents/skills/ziphy-animate/SKILL.md)
|
|
113
|
+
- Implementation plan: [docs/implementation_plan.md](docs/implementation_plan.md)
|
|
114
|
+
|
|
115
|
+
## Development & Releases
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
uv run pre-commit run --all-files
|
|
119
|
+
uv run pytest -v
|
|
120
|
+
uv run mkdocs build --strict
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Publishing to PyPI uses GitHub Actions Trusted Publishing (OIDC) in [.github/workflows/release.yml](.github/workflows/release.yml) whenever a GitHub Release is published for a version tag (e.g., `v0.1.0`).
|
ziphy-0.1.0/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# ziphy
|
|
2
|
+
|
|
3
|
+
[](https://github.com/s-boardman/ziphy/actions/workflows/ci.yml)
|
|
4
|
+
[](https://github.com/s-boardman/ziphy/actions/workflows/docs.yml)
|
|
5
|
+
[](https://github.com/s-boardman/ziphy/actions/workflows/release.yml)
|
|
6
|
+
[](https://pypi.org/project/ziphy/)
|
|
7
|
+
[](https://www.python.org/downloads/)
|
|
8
|
+
|
|
9
|
+
Animate meteorological **Zarr**, **Icechunk**, and **virtual Zarr** (Kerchunk / VirtualiZarr) datastores (e.g., AIFS, MOGREPS-G, GOES) into GIFs across a temporal dimension.
|
|
10
|
+
|
|
11
|
+
> **Disclaimer:** This project was agentically generated by Simon Boardman using Gemini.
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- **Datastore Support**: Standard Zarr v2/v3 (local, HTTP/HTTPS, S3, GCS), Icechunk repositories (branches, tags, snapshots, virtual chunks), Kerchunk reference files (`.json` / `.parquet`), and VirtualiZarr virtual Icechunk stores.
|
|
16
|
+
- **WMO ID & CF Parameter Selection**: Specify parameters by raw variable name (`t2m`), CF `standard_name` (`air_temperature`), WMO/ecCodes `paramId` (`167`, `151`), or WMO GRIB2 triplet (`0-0-0`, `0-3-1`).
|
|
17
|
+
- **Date-Range Filtering**: Filter frames with `--start-date` / `--end-date` (ISO 8601 dates/timestamps, `cftime`, duration bounds like `0h`–`72h`, or `valid_time` mapping over `lead_time`/`step`).
|
|
18
|
+
- **Ensemble Realizations & Multi-Parameter Plots**:
|
|
19
|
+
- Single parameter + realization/ensemble coordinate → automatically plots **all realizations** in a grid with a shared colorbar.
|
|
20
|
+
- Multiple parameters → creates a **multiplot** with per-parameter colormaps, units, and non-flickering global color bounds.
|
|
21
|
+
- **Cartopy Projections & Fast Fallback**: Auto-detects CF `grid_mapping` projections (`goes_imager_projection`, `rotated_latitude_longitude`, `lambert_conformal_conic`, `PlateCarree`) with `--proj none` raw-grid fallback.
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
uv pip install ziphy
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Or for local development:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
git clone https://github.com/s-boardman/ziphy.git
|
|
33
|
+
cd ziphy
|
|
34
|
+
uv sync --all-extras
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Quick Start
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Inspect variables, WMO IDs, CF names, temporal bounds, and realizations
|
|
41
|
+
uv run ziphy inspect /path/to/forecast.zarr
|
|
42
|
+
|
|
43
|
+
# Single parameter across all ensemble realizations with a date range
|
|
44
|
+
uv run ziphy render /path/to/aifs.icechunk \
|
|
45
|
+
-p 167 -t lead_time --isel init_time=-1 \
|
|
46
|
+
--start-date 2026-12-05T00:00 --end-date 2026-12-07T00:00 \
|
|
47
|
+
-o aifs_t2m.gif
|
|
48
|
+
|
|
49
|
+
# Multi-parameter multiplot mixing CF names, WMO IDs, and GRIB2 triplets
|
|
50
|
+
uv run ziphy render /path/to/surface.zarr \
|
|
51
|
+
-p air_temperature -p 151 -p 0-1-8 \
|
|
52
|
+
-t time --start-date 2026-12-01 --end-date 2026-12-03 \
|
|
53
|
+
-o multi.gif
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Documentation & Agent Skill
|
|
57
|
+
|
|
58
|
+
- Full documentation: [https://s-boardman.github.io/ziphy/](https://s-boardman.github.io/ziphy/)
|
|
59
|
+
- Agent skill for automated workflows: [.agents/skills/ziphy-animate/SKILL.md](.agents/skills/ziphy-animate/SKILL.md)
|
|
60
|
+
- Implementation plan: [docs/implementation_plan.md](docs/implementation_plan.md)
|
|
61
|
+
|
|
62
|
+
## Development & Releases
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
uv run pre-commit run --all-files
|
|
66
|
+
uv run pytest -v
|
|
67
|
+
uv run mkdocs build --strict
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Publishing to PyPI uses GitHub Actions Trusted Publishing (OIDC) in [.github/workflows/release.yml](.github/workflows/release.yml) whenever a GitHub Release is published for a version tag (e.g., `v0.1.0`).
|
ziphy-0.1.0/docs/api.md
ADDED
ziphy-0.1.0/docs/cli.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# CLI Reference
|
|
2
|
+
|
|
3
|
+
`ziphy` provides two primary subcommands: `inspect` and `render`.
|
|
4
|
+
|
|
5
|
+
## `ziphy inspect`
|
|
6
|
+
|
|
7
|
+
Inspect variables, CF `standard_name`s, WMO IDs, temporal dimension bounds, and realization coordinates before rendering:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ziphy inspect <source> [OPTIONS]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Common options:
|
|
14
|
+
|
|
15
|
+
- `-f, --format [auto|zarr|icechunk|kerchunk]`
|
|
16
|
+
- `-g, --group <group>` — Zarr group path
|
|
17
|
+
- `--branch <name>` / `--tag <tag>` / `--snapshot-id <id>` — Icechunk version selectors
|
|
18
|
+
- `--anon` — anonymous cloud storage access (S3/GCS)
|
|
19
|
+
- `--region <region>` — cloud region
|
|
20
|
+
- `--remote-protocol <proto>` — remote protocol for Kerchunk reference stores
|
|
21
|
+
|
|
22
|
+
## `ziphy render`
|
|
23
|
+
|
|
24
|
+
Render an animated GIF iterating over a temporal dimension:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
ziphy render <source> -p <param> [-p <param2> ...] [OPTIONS] -o output.gif
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Key options:
|
|
31
|
+
|
|
32
|
+
- `-p, --param TEXT` (repeatable): Variable name, CF `standard_name`, WMO `paramId` (`167`), or GRIB2 triplet (`0-0-0`).
|
|
33
|
+
- `-t, --time-dim TEXT`: Temporal dimension to animate over (auto-detected if unambiguous).
|
|
34
|
+
- `--start-date, --start TEXT` / `--end-date, --end TEXT`: Date/time range (ISO 8601 or duration bounds like `0h`–`48h`).
|
|
35
|
+
- `--step INT` / `--max-frames INT`: Frame stride and cap.
|
|
36
|
+
- `-r, --realization TEXT` / `--realizations TEXT` / `--max-realizations INT` / `--reduce [mean|std|min|max|median]`: Realization controls.
|
|
37
|
+
- `--sel dim=val` / `--isel dim=idx`: Pin extra dimensions (e.g., `--sel pressure_level=500 --isel init_time=-1`).
|
|
38
|
+
- `--bbox lon_min,lat_min,lon_max,lat_max`: Spatial bounding box crop.
|
|
39
|
+
- `--proj [auto|platecarree|robinson|orthographic|geostationary|none]`: Cartopy projection or raw-grid fallback.
|
|
40
|
+
- `--cmap` / `--cmaps` / `--vmin` / `--vmax` / `--robust`: Colormap and scaling options.
|
|
41
|
+
- `--fps` / `--duration-ms` / `--dpi` / `--figsize` / `--layout`: Animation timing and figure styling.
|