Skip to content

Commit 4cd0813

Browse files
authored
Merge pull request NCAR#175 from NCAR/main
Main
2 parents 839e2ff + 74dcbb2 commit 4cd0813

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/wrf/projection.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from Ngl import Resources
1919

2020

21+
2122
if cartopy_enabled():
2223
class MercatorWithLatTS(crs.Mercator):
2324
"""A :class:`cartopy.crs.Mercator` subclass that adds support for
@@ -60,6 +61,10 @@ def __init__(self, central_longitude=0.0,
6061
("units", "m")]
6162
super(crs.Mercator, self).__init__(proj4_params, globe=globe)
6263

64+
# Need to have x/y limits defined for the initial hash which
65+
# gets used within transform_points for caching
66+
self._x_limits = self._y_limits = None
67+
6368
# Calculate limits.
6469
limits = self.transform_points(
6570
crs.Geodetic(),
@@ -80,7 +85,8 @@ def __init__(self, central_longitude=0.0,
8085
self._x_limits = tuple(xlimits)
8186
self._y_limits = tuple(limits[..., 1])
8287

83-
self._threshold = np.diff(self.x_limits)[0] / 720
88+
self._threshold = min(np.diff(self.x_limits)[0] / 720,
89+
np.diff(self.y_limits)[0] / 360)
8490

8591

8692
def _ismissing(val, islat=True):

0 commit comments

Comments
 (0)