Skip to content
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

Use remote matrices #3

Merged
merged 8 commits into from
Nov 29, 2023
Merged

Use remote matrices #3

merged 8 commits into from
Nov 29, 2023

Conversation

sandorkertesz
Copy link
Collaborator

@sandorkertesz sandorkertesz commented Oct 12, 2023

The pre-generated interpolation matrices and the index json file describing them are now hosted under: https://get.ecmwf.int/repository/earthkit/regrid/matrices including the following input and output grids:

gg_res = [1280, 1024, 640, 512, 400, 320, 256, 200, 160, 128, 96, 80, 64, 48, 32]
in_grids_O_gg = [2560] + gg_res # octahedral GG
in_grids_N_gg = gg_res  # reduced GG

# latlon
out_grids_ll = [0.1, 0.15, 0.2,  0.25, 0.3,0.4,  0.5, 0.6, 0.7, 0.75, 0.8, 0.9, 
      1, 1.2, 1.25, 1.4, 1.5, 1.6, 1.8, 2, 2.5, 5, 10,]

The git repo itself does not contain the json index file and any of the matrices. All of these are downloaded on demand and stored in a cache on disk. To implement this I took the caching code from earthkit-data. However, the settings code was not taken and the cache is simply controlled by a hard-coded settings dict.

For testing purposes it is possible to use an index json file and matrices stored at a user defined path. This can be initiated by using the earthkit.regrid.db._use_local_index context manager. The tests in tests/test_local.py are using this technique to work with the index+matrix data stored in tests/data/local.

I added proper checks for the input and output gridspecs, e.g. sub-areas are now recognised and rejected. I had to reuse some gridspec code from the earthkit-data/feature/gridspec branch to implement this.

A notebook example is available at: https://earthkit-regrid.readthedocs.io/en/feature-remote-matrices/examples/interpolation.html

TODO

  • gridspecs format/contents have to be finalised (affects earthkit-data and the new grid library too)

@sandorkertesz sandorkertesz linked an issue Oct 12, 2023 that may be closed by this pull request
@sandorkertesz
Copy link
Collaborator Author

TODO:

  • add version number to matrix files

@sandorkertesz sandorkertesz marked this pull request as ready for review November 29, 2023 14:27
@sandorkertesz sandorkertesz changed the title WIP: use remote matrices Use remote matrices Nov 29, 2023
@sandorkertesz sandorkertesz merged commit 09e713b into develop Nov 29, 2023
8 checks passed
@sandorkertesz sandorkertesz deleted the feature/remote-matrices branch November 29, 2023 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use remote interpolation matrices
1 participant