tracktable.render.maps module

tracktable.render.maps.airport_map(airport_id, region_size=(200, 200), projection=cartopy.crs.Miller)[source]

Draw a map for a region surrounding an airport.

map_for_airport(airport_code, (string - example ‘ORD’ or ‘KORD’ for O’Hare

region_size = (200,200) projection=cartopy.crs.Miller) -> Matplotlib axes

Create a map for the region surrounding the requested airport.

The region will be a rectangle in lon/lat space with the specified width and height in KM. We’ll do our best to convert those into a lat/lon bounding box.

We default to the Miller Cylindrical projection. It does a pretty good job of showing the world in familiar shapes although distortion sets in above/below about 50 degrees. Fortunately, things are still quite recognizable. If you would prefer a different projection then change the value of projection from cartopy.crs.Miller to something else.

This function returns axes for Matplotlib.

tracktable.render.maps.available_maps()[source]
tracktable.render.maps.city_map(*args)[source]
tracktable.render.maps.instantiate_map(min_corner, max_corner, projection=cartopy.crs.Miller)[source]

Draw a map with custom projection and bounding box.

If min_corner and max_corner are set then we will set the map extents to match. If they are None then we will stick with whatever the defaults for the map projection are. You will always want to specify the extents unless the projection doesn’t have any (e.g. whole-globe projections) or is defined with special extents (the OSGB projection, sensible for the UK and not much else).

Parameters
  • min_corner – (lon, lat) coordinates of southwest corner

  • max_corner – (lon, lat) coordinates of northeast corner

  • projection (optional) – a projection from cartopy.crs

Returns

Matplotlib Axes instance

tracktable.render.maps.predefined_map(mapname, region_size=(200, 200), projection=None)[source]

Create a map of one of several familiar regions in the world.

You can ask for one of three types of map.

Region: one of ‘region:conus’ (continental US), ‘region:europe’,

‘region:world’, ‘region:north_america’, ‘region:south_america’, ‘region:australia’

Airport: ‘airport:DFW’ where ‘DFW’ is the 3- or 4-letter ICAO

abbreviation for the airport you want

City (NOT YET IMPLEMENTED): ‘city:WashingtonDC’ where

‘WashingtonDC’ is the city name without spaces or punctuation marks.

For the airport and city maps you may specify an additional ‘region_size’ argument that gives the desired width and height of the map region in KM. For example, a 200km-by-100km window centered on St. Louis airport could be created this way:

my_map_axes = predefined_map(‘airport:STL’,

region_size=(200, 100))

Parameters
  • mapname – String naming which predefined map you want

  • region_size (optional) – 2-element tuple with (width, height) as km

Returns

Matplotlib axes (via Cartopy) into which you can render your data

tracktable.render.maps.region_map(region_name, projection=None)[source]

Create map for predefined region

Create a geographic map for one of several common regions in the world. For a list of supported regions please see tracktable.maps.available_maps().

Parameters
  • region_name (string) – Name of desired region

  • projection_name (optional) – Cartopy projection if you want to override the default

Returns

Cartopy axes for given region