anemoi-datasets 0.3.10__tar.gz → 0.4.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.
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/.github/workflows/python-publish.yml +2 -2
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/.gitignore +1 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/PKG-INFO +8 -7
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/subsetting.rst +2 -2
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/pyproject.toml +13 -7
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/_version.py +2 -2
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/commands/inspect.py +6 -6
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/commands/scan.py +4 -4
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/compute/recentre.py +14 -9
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/config.py +1 -1
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/functions/__init__.py +3 -3
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/functions/filters/empty.py +4 -4
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/functions/filters/rename.py +6 -6
- anemoi_datasets-0.4.0/src/anemoi/datasets/create/functions/filters/rotate_winds.py +80 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/functions/filters/unrotate_winds.py +14 -64
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/functions/sources/accumulations.py +27 -15
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/functions/sources/constants.py +8 -4
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/functions/sources/empty.py +2 -2
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/functions/sources/forcings.py +3 -3
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/functions/sources/grib.py +4 -4
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/functions/sources/hindcasts.py +24 -11
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/functions/sources/mars.py +5 -5
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/functions/sources/netcdf.py +4 -4
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/functions/sources/source.py +3 -3
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/functions/sources/tendencies.py +7 -7
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/input.py +19 -19
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/loaders.py +35 -6
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/statistics/__init__.py +2 -1
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/utils.py +6 -5
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/data/dataset.py +4 -4
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/data/stores.py +13 -5
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi_datasets.egg-info/PKG-INFO +8 -7
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi_datasets.egg-info/requires.txt +7 -6
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/tests/create/test_create.py +9 -9
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/tests/test_data.py +7 -1
- anemoi_datasets-0.3.10/src/anemoi/datasets/create/functions/filters/rotate_winds.py +0 -133
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/.pre-commit-config.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/.readthedocs.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/.vscode/spellright.dict +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/LICENSE +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/README.md +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/Makefile +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/_static/logo.png +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/_static/style.css +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/_templates/.gitkeep +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/apply-fmt.sh +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/filters/empty.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/filters/noop.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/filters/rename.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/filters/rotate_winds.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/filters/select.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/filters/unrotate_winds.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/filters.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/handling-missing-dates.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/handling-missing-values.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/introduction.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/naming-variables.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/operations.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/sources/accumulations.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/sources/accumulations1.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/sources/accumulations2.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/sources/forcings.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/sources/forcings.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/sources/grib.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/sources/hindcasts.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/sources/mars.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/sources/mars1.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/sources/mars2.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/sources/netcdf.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/sources/netcdf.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/sources/opendap.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/sources/opendap.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/sources/recentre.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/sources/yaml/grib1.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/sources/yaml/grib2.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/sources/yaml/grib3.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/sources/yaml/grib4.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/sources/yaml/hindcasts.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/sources/yaml/recentre.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/sources.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/statistics.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/syntax.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/syntax.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/yaml/Makefile +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/yaml/building1.txt +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/yaml/building1.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/yaml/building2.txt +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/yaml/building2.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/yaml/building3.txt +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/yaml/building3.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/yaml/concat.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/yaml/hindcasts.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/yaml/input.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/yaml/missing_dates.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/yaml/nan.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/building/yaml/pipe.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/check-index.sh +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/cli/compare.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/cli/copy.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/cli/create.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/cli/inspect.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/cli/introduction.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/cli/scan.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/conf.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/images.pptx +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/index.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/installing.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/overview.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/overview_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/requirements.txt +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/schemas/matrix.excalidraw +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/schemas/matrix.png +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/schemas/overview.excalidraw +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/schemas/overview.png +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/schemas/recipe.excalidraw +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/schemas/recipe.png +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/test.ipynb +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/area1_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/area2_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/chain_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/combine_example.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/concat1.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/cutout_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/drop_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/end_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/ensembles1_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/frequency_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/grids1_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/join1.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/matching0_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/matching1_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/matching2_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/matching3_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/matching4_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/misc1.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/misc2.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/missing_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/open_cloud.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/open_combine1_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/open_combine2_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/open_complex.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/open_dict_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/open_first_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/open_list_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/open_name.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/open_other.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/open_path.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/open_yaml_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/rename_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/reorder1_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/reorder2_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/select1_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/select2_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/shuffle_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/some_attributes_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/start_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/statistics_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/subset_example.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/thinning_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/zip1_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/code/zip2_.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/combining.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/configuration.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/configuration.toml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/grids.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/images/area-1.png +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/images/concat.png +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/images/cutout-1.png +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/images/cutout-2.png +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/images/cutout-3.png +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/images/cutout-4.png +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/images/join.png +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/images/overlay.png +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/images/thinning-after.png +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/images/thinning-before.png +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/introduction.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/matching.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/methods.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/miscellaneous.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/opening.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/other.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/selecting.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/docs/using/statistics.rst +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/setup.cfg +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/__init__.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/__main__.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/commands/__init__.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/commands/compare.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/commands/copy.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/commands/create.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/compute/__init__.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/__init__.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/check.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/chunks.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/functions/filters/__init__.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/functions/filters/noop.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/functions/sources/__init__.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/functions/sources/opendap.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/functions/sources/recentre.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/patch.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/persistent.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/size.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/statistics/summary.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/template.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/writer.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/zarr.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/data/__init__.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/data/concat.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/data/debug.css +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/data/debug.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/data/ensemble.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/data/forwards.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/data/grids.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/data/indexing.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/data/join.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/data/masked.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/data/misc.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/data/select.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/data/statistics.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/data/subset.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/data/unchecked.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/dates/__init__.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/dates/groups.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/grids.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/utils/__init__.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi_datasets.egg-info/SOURCES.txt +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi_datasets.egg-info/dependency_links.txt +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi_datasets.egg-info/entry_points.txt +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi_datasets.egg-info/top_level.txt +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/tests/create/concat.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/tests/create/data_sources.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/tests/create/join.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/tests/create/missing.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/tests/create/nan.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/tests/create/pipe.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/tests/create/recentre.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/tests/create-perturbations-full.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/tests/create-shift.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/tests/test_chunks.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/tests/test_dates.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/tests/test_indexing.py +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/tools/.gitignore +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/tools/examples/Makefile +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/tools/examples/an-oper-2023-2023-2p5-6h-v1.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/tools/grids/Makefile +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/tools/grids/grids.ipynb +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/tools/grids/grids1.yaml +0 -0
- {anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/tools/grids/grids2.yaml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: anemoi-datasets
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: A package to hold various functions to support training of ML models on ECMWF data.
|
|
5
5
|
Author-email: "European Centre for Medium-Range Weather Forecasts (ECMWF)" <software.support@ecmwf.int>
|
|
6
6
|
License: Apache License
|
|
@@ -223,7 +223,7 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
|
223
223
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
224
224
|
Requires-Python: >=3.9
|
|
225
225
|
License-File: LICENSE
|
|
226
|
-
Requires-Dist: anemoi-utils[provenance]>=0.3.
|
|
226
|
+
Requires-Dist: anemoi-utils[provenance]>=0.3.5
|
|
227
227
|
Requires-Dist: numpy
|
|
228
228
|
Requires-Dist: pyyaml
|
|
229
229
|
Requires-Dist: semantic-version
|
|
@@ -231,7 +231,8 @@ Requires-Dist: tqdm
|
|
|
231
231
|
Requires-Dist: zarr<=2.17
|
|
232
232
|
Provides-Extra: all
|
|
233
233
|
Requires-Dist: boto3; extra == "all"
|
|
234
|
-
Requires-Dist:
|
|
234
|
+
Requires-Dist: earthkit-data[mars]>=0.9; extra == "all"
|
|
235
|
+
Requires-Dist: earthkit-geo>=0.2; extra == "all"
|
|
235
236
|
Requires-Dist: earthkit-meteo; extra == "all"
|
|
236
237
|
Requires-Dist: ecmwflibs>=0.6.3; extra == "all"
|
|
237
238
|
Requires-Dist: entrypoints; extra == "all"
|
|
@@ -239,14 +240,16 @@ Requires-Dist: pyproj; extra == "all"
|
|
|
239
240
|
Requires-Dist: requests; extra == "all"
|
|
240
241
|
Requires-Dist: s3fs; extra == "all"
|
|
241
242
|
Provides-Extra: create
|
|
242
|
-
Requires-Dist:
|
|
243
|
+
Requires-Dist: earthkit-data[mars]>=0.9; extra == "create"
|
|
244
|
+
Requires-Dist: earthkit-geo>=0.2; extra == "create"
|
|
243
245
|
Requires-Dist: earthkit-meteo; extra == "create"
|
|
244
246
|
Requires-Dist: ecmwflibs>=0.6.3; extra == "create"
|
|
245
247
|
Requires-Dist: entrypoints; extra == "create"
|
|
246
248
|
Requires-Dist: pyproj; extra == "create"
|
|
247
249
|
Provides-Extra: dev
|
|
248
250
|
Requires-Dist: boto3; extra == "dev"
|
|
249
|
-
Requires-Dist:
|
|
251
|
+
Requires-Dist: earthkit-data[mars]>=0.9; extra == "dev"
|
|
252
|
+
Requires-Dist: earthkit-geo>=0.2; extra == "dev"
|
|
250
253
|
Requires-Dist: earthkit-meteo; extra == "dev"
|
|
251
254
|
Requires-Dist: ecmwflibs>=0.6.3; extra == "dev"
|
|
252
255
|
Requires-Dist: entrypoints; extra == "dev"
|
|
@@ -257,13 +260,11 @@ Requires-Dist: pytest; extra == "dev"
|
|
|
257
260
|
Requires-Dist: requests; extra == "dev"
|
|
258
261
|
Requires-Dist: s3fs; extra == "dev"
|
|
259
262
|
Requires-Dist: sphinx; extra == "dev"
|
|
260
|
-
Requires-Dist: sphinx-argparse; extra == "dev"
|
|
261
263
|
Requires-Dist: sphinx-rtd-theme; extra == "dev"
|
|
262
264
|
Provides-Extra: docs
|
|
263
265
|
Requires-Dist: nbsphinx; extra == "docs"
|
|
264
266
|
Requires-Dist: pandoc; extra == "docs"
|
|
265
267
|
Requires-Dist: sphinx; extra == "docs"
|
|
266
|
-
Requires-Dist: sphinx-argparse; extra == "docs"
|
|
267
268
|
Requires-Dist: sphinx-rtd-theme; extra == "docs"
|
|
268
269
|
Provides-Extra: remote
|
|
269
270
|
Requires-Dist: boto3; extra == "remote"
|
|
@@ -40,9 +40,9 @@ while ``end="2020"`` is equivalent to ``end="2020-12-31"``.
|
|
|
40
40
|
|
|
41
41
|
Note also how the ``frequency`` of the dataset will change how the
|
|
42
42
|
``end`` option is interpreted: - ``end="2020"`` with a ``frequency`` of
|
|
43
|
-
one hour is equivalent to ``end="2020-12-31 23:00"`` - ``end="2020"``
|
|
43
|
+
one hour is equivalent to ``end="2020-12-31 23:00:00"`` - ``end="2020"``
|
|
44
44
|
with a ``frequency`` of 6 hours is equivalent to ``end="2020-12-31
|
|
45
|
-
18:00"``
|
|
45
|
+
18:00:00"``
|
|
46
46
|
|
|
47
47
|
.. _frequency:
|
|
48
48
|
|
|
@@ -50,17 +50,19 @@ dynamic = [
|
|
|
50
50
|
"version",
|
|
51
51
|
]
|
|
52
52
|
dependencies = [
|
|
53
|
-
"anemoi-utils[provenance]>=0.3.
|
|
53
|
+
"anemoi-utils[provenance]>=0.3.5",
|
|
54
54
|
"numpy",
|
|
55
55
|
"pyyaml",
|
|
56
56
|
"semantic-version",
|
|
57
57
|
"tqdm",
|
|
58
58
|
"zarr<=2.17",
|
|
59
|
+
|
|
59
60
|
]
|
|
60
61
|
|
|
61
62
|
optional-dependencies.all = [
|
|
62
63
|
"boto3",
|
|
63
|
-
"
|
|
64
|
+
"earthkit-data[mars]>=0.9",
|
|
65
|
+
"earthkit-geo>=0.2",
|
|
64
66
|
"earthkit-meteo",
|
|
65
67
|
"ecmwflibs>=0.6.3",
|
|
66
68
|
"entrypoints",
|
|
@@ -68,8 +70,10 @@ optional-dependencies.all = [
|
|
|
68
70
|
"requests",
|
|
69
71
|
"s3fs",
|
|
70
72
|
]
|
|
73
|
+
|
|
71
74
|
optional-dependencies.create = [
|
|
72
|
-
"
|
|
75
|
+
"earthkit-data[mars]>=0.9",
|
|
76
|
+
"earthkit-geo>=0.2",
|
|
73
77
|
"earthkit-meteo",
|
|
74
78
|
"ecmwflibs>=0.6.3",
|
|
75
79
|
"entrypoints",
|
|
@@ -78,7 +82,8 @@ optional-dependencies.create = [
|
|
|
78
82
|
|
|
79
83
|
optional-dependencies.dev = [
|
|
80
84
|
"boto3",
|
|
81
|
-
"
|
|
85
|
+
"earthkit-data[mars]>=0.9",
|
|
86
|
+
"earthkit-geo>=0.2",
|
|
82
87
|
"earthkit-meteo",
|
|
83
88
|
"ecmwflibs>=0.6.3",
|
|
84
89
|
"entrypoints",
|
|
@@ -89,16 +94,16 @@ optional-dependencies.dev = [
|
|
|
89
94
|
"requests",
|
|
90
95
|
"s3fs",
|
|
91
96
|
"sphinx",
|
|
92
|
-
"sphinx-argparse",
|
|
93
97
|
"sphinx-rtd-theme",
|
|
94
98
|
]
|
|
99
|
+
|
|
95
100
|
optional-dependencies.docs = [
|
|
96
101
|
"nbsphinx",
|
|
97
102
|
"pandoc",
|
|
98
103
|
"sphinx",
|
|
99
|
-
"sphinx-argparse",
|
|
100
104
|
"sphinx-rtd-theme",
|
|
101
105
|
]
|
|
106
|
+
|
|
102
107
|
optional-dependencies.remote = [
|
|
103
108
|
"boto3",
|
|
104
109
|
"requests",
|
|
@@ -110,8 +115,9 @@ optional-dependencies.tests = [
|
|
|
110
115
|
urls.Documentation = "https://anemoi-datasets.readthedocs.io/"
|
|
111
116
|
urls.Homepage = "https://github.com/ecmwf/anemoi-datasets/"
|
|
112
117
|
urls.Issues = "https://github.com/ecmwf/anemoi-datasets/issues"
|
|
113
|
-
# Changelog = "https://github.com/ecmwf/anemoi-datasets/CHANGELOG.md"
|
|
114
118
|
urls.Repository = "https://github.com/ecmwf/anemoi-datasets/"
|
|
119
|
+
# Changelog = "https://github.com/ecmwf/anemoi-datasets/CHANGELOG.md"
|
|
120
|
+
|
|
115
121
|
scripts.anemoi-datasets = "anemoi.datasets.__main__:main"
|
|
116
122
|
|
|
117
123
|
[tool.setuptools.package-data]
|
|
@@ -382,7 +382,7 @@ class NoVersion(Version):
|
|
|
382
382
|
@property
|
|
383
383
|
def last_date(self):
|
|
384
384
|
monthly = find(self.metadata, "monthly")
|
|
385
|
-
time = max([int(t) for t in find(self.metadata["
|
|
385
|
+
time = max([int(t) for t in find(self.metadata["earthkit-data"], "time")])
|
|
386
386
|
assert isinstance(time, int), (time, type(time))
|
|
387
387
|
if time > 100:
|
|
388
388
|
time = time // 100
|
|
@@ -390,7 +390,7 @@ class NoVersion(Version):
|
|
|
390
390
|
|
|
391
391
|
@property
|
|
392
392
|
def frequency(self):
|
|
393
|
-
time = find(self.metadata["
|
|
393
|
+
time = find(self.metadata["earthkit-data"], "time")
|
|
394
394
|
return 24 // len(time)
|
|
395
395
|
|
|
396
396
|
@property
|
|
@@ -444,9 +444,9 @@ class Version0_4(Version):
|
|
|
444
444
|
z = self.zarr
|
|
445
445
|
|
|
446
446
|
# for backward compatibility
|
|
447
|
-
if "
|
|
448
|
-
|
|
449
|
-
print(f"
|
|
447
|
+
if "earthkit-data" in z.attrs:
|
|
448
|
+
ekd_version = z.attrs["earthkit-data"].get("versions", {}).get("earthkit-data", "unkwown")
|
|
449
|
+
print(f"earthkit-data version used to create this zarr: {ekd_version}. Not supported.")
|
|
450
450
|
return
|
|
451
451
|
|
|
452
452
|
version = z.attrs.get("version")
|
|
@@ -455,7 +455,7 @@ class Version0_4(Version):
|
|
|
455
455
|
print(" Cannot find metadata information about versions.")
|
|
456
456
|
else:
|
|
457
457
|
print(f"Zarr format (version {version})", end="")
|
|
458
|
-
print(f" created by
|
|
458
|
+
print(f" created by earthkit-data={versions.pop('earthkit-data')}", end="")
|
|
459
459
|
timestamp = z.attrs.get("creation_timestamp")
|
|
460
460
|
timestamp = datetime.datetime.fromisoformat(timestamp)
|
|
461
461
|
print(f" on {timestamp}", end="")
|
|
@@ -3,7 +3,7 @@ import os
|
|
|
3
3
|
import sys
|
|
4
4
|
from collections import defaultdict
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import earthkit.data as ekd
|
|
7
7
|
import tqdm
|
|
8
8
|
import yaml
|
|
9
9
|
|
|
@@ -50,9 +50,9 @@ class Scan(Command):
|
|
|
50
50
|
for path in tqdm.tqdm(paths, leave=False):
|
|
51
51
|
if not match(path):
|
|
52
52
|
continue
|
|
53
|
-
for field in tqdm.tqdm(
|
|
54
|
-
dates.add(field.
|
|
55
|
-
mars = field.
|
|
53
|
+
for field in tqdm.tqdm(ekd.from_source("file", path), leave=False):
|
|
54
|
+
dates.add(field.datetime()["valid_time"])
|
|
55
|
+
mars = field.metadata(namespace="mars")
|
|
56
56
|
keys = tuple(mars.get(k) for k in KEYS)
|
|
57
57
|
gribs[keys].add(path)
|
|
58
58
|
for k, v in mars.items():
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
import logging
|
|
11
11
|
|
|
12
12
|
import numpy as np
|
|
13
|
-
from
|
|
14
|
-
from
|
|
13
|
+
from earthkit.data.core.temporary import temp_file
|
|
14
|
+
from earthkit.data.readers.grib.output import new_grib_output
|
|
15
15
|
|
|
16
|
-
from anemoi.datasets.create.functions import
|
|
16
|
+
from anemoi.datasets.create.functions import assert_is_fieldlist
|
|
17
17
|
|
|
18
18
|
LOG = logging.getLogger(__name__)
|
|
19
19
|
|
|
@@ -96,7 +96,7 @@ def recentre(
|
|
|
96
96
|
|
|
97
97
|
for i, centre_field in enumerate(centre):
|
|
98
98
|
param = centre_field.metadata("param")
|
|
99
|
-
centre_field_as_mars = centre_field.
|
|
99
|
+
centre_field_as_mars = centre_field.metadata(namespace="mars")
|
|
100
100
|
|
|
101
101
|
# load the centre field
|
|
102
102
|
centre_np = centre_field.to_numpy()
|
|
@@ -106,8 +106,13 @@ def recentre(
|
|
|
106
106
|
|
|
107
107
|
for j in range(n_numbers):
|
|
108
108
|
ensemble_field = members[i * n_numbers + j]
|
|
109
|
-
ensemble_field_as_mars = ensemble_field.
|
|
110
|
-
check_compatible(
|
|
109
|
+
ensemble_field_as_mars = ensemble_field.metadata(namespace="mars")
|
|
110
|
+
check_compatible(
|
|
111
|
+
centre_field,
|
|
112
|
+
ensemble_field,
|
|
113
|
+
centre_field_as_mars,
|
|
114
|
+
ensemble_field_as_mars,
|
|
115
|
+
)
|
|
111
116
|
members_np[j] = ensemble_field.to_numpy()
|
|
112
117
|
|
|
113
118
|
ensemble_field_as_mars = tuple(sorted(ensemble_field_as_mars.items()))
|
|
@@ -149,10 +154,10 @@ def recentre(
|
|
|
149
154
|
if output is not None:
|
|
150
155
|
return path
|
|
151
156
|
|
|
152
|
-
from
|
|
157
|
+
from earthkit.data import from_source
|
|
153
158
|
|
|
154
|
-
ds =
|
|
155
|
-
|
|
159
|
+
ds = from_source("file", path)
|
|
160
|
+
assert_is_fieldlist(ds)
|
|
156
161
|
# save a reference to the tmp file so it is deleted
|
|
157
162
|
# only when the dataset is not used anymore
|
|
158
163
|
ds._tmp = tmp
|
{anemoi_datasets-0.3.10 → anemoi_datasets-0.4.0}/src/anemoi/datasets/create/functions/__init__.py
RENAMED
|
@@ -13,10 +13,10 @@ import importlib
|
|
|
13
13
|
import entrypoints
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
def
|
|
17
|
-
from
|
|
16
|
+
def assert_is_fieldlist(obj):
|
|
17
|
+
from earthkit.data.indexing.fieldlist import FieldList
|
|
18
18
|
|
|
19
|
-
assert isinstance(obj,
|
|
19
|
+
assert isinstance(obj, FieldList), type(obj)
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
def import_function(name, kind):
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
# nor does it submit to any jurisdiction.
|
|
8
8
|
#
|
|
9
9
|
|
|
10
|
-
import
|
|
10
|
+
import earthkit.data as ekd
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
def execute(context, input, **kwargs):
|
|
14
|
-
#
|
|
15
|
-
# So we can reference an earlier step in a function like '
|
|
16
|
-
return
|
|
14
|
+
# Useful to create a pipeline that returns an empty result
|
|
15
|
+
# So we can reference an earlier step in a function like 'constants'
|
|
16
|
+
return ekd.from_source("empty")
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
import re
|
|
11
11
|
|
|
12
|
-
from
|
|
12
|
+
from earthkit.data.indexing.fieldlist import FieldArray
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class RenamedFieldMapping:
|
|
@@ -26,8 +26,8 @@ class RenamedFieldMapping:
|
|
|
26
26
|
self.what = what
|
|
27
27
|
self.renaming = renaming
|
|
28
28
|
|
|
29
|
-
def metadata(self, key):
|
|
30
|
-
value = self.field.metadata(key)
|
|
29
|
+
def metadata(self, key, **kwargs):
|
|
30
|
+
value = self.field.metadata(key, **kwargs)
|
|
31
31
|
if key == self.what:
|
|
32
32
|
return self.renaming.get(value, value)
|
|
33
33
|
return value
|
|
@@ -48,10 +48,10 @@ class RenamedFieldFormat:
|
|
|
48
48
|
self.format = format
|
|
49
49
|
self.bits = re.findall(r"{(\w+)}", format)
|
|
50
50
|
|
|
51
|
-
def metadata(self, key):
|
|
52
|
-
value = self.field.metadata(key)
|
|
51
|
+
def metadata(self, key, **kwargs):
|
|
52
|
+
value = self.field.metadata(key, **kwargs)
|
|
53
53
|
if "{" + key + "}" in self.format:
|
|
54
|
-
bits = {b: self.field.metadata(b) for b in self.bits}
|
|
54
|
+
bits = {b: self.field.metadata(b, **kwargs) for b in self.bits}
|
|
55
55
|
return self.format.format(**bits)
|
|
56
56
|
return value
|
|
57
57
|
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# (C) Copyright 2024 ECMWF.
|
|
2
|
+
#
|
|
3
|
+
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
|
+
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
|
+
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
|
+
# nor does it submit to any jurisdiction.
|
|
8
|
+
#
|
|
9
|
+
|
|
10
|
+
from collections import defaultdict
|
|
11
|
+
|
|
12
|
+
from earthkit.data.indexing.fieldlist import FieldArray
|
|
13
|
+
from earthkit.geo.rotate import rotate_vector
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class NewDataField:
|
|
17
|
+
def __init__(self, field, data):
|
|
18
|
+
self.field = field
|
|
19
|
+
self.data = data
|
|
20
|
+
|
|
21
|
+
def to_numpy(self, *args, **kwargs):
|
|
22
|
+
return self.data
|
|
23
|
+
|
|
24
|
+
def __getattr__(self, name):
|
|
25
|
+
return getattr(self.field, name)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def execute(
|
|
29
|
+
context,
|
|
30
|
+
input,
|
|
31
|
+
x_wind,
|
|
32
|
+
y_wind,
|
|
33
|
+
source_projection=None,
|
|
34
|
+
target_projection="+proj=longlat",
|
|
35
|
+
):
|
|
36
|
+
from pyproj import CRS
|
|
37
|
+
|
|
38
|
+
result = FieldArray()
|
|
39
|
+
|
|
40
|
+
wind_params = (x_wind, y_wind)
|
|
41
|
+
wind_pairs = defaultdict(dict)
|
|
42
|
+
|
|
43
|
+
for f in input:
|
|
44
|
+
key = f.metadata(namespace="mars")
|
|
45
|
+
param = key.pop("param")
|
|
46
|
+
|
|
47
|
+
if param not in wind_params:
|
|
48
|
+
result.append(f)
|
|
49
|
+
continue
|
|
50
|
+
|
|
51
|
+
key = tuple(key.items())
|
|
52
|
+
|
|
53
|
+
if param in wind_pairs[key]:
|
|
54
|
+
raise ValueError(f"Duplicate wind component {param} for {key}")
|
|
55
|
+
|
|
56
|
+
wind_pairs[key][param] = f
|
|
57
|
+
|
|
58
|
+
for _, pairs in wind_pairs.items():
|
|
59
|
+
if len(pairs) != 2:
|
|
60
|
+
raise ValueError("Missing wind component")
|
|
61
|
+
|
|
62
|
+
x = pairs[x_wind]
|
|
63
|
+
y = pairs[y_wind]
|
|
64
|
+
|
|
65
|
+
assert x.grid_mapping == y.grid_mapping
|
|
66
|
+
|
|
67
|
+
lats, lons = x.grid_points()
|
|
68
|
+
x_new, y_new = rotate_vector(
|
|
69
|
+
lats,
|
|
70
|
+
lons,
|
|
71
|
+
x.to_numpy(flatten=True),
|
|
72
|
+
y.to_numpy(flatten=True),
|
|
73
|
+
(source_projection if source_projection is not None else CRS.from_cf(x.grid_mapping)),
|
|
74
|
+
target_projection,
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
result.append(NewDataField(x, x_new))
|
|
78
|
+
result.append(NewDataField(y, y_new))
|
|
79
|
+
|
|
80
|
+
return result
|
|
@@ -9,60 +9,9 @@
|
|
|
9
9
|
|
|
10
10
|
from collections import defaultdict
|
|
11
11
|
|
|
12
|
-
import numpy as np
|
|
13
|
-
from
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
def normalise(x):
|
|
17
|
-
return max(min(x, 1.0), -1.0)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def normalise_longitude(lon, minimum):
|
|
21
|
-
while lon < minimum:
|
|
22
|
-
lon += 360
|
|
23
|
-
|
|
24
|
-
while lon >= minimum + 360:
|
|
25
|
-
lon -= 360
|
|
26
|
-
|
|
27
|
-
return lon
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def rotate_winds(
|
|
31
|
-
lats,
|
|
32
|
-
lons,
|
|
33
|
-
raw_lats,
|
|
34
|
-
raw_lons,
|
|
35
|
-
x_wind,
|
|
36
|
-
y_wind,
|
|
37
|
-
south_pole_latitude,
|
|
38
|
-
south_pole_longitude,
|
|
39
|
-
south_pole_rotation_angle=0,
|
|
40
|
-
):
|
|
41
|
-
# Code from MIR
|
|
42
|
-
assert south_pole_rotation_angle == 0
|
|
43
|
-
C = np.deg2rad(90 - south_pole_latitude)
|
|
44
|
-
cos_C = np.cos(C)
|
|
45
|
-
sin_C = np.sin(C)
|
|
46
|
-
|
|
47
|
-
new_x = np.zeros_like(x_wind)
|
|
48
|
-
new_y = np.zeros_like(y_wind)
|
|
49
|
-
|
|
50
|
-
for i, (vx, vy, lat, lon, raw_lat, raw_lon) in enumerate(zip(x_wind, y_wind, lats, lons, raw_lats, raw_lons)):
|
|
51
|
-
lonRotated = south_pole_longitude - lon
|
|
52
|
-
lon_rotated = normalise_longitude(lonRotated, -180)
|
|
53
|
-
lon_unrotated = raw_lon
|
|
54
|
-
|
|
55
|
-
a = np.deg2rad(lon_rotated)
|
|
56
|
-
b = np.deg2rad(lon_unrotated)
|
|
57
|
-
q = 1 if (sin_C * lon_rotated < 0.0) else -1.0 # correct quadrant
|
|
58
|
-
|
|
59
|
-
cos_c = normalise(np.cos(a) * np.cos(b) + np.sin(a) * np.sin(b) * cos_C)
|
|
60
|
-
sin_c = q * np.sqrt(1.0 - cos_c * cos_c)
|
|
61
|
-
|
|
62
|
-
new_x[i] = cos_c * vx + sin_c * vy
|
|
63
|
-
new_y[i] = -sin_c * vx + cos_c * vy
|
|
64
|
-
|
|
65
|
-
return new_x, new_y
|
|
12
|
+
# import numpy as np
|
|
13
|
+
from earthkit.data.indexing.fieldlist import FieldArray
|
|
14
|
+
from earthkit.geo.rotate import unrotate_vector
|
|
66
15
|
|
|
67
16
|
|
|
68
17
|
class NewDataField:
|
|
@@ -85,7 +34,7 @@ def execute(context, input, u, v):
|
|
|
85
34
|
wind_pairs = defaultdict(dict)
|
|
86
35
|
|
|
87
36
|
for f in input:
|
|
88
|
-
key = f.
|
|
37
|
+
key = f.metadata(namespace="mars")
|
|
89
38
|
param = key.pop("param")
|
|
90
39
|
|
|
91
40
|
if param not in wind_params:
|
|
@@ -107,18 +56,19 @@ def execute(context, input, u, v):
|
|
|
107
56
|
y = pairs[v]
|
|
108
57
|
|
|
109
58
|
lats, lons = x.grid_points()
|
|
110
|
-
raw_lats, raw_longs = x.
|
|
59
|
+
raw_lats, raw_longs = x.grid_points_unrotated()
|
|
111
60
|
|
|
112
61
|
assert x.rotation == y.rotation
|
|
113
62
|
|
|
114
|
-
u_new, v_new =
|
|
63
|
+
u_new, v_new = unrotate_vector(
|
|
115
64
|
lats,
|
|
116
65
|
lons,
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
x.
|
|
120
|
-
|
|
121
|
-
|
|
66
|
+
x.to_numpy(flatten=True),
|
|
67
|
+
y.to_numpy(flatten=True),
|
|
68
|
+
*x.rotation[:2],
|
|
69
|
+
south_pole_rotation_angle=x.rotation[2],
|
|
70
|
+
lat_unrotated=raw_lats,
|
|
71
|
+
lon_unrotated=raw_longs,
|
|
122
72
|
)
|
|
123
73
|
|
|
124
74
|
result.append(NewDataField(x, u_new))
|
|
@@ -128,9 +78,9 @@ def execute(context, input, u, v):
|
|
|
128
78
|
|
|
129
79
|
|
|
130
80
|
if __name__ == "__main__":
|
|
131
|
-
from
|
|
81
|
+
from earthkit.data import from_source
|
|
132
82
|
|
|
133
|
-
source =
|
|
83
|
+
source = from_source(
|
|
134
84
|
"mars",
|
|
135
85
|
date=-1,
|
|
136
86
|
param="10u/10v",
|
|
@@ -11,11 +11,11 @@ import logging
|
|
|
11
11
|
import warnings
|
|
12
12
|
from copy import deepcopy
|
|
13
13
|
|
|
14
|
-
import
|
|
14
|
+
import earthkit.data as ekd
|
|
15
15
|
import numpy as np
|
|
16
|
-
from
|
|
17
|
-
from
|
|
18
|
-
from
|
|
16
|
+
from earthkit.data.core.temporary import temp_file
|
|
17
|
+
from earthkit.data.readers.grib.output import new_grib_output
|
|
18
|
+
from earthkit.data.utils.availability import Availability
|
|
19
19
|
|
|
20
20
|
from anemoi.datasets.create.utils import to_datetime_list
|
|
21
21
|
|
|
@@ -26,7 +26,7 @@ LOG = logging.getLogger(__name__)
|
|
|
26
26
|
|
|
27
27
|
def member(field):
|
|
28
28
|
# Bug in eccodes has number=0 randomly
|
|
29
|
-
number = field.metadata("number")
|
|
29
|
+
number = field.metadata("number", default=0)
|
|
30
30
|
if number is None:
|
|
31
31
|
number = 0
|
|
32
32
|
return number
|
|
@@ -54,16 +54,25 @@ class Accumulation:
|
|
|
54
54
|
|
|
55
55
|
def check(self, field):
|
|
56
56
|
if self._check is None:
|
|
57
|
-
self._check = field.
|
|
57
|
+
self._check = field.metadata(namespace="mars")
|
|
58
58
|
|
|
59
|
-
assert self.param == field.metadata("param"), (
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
assert self.param == field.metadata("param"), (
|
|
60
|
+
self.param,
|
|
61
|
+
field.metadata("param"),
|
|
62
|
+
)
|
|
63
|
+
assert self.date == field.metadata("date"), (
|
|
64
|
+
self.date,
|
|
65
|
+
field.metadata("date"),
|
|
66
|
+
)
|
|
67
|
+
assert self.time == field.metadata("time"), (
|
|
68
|
+
self.time,
|
|
69
|
+
field.metadata("time"),
|
|
70
|
+
)
|
|
62
71
|
assert self.number == member(field), (self.number, member(field))
|
|
63
72
|
|
|
64
73
|
return
|
|
65
74
|
|
|
66
|
-
mars = field.
|
|
75
|
+
mars = field.metadata(namespace="mars")
|
|
67
76
|
keys1 = sorted(self._check.keys())
|
|
68
77
|
keys2 = sorted(mars.keys())
|
|
69
78
|
|
|
@@ -196,7 +205,11 @@ class AccumulationFromLastStep(Accumulation):
|
|
|
196
205
|
|
|
197
206
|
def compute(self, values, startStep, endStep):
|
|
198
207
|
|
|
199
|
-
assert endStep - startStep == self.frequency, (
|
|
208
|
+
assert endStep - startStep == self.frequency, (
|
|
209
|
+
startStep,
|
|
210
|
+
endStep,
|
|
211
|
+
self.frequency,
|
|
212
|
+
)
|
|
200
213
|
|
|
201
214
|
if self.startStep is None:
|
|
202
215
|
self.startStep = startStep
|
|
@@ -307,14 +320,13 @@ def compute_accumulations(
|
|
|
307
320
|
)
|
|
308
321
|
|
|
309
322
|
compressed = Availability(requests)
|
|
310
|
-
ds =
|
|
323
|
+
ds = ekd.from_source("empty")
|
|
311
324
|
for r in compressed.iterate():
|
|
312
325
|
request.update(r)
|
|
313
326
|
if context.use_grib_paramid and "param" in request:
|
|
314
327
|
request = use_grib_paramid(request)
|
|
315
328
|
print("🌧️", request)
|
|
316
|
-
|
|
317
|
-
ds = ds + cml.load_source("mars", **request)
|
|
329
|
+
ds = ds + ekd.from_source("mars", **request)
|
|
318
330
|
|
|
319
331
|
accumulations = {}
|
|
320
332
|
for a in [AccumulationClass(out, frequency=frequency, **r) for r in requests]:
|
|
@@ -341,7 +353,7 @@ def compute_accumulations(
|
|
|
341
353
|
|
|
342
354
|
out.close()
|
|
343
355
|
|
|
344
|
-
ds =
|
|
356
|
+
ds = ekd.from_source("file", path)
|
|
345
357
|
|
|
346
358
|
assert len(ds) / len(param) / len(number) == len(dates), (
|
|
347
359
|
len(ds),
|