I am trying to figure out if there is a way to have xr.interpolate_na perform 2d interpolation since I have CAM data on a lat/lon grid. It looks like I have to specify for it to interpolate the nans in either the lat or lon dimension (so 1d interpolation)...(and it seems like it would be location-dependent whether lat or lon was more appropriate...so I'd rather do 2d interpolation)
Based on my limited knowledge, you may have more numerical functions at your disposal if you convert the data from xr to numpy. Then check out what numpy has to offer, or other libraries built on top of numpy.
Scipy can partial do 2d interpolate, but the edge may still be NAN. https://stackoverflow.com/questions/37662180/interpolate-missing-values-2d-python
ok, thanks. I don't want the edges to be nan, but I'll take a look ...
Last updated: May 16 2025 at 17:14 UTC