Open dcherian opened 1 year ago
@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.
I tried this today and it's a bit clunky: https://github.com/NCAR/esds/pull/217
I think we could improve it a bit with a Regridder.from_weights_file
classmethod
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