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

Create Regridder object from existing ESMF weights file #202

Open
dcherian opened this issue Nov 14, 2022 · 2 comments
Open

Create Regridder object from existing ESMF weights file #202

dcherian opened this issue Nov 14, 2022 · 2 comments

Comments

@dcherian
Copy link
Contributor

This is a common request (example) because at many modelling centers, a remapping files is generated once and stored in a common location and used by other tools (e.g. NCL).

So my question: Is it possible to create a Regridder object from an existing ESMF weights file. This would generalize this bit of code: https://xesmf.readthedocs.io/en/latest/notebooks/Backend.html#Apply-weights-using-Scipy-backend

@raphaeldussin
Copy link
Contributor

@dcherian yes! use reuse_weights=True and filename=wgts.nc or weights=, as arguments to the regridder.
you still need to pass the source and target grid but you could just make them empty arrays of the right dimensions.

@dcherian
Copy link
Contributor Author

dcherian commented Dec 9, 2022

I tried this today and it's a bit clunky: NCAR/esds#217

I think we could improve it a bit with a Regridder.from_weights_file classmethod

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

No branches or pull requests

2 participants