-
Notifications
You must be signed in to change notification settings - Fork 149
Closed
Description
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:
lon_bounds(np.concatenate([[-179.99], np.arange(-179.7, 179.9, 0.2), [179.99]]), buffer = 0.1)
returns (179.91, 540.09)
I happens only when
- there is a non-zero buffer,
- 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).
I'll submit a pull request for it later today.
Metadata
Metadata
Assignees
Labels
No labels