-
Notifications
You must be signed in to change notification settings - Fork 17
feat: add support for masks in regrid filter
#108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…orm into feat/testing-filters
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…orm into feat/testing-filters
for more information, see https://pre-commit.ci
…orm into feat/testing-filters
for more information, see https://pre-commit.ci
…ld.NewLatLonField
…ed in favour of this file's functions.
|
in
|
|
Loading a grid with def test_regrid_ekd(test_source):
era5 = test_source("anemoi-transform/filters/regrid/2t-ea.grib")
> regrid = filter_registry.create("regrid", in_grid="N320", out_grid=[0.25, 0.25])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.venv/lib/python3.12/site-packages/anemoi/utils/registry.py:334: in create
return factory(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
src/anemoi/transform/filters/regrid.py:122: in __init__
self.interpolator = make_interpolator(
src/anemoi/transform/filters/regrid.py:448: in make_interpolator
return globals()[interpolator](**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/anemoi/transform/filters/regrid.py:164: in __init__
self.out_griddata = as_griddata(out_grid)
^^^^^^^^^^^^^^^^^^^^^
src/anemoi/transform/filters/regrid.py:84: in as_griddata
return lookup(grid)
^^^^^^^^^^^^
src/anemoi/transform/grids/named.py:114: in lookup
npz = np.load(BytesIO(data))
^^^^^^^^^^^^^^^^^^^^^^
ValueError: This file contains pickled (object) dataThe problem is that the response = requests.get(url)
data = response.content
npz = np.load(BytesIO(data))However, downloading manually the file and saving to Does anyone know how to fix this issue ? |
|
I have finished reviewing all your comments, and I would like to request some help to finish closing this PR. |
Description
Create a mask with
anemoi-transform \ make-regrid-file global-on-lam-mask \ --global-grid era5.grib \ --lam-grid carra.grib \ --output era-over-carra-mask.npzThen use it in a dataset recipe
What problem does this change solve?
This is a feature that was requested to extract the grid points of. global grid (e.g. ERA5 on N320) over the area covered by a LAM (e.g the CARRA domain)
What issue or task does this change relate to?
Additional notes
As a contributor to the Anemoi framework, please ensure that your changes include unit tests, updates to any affected dependencies and documentation, and have been tested in a parallel setting (i.e., with multiple GPUs). As a reviewer, you are also responsible for verifying these aspects and requesting changes if they are not adequately addressed. For guidelines about those please refer to https://anemoi.readthedocs.io/en/latest/
📚 Documentation preview 📚: https://anemoi-transform--108.org.readthedocs.build/en/108/