Mapping#

Map data onto a geographic map!

geographic keywords#

For geographic annotations, there are these keywords:

ahlive keyword

type

scope

description

crs

str

subplot

the data’s projection coordinate reference system (crs)

projection

str

subplot

the desired output crs

central_lon

float

subplot

the desired longitude in degrees to center on

borders

bool

subplot

whether to show country borders

coastline

bool

subplot

whether to show coastlines

tiles

bool

subplot

whether to show tiles

zoom

int

subplot

zoom level of tiles

land

bool

subplot

whether to show land

ocean

bool

subplot

whether to show ocean

lakes

bool

subplot

whether to show lakes

rivers

bool

subplot

whether to show rivers

states

bool

subplot

whether to show US states’ borders

worldwide

bool

subplot

whether to set to global extents

reference crs#

To utilize any geographic annotations, pass crs OR projection as an instantiated cartopy.crs object the class name.

crs specifies the data’s coordinate reference system; it’s often set to ccrs.PlateCarree(), or conveniently 'platecarree', if the data is in degrees.

[1]:
import xarray as xr
import ahlive as ah
ds = xr.tutorial.open_dataset('air_temperature').isel(time=slice(0, 3))
ah_ds = ah.Dataset(ds, 'lon', 'lat', 'air', crs='platecarree')
ah_ds.render()

Hi!
I am the author of pygifsicle , which you use in this Notebook.
I hope my work has saved you some time!
I love to code, but I also need coffee. Please sponsor me on GitHub ❤️
Good luck in your coding 🍀!
- Luca

[1]:

projection crs#

projection on the other hand specifies the desired output crs. If crs is not specified, but projection is set, crs defaults to ccrs.PlateCarree().

[2]:
import xarray as xr
import ahlive as ah
ds = xr.tutorial.open_dataset('air_temperature').isel(time=slice(0, 3))
ah_ds = ah.Dataset(ds, 'lon', 'lat', 'air', projection='lambertconformal')
ah_ds.render()
[2]: