From aa5184a7a4a660016e7c75cbda333a5e5d21e08d Mon Sep 17 00:00:00 2001 From: Daniel Palmer Date: Thu, 14 May 2026 11:46:53 +0100 Subject: [PATCH] Adjust target and plot lon to ensure in plot region --- profsea/slr_pkg/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/profsea/slr_pkg/__init__.py b/profsea/slr_pkg/__init__.py index 3d0ae21..cbc44f9 100644 --- a/profsea/slr_pkg/__init__.py +++ b/profsea/slr_pkg/__init__.py @@ -244,6 +244,16 @@ def plot_ij(cube, model, location, idx, lat, lon, save_map=True, rad=5): if targetlon > 180: targetlon -= 360 + # ensure between max and min lon + if plotlon > maxlon: + plotlon -= 360 + if plotlon < minlon: + plotlon += 360 + if targetlon > maxlon: + targetlon -= 360 + if targetlon < minlon: + targetlon += 360 + fig = plt.figure() ax = cubeplot.block(cube, land=False, region=region, cmin=-1, cmax=1, plotcbar=True, nlevels=25, cent_lon=targetlon,