the normalised lowest/highest longitude is within one buffer distance of the 180 degree meridian,
the longitudes cover the 360 degree longitude range without a gap (lon_diff_max) of more than 2 degrees,
but with a gap greater than double the buffer
In this case the longitudes either side of 180 degrees are taken as the min and max, the buffer applied, and you get a range like the (179.91, 540.09) above.
We can fix this by updating the value of lon_diff_max when we decide that we will split across the antimeridian rather than at the location of the largest gap in the longitude data (line 200).
The
climada.util.coordinates.lon_bounds
method returns a normalised range for the provided longitudes.I've run into an edge case where the returned range is > 360 degrees:
returns
(179.91, 540.09)
I happens only when
lon_diff_max
) of more than 2 degrees,In this case the longitudes either side of 180 degrees are taken as the min and max, the buffer applied, and you get a range like the
(179.91, 540.09)
above.We can fix this by updating the value of
lon_diff_max
when we decide that we will split across the antimeridian rather than at the location of the largest gap in the longitude data (line 200).I'll submit a pull request for it later today.