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

Function get_cartopy

src/wrf/util.py:3467–3532  ·  view source on GitHub ↗

Return a :class:`cartopy.crs.Projection` subclass for the map projection. Args: var (:class:`xarray.DataArray`, optional): A :class:`xarray.DataArray` variable that includes latitude,longitude coordinate information. If not used, then *wrfin* must be provide

(var=None, wrfin=None, varname=None, timeidx=0, method="cat",
                squeeze=True, cache=None)

Source from the content-addressed store, hash-verified

3465
3466
3467def get_cartopy(var=None, wrfin=None, varname=None, timeidx=0, method="cat",
3468 squeeze=True, cache=None):
3469 """Return a :class:`cartopy.crs.Projection` subclass for the
3470 map projection.
3471
3472 Args:
3473
3474 var (:class:`xarray.DataArray`, optional): A :class:`xarray.DataArray`
3475 variable that includes latitude,longitude coordinate information.
3476 If not used, then *wrfin* must be provided.
3477
3478 geobounds (:class:`wrf.GeoBounds`, optional): The geobounds to
3479 get the extents. If set to None and using the *var* parameter,
3480 the geobounds will be taken from the variable. If using a
3481 file, then the geobounds will be taken from the native grid.
3482
3483 wrfin (:class:`netCDF4.Dataset`, :class:`Nio.NioFile`, or an \
3484 iterable, optional): WRF-ARW NetCDF
3485 data as a :class:`netCDF4.Dataset`, :class:`Nio.NioFile`
3486 or an iterable sequence of the aforementioned types. If not used,
3487 then *var* must be provided.
3488
3489 varname (:obj:`str`, optional): If using *wrfin*, then this will be the
3490 variable name to use to determine the geobounds. The variable
3491 can be a coordinate variable, or a regular variable that contains
3492 coordinate attributes. If None,
3493 then the 'XLAT', 'XLAT_M', 'XLONG', 'XLONG_M' variables
3494 will be used.
3495
3496 timeidx (:obj:`int` or :data:`wrf.ALL_TIMES`, optional): The
3497 desired time index. This value can be a positive integer,
3498 negative integer, or
3499 :data:`wrf.ALL_TIMES` (an alias for None) to return
3500 all times in the file or sequence. Default is 0.
3501
3502 method (:obj:`str`, optional): The aggregation method to use for
3503 sequences. Must be either 'cat' or 'join'.
3504 'cat' combines the data along the Time dimension.
3505 'join' creates a new dimension for the file index.
3506 The default is 'cat'.
3507
3508 squeeze (:obj:`bool`, optional): Set to False to prevent dimensions
3509 with a size of 1 from being automatically removed from the shape
3510 of the output. Default is True.
3511
3512 cache (:obj:`dict`, optional): A dictionary of (varname, ndarray)
3513 that can be used to supply pre-extracted NetCDF variables to the
3514 computational routines. It is primarily used for internal
3515 purposes, but can also be used to improve performance by
3516 eliminating the need to repeatedly extract the same variables
3517 used in multiple diagnostics calculations, particularly when using
3518 large sequences of files.
3519 Default is None.
3520
3521 Returns:
3522
3523 :class:`cartopy.crs.Projection`: A Projection subclass for the
3524 map projection.

Callers 2

ctt_test.pyFile · 0.90
quiver_test.pyFile · 0.90

Calls 1

_get_proj_objFunction · 0.85

Tested by

no test coverage detected