From 1bddbe1540b183e108d272f65a1c9526879cac5a Mon Sep 17 00:00:00 2001 From: Callum Rollo Date: Tue, 8 Oct 2024 13:36:31 +0200 Subject: [PATCH] nanmean --- gridded_plots.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gridded_plots.py b/gridded_plots.py index 705ba18..aa9b631 100644 --- a/gridded_plots.py +++ b/gridded_plots.py @@ -334,8 +334,8 @@ def make_map(nc, filename): dataset = xr.open_dataset(nc) lats = dataset.latitude.values lons = dataset.longitude.values - coord = cartopy.crs.AzimuthalEquidistant(central_longitude=np.mean(lons), - central_latitude=np.mean(lats)) + coord = cartopy.crs.AzimuthalEquidistant(central_longitude=np.nanmean(lons), + central_latitude=np.nanmean(lats)) pc = cartopy.crs.PlateCarree() fig = plt.figure(figsize=(12, 6)) ax = fig.add_subplot(111, projection=coord)