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

Function get_basemap

src/wrf/util.py:3535–3611  ·  view source on GitHub ↗

Return a :class:`matplotlib.mpl_toolkits.basemap.Basemap` object 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 *wrf

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

Source from the content-addressed store, hash-verified

3533
3534
3535def get_basemap(var=None, wrfin=None, varname=None, timeidx=0, method="cat",
3536 squeeze=True, cache=None, **kwargs):
3537 """Return a :class:`matplotlib.mpl_toolkits.basemap.Basemap` object
3538 for the map projection.
3539
3540 Args:
3541
3542 var (:class:`xarray.DataArray`, optional): A :class:`xarray.DataArray`
3543 variable that includes latitude,longitude coordinate information.
3544 If not used, then *wrfin* must be provided.
3545
3546 geobounds (:class:`wrf.GeoBounds`, optional): The geobounds to
3547 get the extents. If set to None and using the *var* parameter,
3548 the geobounds will be taken from the variable. If using a
3549 file, then the geobounds will be taken from the native grid.
3550
3551 wrfin (:class:`netCDF4.Dataset`, :class:`Nio.NioFile`, or an \
3552 iterable, optional): WRF-ARW NetCDF
3553 data as a :class:`netCDF4.Dataset`, :class:`Nio.NioFile`
3554 or an iterable sequence of the aforementioned types. If not used,
3555 then *var* must be provided.
3556
3557 varname (:obj:`str`, optional): If using *wrfin*, then this will be the
3558 variable name to use to determine the geobounds. The variable
3559 can be a coordinate variable, or a regular variable that contains
3560 coordinate attributes. If None,
3561 then the 'XLAT', 'XLAT_M', 'XLONG', 'XLONG_M' variables
3562 will be used.
3563
3564 timeidx (:obj:`int` or :data:`wrf.ALL_TIMES`, optional): The
3565 desired time index. This value can be a positive integer,
3566 negative integer, or
3567 :data:`wrf.ALL_TIMES` (an alias for None) to return
3568 all times in the file or sequence. Default is 0.
3569
3570 method (:obj:`str`, optional): The aggregation method to use for
3571 sequences. Must be either 'cat' or 'join'.
3572 'cat' combines the data along the Time dimension.
3573 'join' creates a new dimension for the file index.
3574 The default is 'cat'.
3575
3576 squeeze (:obj:`bool`, optional): Set to False to prevent dimensions
3577 with a size of 1 from being automatically removed from the shape
3578 of the output. Default is True.
3579
3580 cache (:obj:`dict`, optional): A dictionary of (varname, ndarray)
3581 that can be used to supply pre-extracted NetCDF variables to the
3582 computational routines. It is primarily used for internal
3583 purposes, but can also be used to improve performance by
3584 eliminating the need to repeatedly extract the same variables
3585 used in multiple diagnostics calculations, particularly when using
3586 large sequences of files.
3587 Default is None.
3588
3589 **kwargs: Keyword arguments for creating a
3590 :class:`matplotlib.mpl_toolkits.basemap.Basemap`. By default,
3591 the domain bounds will be set to the native projection, the
3592 resolution will be set to 'l', and the other projection

Callers

nothing calls this directly

Calls 1

_get_proj_objFunction · 0.85

Tested by

no test coverage detected