wrf.get_basemap

wrf.get_basemap(var=None, wrfin=None, varname=None, timeidx=0, method='cat', squeeze=True, cache=None, **kwargs)
Return a matplotlib.mpl_toolkits.basemap.Basemap object

for the map projection.

Parameters:
  • var (xarray.DataArray, optional) – A xarray.DataArray variable that includes latitude,longitude coordinate information. If not used, then wrfin must be provided.

  • geobounds (wrf.GeoBounds, optional) – The geobounds to get the extents. If set to None and using the var parameter, the geobounds will be taken from the variable. If using a file, then the geobounds will be taken from the native grid.

  • wrfin (netCDF4.Dataset, Nio.NioFile, or an iterable, optional) – WRF-ARW NetCDF data as a netCDF4.Dataset, Nio.NioFile or an iterable sequence of the aforementioned types. If not used, then var must be provided.

  • varname (str, optional) – If using wrfin, then this will be the variable name to use to determine the geobounds. The variable can be a coordinate variable, or a regular variable that contains coordinate attributes. If None, then the ‘XLAT’, ‘XLAT_M’, ‘XLONG’, ‘XLONG_M’ variables will be used.

  • timeidx (int or wrf.ALL_TIMES, optional) – The desired time index. This value can be a positive integer, negative integer, or wrf.ALL_TIMES (an alias for None) to return all times in the file or sequence. Default is 0.

  • method (str, optional) – The aggregation method to use for sequences. Must be either ‘cat’ or ‘join’. ‘cat’ combines the data along the Time dimension. ‘join’ creates a new dimension for the file index. The default is ‘cat’.

  • squeeze (bool, optional) – Set to False to prevent dimensions with a size of 1 from being automatically removed from the shape of the output. Default is True.

  • cache (dict, optional) – A dictionary of (varname, ndarray) that can be used to supply pre-extracted NetCDF variables to the computational routines. It is primarily used for internal purposes, but can also be used to improve performance by eliminating the need to repeatedly extract the same variables used in multiple diagnostics calculations, particularly when using large sequences of files. Default is None.

  • **kwargs – Keyword arguments for creating a matplotlib.mpl_toolkits.basemap.Basemap. By default, the domain bounds will be set to the native projection, the resolution will be set to ‘l’, and the other projection parameters will be set by the information in the file.

Returns:

A Projection subclass for the map projection.

Return type:

cartopy.crs.Projection

Returns:

A Basemap object for the projection.

Return type:

matplotlib.mpl_toolkits.basemap.Basemap

See Also:

matplotlib.mpl_toolkits.basemap.Basemap