From d4598d9e11b85130340390e96d3811f32860815b Mon Sep 17 00:00:00 2001 From: Valeriu Predoi Date: Wed, 30 Sep 2020 12:58:47 +0100 Subject: [PATCH 1/3] temporary fix to an issue with cube intersection when cube has bounds --- esmvalcore/preprocessor/_area.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/esmvalcore/preprocessor/_area.py b/esmvalcore/preprocessor/_area.py index e8ee06b8c3..077367fbb9 100644 --- a/esmvalcore/preprocessor/_area.py +++ b/esmvalcore/preprocessor/_area.py @@ -61,7 +61,11 @@ def extract_region(cube, start_longitude, end_longitude, start_latitude, latitude=(start_latitude, end_latitude), ignore_bounds=True, ) + # delete bounds: kluge for issue 799 + # TODO remove the bounds handling after iris fix + region_subset.coord("longitude").bounds = None region_subset = region_subset.intersection(longitude=(0., 360.)) + region_subset.coord("longitude").guess_bounds() return region_subset # Irregular grids lats = cube.coord('latitude').points From a6e282b07e486b419c9459ccb8deaff941e4cfcf Mon Sep 17 00:00:00 2001 From: Valeriu Predoi Date: Wed, 30 Sep 2020 13:42:24 +0100 Subject: [PATCH 2/3] that'll break Codacy but better to have the full link cheers Co-authored-by: Peter Kalverla --- esmvalcore/preprocessor/_area.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esmvalcore/preprocessor/_area.py b/esmvalcore/preprocessor/_area.py index 077367fbb9..5965567f5b 100644 --- a/esmvalcore/preprocessor/_area.py +++ b/esmvalcore/preprocessor/_area.py @@ -61,7 +61,7 @@ def extract_region(cube, start_longitude, end_longitude, start_latitude, latitude=(start_latitude, end_latitude), ignore_bounds=True, ) - # delete bounds: kluge for issue 799 + # delete bounds: kluge for https://github.com/ESMValGroup/ESMValCore/issues/799 # TODO remove the bounds handling after iris fix region_subset.coord("longitude").bounds = None region_subset = region_subset.intersection(longitude=(0., 360.)) From f64a2a1084dd510dab2ae93ed5f8f185a83dea46 Mon Sep 17 00:00:00 2001 From: Valeriu Predoi Date: Wed, 30 Sep 2020 13:57:00 +0100 Subject: [PATCH 3/3] chop line --- esmvalcore/preprocessor/_area.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esmvalcore/preprocessor/_area.py b/esmvalcore/preprocessor/_area.py index 5965567f5b..15f33ab1fc 100644 --- a/esmvalcore/preprocessor/_area.py +++ b/esmvalcore/preprocessor/_area.py @@ -61,7 +61,8 @@ def extract_region(cube, start_longitude, end_longitude, start_latitude, latitude=(start_latitude, end_latitude), ignore_bounds=True, ) - # delete bounds: kluge for https://github.com/ESMValGroup/ESMValCore/issues/799 + # delete bounds: kluge for + # issue here https://github.com/ESMValGroup/ESMValCore/issues/799 # TODO remove the bounds handling after iris fix region_subset.coord("longitude").bounds = None region_subset = region_subset.intersection(longitude=(0., 360.))