MCPcopy Create free account
hub / github.com/NCAR/wrf-python / cartopy_xlim

Method cartopy_xlim

src/wrf/projection.py:314–337  ·  view source on GitHub ↗

Return the x extents in projected coordinates for cartopy. Returns: :obj:`list`: A pair of [xmin, xmax]. See Also: :mod:`cartopy`, :mod:`matplotlib`

(self, geobounds)

Source from the content-addressed store, hash-verified

312 nadgrids="@null"))
313
314 def cartopy_xlim(self, geobounds):
315 """Return the x extents in projected coordinates for cartopy.
316
317 Returns:
318
319 :obj:`list`: A pair of [xmin, xmax].
320
321 See Also:
322
323 :mod:`cartopy`, :mod:`matplotlib`
324
325 """
326 try:
327 _ = len(geobounds)
328 except TypeError:
329 x_extents = self._cart_extents(geobounds)[0]
330 else:
331 extents = self._cart_extents(geobounds)
332 x_extents = np.empty(extents.shape, np.object)
333
334 for idxs, extent in np.ndenumerate(extents):
335 x_extents[idxs] = extent[0]
336
337 return x_extents
338
339 def cartopy_ylim(self, geobounds):
340 """Return the y extents in projected coordinates for cartopy.

Callers 2

make_testFunction · 0.80
cartopy_xlimFunction · 0.80

Calls 1

_cart_extentsMethod · 0.95

Tested by 1

make_testFunction · 0.64