From 0a6a5b858e299b9a2ef9135a29fabc54fe0defc9 Mon Sep 17 00:00:00 2001 From: MartinMohrmann Date: Thu, 11 Apr 2024 14:35:31 +0200 Subject: [PATCH] avoid extrapolation artefacts --- glidertools/mapping.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/glidertools/mapping.py b/glidertools/mapping.py index 7485787..888a167 100644 --- a/glidertools/mapping.py +++ b/glidertools/mapping.py @@ -974,7 +974,9 @@ def grid_data( gridded = gridded.reindex(labels.astype(float)) if interp_lim > 0: - gridded = gridded.interpolate(limit=interp_lim).bfill(limit=interp_lim) + gridded = gridded.interpolate(limit=interp_lim, limit_area="inside").bfill( + limit=interp_lim + ) if not return_xarray: return gridded