Using Predefined Areas with MetPy#

When plotting your data on a map you want to be able to plot the data in a useful area and with a projection that would match the areal extent well. Within MetPy we have generated more than 400 pre-defined areas that also have associated projections, which you can use to make quick plots over regions of interest with minimal effort on your part. While these were intended to be used with the MetPy declarative syntax, these areas and projections are now accessible for any use of plotting data on a map using Cartopy.

from datetime import datetime, timedelta

import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt

from metpy.cbook import get_test_data
from metpy.io import metar
from metpy.plots import declarative, named_areas

Table of Predefined Areas#

Here is a full list of all of the areas currently in MetPy with their reference name, descriptive name, and extent bounds.

print('area      name                bounds')
for area in named_areas:
    print(f'{named_areas[area].name:<10s}{named_areas[area].description:<20s}{named_areas[area].bounds}')
area      name                bounds
us        UNITED STATES       (-119.0, -56.0, 19.0, 47.0)
awips     AWIPS US            (-127.0, -59.0, 20.0, 50.0)
uslcc     UNITED STATES LCC   (-124.0, -62.0, 20.0, 51.0)
whlf      WESTERN HALF        (-123.8, -85.9, 22.9, 50.2)
chlf      CENTRAL HALF        (-111.0, -79.0, 27.5, 50.5)
centus    CENTRAL US          (-105.4, -77.0, 24.7, 47.6)
ehlf      EASTERN HALF        (-96.2, -62.7, 22.0, 49.0)
mehlf     EASTERN HALF        (-89.9, -66.6, 23.8, 49.1)
west      WESTERN US          (-125.0, -90.0, 25.0, 55.0)
cent      CENTRAL US          (-107.4, -75.3, 24.3, 49.7)
east      EASTERN US          (-100.55, -65.42, 24.57, 47.2)
nwus      NW SECTOR           (-126.0, -102.0, 38.25, 50.25)
swus      SW SECTOR           (-126.0, -100.0, 28.25, 40.25)
ncus      NC SECTOR           (-108.0, -84.0, 38.25, 50.25)
scus      SC SECTOR           (-108.9, -84.0, 24.0, 40.25)
neus      NE SECTOR           (-89.0, -64.0, 37.25, 47.25)
seus      SE SECTOR           (-90.0, -66.0, 28.25, 40.25)
bosfa     BOSTON FA AREA      (-87.5, -63.5, 34.5, 50.5)
miafa     MIAMI FA AREA       (-88.0, -72.0, 23.0, 39.0)
chifa     CHICAGO FA AREA     (-108.0, -75.0, 34.0, 50.0)
dfwfa     DALLAS FA AREA      (-106.5, -80.5, 22.0, 40.0)
slcfa     SALT LAKE FA AREA   (-126.0, -98.0, 29.5, 50.5)
sfofa     SAN FRAN FA AREA    (-129.0, -111.0, 30.0, 50.0)
ak        ALASKA HPC QPF      (-180.0, -106.0, 42.0, 73.0)
al        ALABAMA             (-95.0, -79.0, 27.0, 38.0)
ar        ARKANSAS            (-100.75, -84.75, 29.5, 40.5)
ca        CALIFORNIA          (-127.75, -111.75, 31.5, 42.5)
co        COLORADO            (-114.0, -98.0, 33.5, 44.5)
ct        CONNECTICUT         (-81.25, -65.25, 36.0, 47.0)
dc        WASHINGTON DC       (-85.0, -69.0, 33.35, 44.35)
de        DELAWARE            (-83.75, -67.75, 33.25, 44.25)
fl        FLORIDA             (-90.0, -74.0, 23.0, 34.0)
ga        GEORGIA             (-92.0, -76.0, 27.5, 38.5)
hi        HAWAII              (-161.5, -152.5, 17.0, 23.0)
ia        IOWA                (-102.0, -86.0, 36.5, 47.5)
id        IDAHO               (-123.0, -107.0, 39.25, 50.25)
il        ILLINOIS            (-97.75, -81.75, 34.5, 45.5)
in        INDIANA             (-94.5, -78.5, 34.5, 45.5)
ks        KANSAS              (-106.5, -90.5, 33.25, 44.25)
ky        KENTUCKY            (-93.0, -77.0, 31.75, 42.75)
la        LOUISIANA           (-100.75, -84.75, 25.75, 36.75)
ma        MASSACHUSETTS       (-80.25, -64.25, 36.75, 47.75)
md        MARYLAND            (-85.25, -69.25, 33.75, 44.75)
me        MAINE               (-77.75, -61.75, 39.5, 50.5)
mi        MICHIGAN            (-93.0, -77.0, 37.75, 48.75)
mn        MINNESOTA           (-102.0, -86.0, 40.5, 51.5)
mo        MISSOURI            (-101.0, -85.0, 33.0, 44.0)
ms        MISSISSIPPI         (-98.0, -82.0, 27.0, 38.0)
mt        MONTANA             (-117.0, -101.0, 41.5, 52.5)
nc        NORTH CAROLINA      (-87.25, -71.25, 30.0, 41.0)
nd        NORTH DAKOTA        (-107.5, -91.5, 42.25, 53.25)
ne        NEBRASKA            (-107.5, -91.5, 36.25, 47.25)
nh        NEW HAMPSHIRE       (-79.5, -63.5, 38.25, 49.25)
nj        NEW JERSEY          (-82.5, -66.5, 34.75, 45.75)
nm        NEW MEXICO          (-114.25, -98.25, 29.0, 40.0)
nv        NEVADA              (-125.0, -109.0, 34.0, 45.0)
ny        NEW YORK            (-84.0, -68.0, 37.25, 48.25)
oh        OHIO                (-91.0, -75.0, 34.5, 45.5)
ok        OKLAHOMA            (-105.25, -89.25, 30.25, 41.25)
or        OREGON              (-128.0, -112.0, 38.75, 49.75)
pa        PENNSYLVANIA        (-86.0, -70.0, 35.5, 46.5)
ri        RHODE ISLAND        (-79.75, -63.75, 36.0, 47.0)
sc        SOUTH CAROLINA      (-89.0, -73.0, 28.5, 39.5)
sd        SOUTH DAKOTA        (-107.5, -91.5, 39.0, 50.0)
tn        TENNESSEE           (-95.0, -79.0, 30.0, 41.0)
tx        TEXAS               (-107.0, -91.0, 25.4, 36.5)
ut        UTAH                (-119.0, -103.0, 34.0, 45.0)
va        VIRGINIA            (-86.5, -70.5, 32.25, 43.25)
vt        VERMONT             (-80.75, -64.75, 38.25, 49.25)
wi        WISCONSIN           (-98.0, -82.0, 38.5, 49.5)
wv        WEST VIRGINIA       (-89.0, -73.0, 33.0, 44.0)
wy        WYOMING             (-116.0, -100.0, 37.75, 48.75)
az        ARIZONA             (-119.0, -103.0, 29.0, 40.0)
wa        WASHINGTON          (-128.0, -112.0, 41.75, 52.75)
cn        CANADA              (-120.4, -14.0, 37.9, 58.6)
cnlcc     CANADA LCC          (-127, -54.0, 40, 70)
ab        ALBERTA             (-119.6, -108.2, 48.6, 60.4)
bc        BRITISH COLUMBIA    (-134.5, -109.0, 47.2, 60.7)
mb        MANITOBA            (-102.4, -86.1, 48.3, 60.2)
nb        NEW BRUNSWICK       (-75.7, -57.6, 42.7, 49.6)
nf        NEWFOUNDLAND        (-68.0, -47.0, 45.0, 62.0)
ns        NOVA SCOTIA         (-67.0, -59.0, 43.0, 47.5)
nt        NW TERRITORIES      (-132.0, -100.0, 59.0, 70.5)
nu        NUNAVUT             (-115.0, -65.0, 59.0, 80)
on        ONTARIO             (-94.5, -68.2, 41.9, 55.0)
pe        PRINCE EDWARD IS    (-64.6, -61.7, 45.8, 47.1)
qb        QUEBEC              (-80.0, -49.2, 44.1, 60.9)
sa        SASKATCHEWAN        (-111.2, -97.8, 48.5, 60.3)
yt        YUKON TERRITORY     (-142.0, -117.0, 59.0, 70.5)
tropatl   TROPICAL ATLANTIC   (-115.0, 10.0, 0.0, 40.0)
subtrop   SUBTROPICAL ATL     (-90.0, -20.0, 20.0, 60.0)
troppac   TROPICAL PACIFIC    (-165.0, -80.0, -25.0, 45.0)
gulf      GULF OF MEXICO      (-105.0, -70.0, 10.0, 40.0)
carib     CARIBBEAN SEA       (-100.0, -50.0, 0.0, 40.0)
sthepac   SOUTH E PACIFIC     (-170.0, -70.0, -60.0, 0.0)
natlmed   N ATL/MEDITER       (-30.0, 70.0, 0.0, 65.0)
atlhur    ATLANTIC HURR       (-96.0, -6.0, 4.0, 3.0)
nam       N AMERICA           (-144, -50, 12, 75)
sam       S AMERICA           (-120.0, -20.0, -60.0, 20.0)
samps     S AMERICA (PS)      (-100.0, -34.0, -58.0, 15.0)
eur       EUROPE              (-16.0, 80.0, 24.0, 52.0)
natl      N ATLANTIC          (-110.0, 20.1, 15.0, 70.0)
watl      W ATLANTIC          (-84.0, -38.0, 25.0, 46.0)
tatl      TROPICAL ATLANTIC   (-90.0, -15.0, -10.0, 35.0)
npac      N PACIFIC           (102.0, 250.0, -12.0, 60.0)
spac      S PACIFIC           (102.0, 290.0, -60.0, 20.0)
tpac      TROPICAL PACIFIC    (-165.0, -75.0, -10.0, 40.0)
epac      E PACIFIC           (-150.0, -98.0, 12.0, 60.0)
wpac      W PACIFIC           (130.0, 240.0, 0.0, 63.0)
mpac      MARINE PACIFIC      (128.0, 252.0, 15.0, 71.95)
americas  ICAO MERC AREA A    (-137.4, -12.6, -54.0, 67.0)
atlantic  ICAO MERC AREA B1   (-125.0, 40.0, -45.5, 62.7)
africa    ICAO MERC AREA C    (-35.0, 70.0, -45.0, 75.0)
indocean  ICAO MERC AREA D    (-15.0, 132.0, -27.0, 63.0)
oceania   ICAO MERC AREA E    (25.0, 180.0, -54.0, 40.0)
trop_pac  ICAO MERC AREA F    (100.0, 250, -52.7, 50.0)
asia_ps   ICAO P.S. AREA G    (34.8, 157.2, -0.8, 13.7)
na_ps     ICAO P.S. AREA H    (-79.1, 56.7, 1.6, 25.2)
npac_ps   ICAO P.S. AREA I    (166.24, -60.62, -6.74, 33.32)
antarcticaICAO P.S. AREA J    (106.8, -101.1, -27.6, 0.8)
europe    ICAO P.S. AREA EU   (-21.6, 68.4, 21.4, 58.7)
middle_eastICAO MERC AREA ME   (17.0, 70.0, 10.0, 44.0)
india     ICAO MERC AREA AS   (53.0, 108.0, 0.0, 36.0)
ag        ARGENTINA           (-80.0, -53.0, -56.0, -20.0)
ah        AFGHANISTAN         (60.0, 77.0, 27.0, 40.0)
afrca     AFRICA              (-25.0, 59.4, -36.0, 41.0)
ai        ASCENSION ISLAND    (-14.3, -14.1, -8.0, -7.8)
alba      ALBANIA             (18.0, 23.0, 39.0, 43.0)
alge      ALGERIA             (-9.0, 12.0, 15.0, 38.0)
an        ANGOLA              (10.0, 25.0, -20.0, -5.0)
antl      LESSER ANTILLES     (-70.0, -58.0, 11.0, 19.0)
antg      GREATER ANTILLES    (-86.0, -65.0, 17.0, 25.0)
atg       ANTIGUA & BARBUDA   (-62.0, -61.6, 16.9, 17.75)
au        AUSTRALIA           (110.0, 160.0, -40.0, -6.5)
azor      AZORES              (-27.6, -23.0, 36.0, 41.0)
ba        BAHAMAS             (-80.5, -72.5, 22.5, 28.5)
be        BERMUDA             (-64.9, -64.5, 32.2, 32.6)
bel       BELGIUM             (2.5, 6.5, 49.4, 51.6)
bf        BRUNEI              (113.0, 116.0, 4.0, 5.5)
bfa       BURKINA FASO        (-6.0, 3.0, 9.0, 15.1)
bh        BELIZE              (-89.3, -88.1, 15.7, 18.5)
bi        BURUNDI             (29.0, 30.9, -4.6, -2.2)
bj        BENIN               (0.0, 5.0, 6.0, 12.6)
bn        BAHRAIN             (50.0, 51.0, 25.5, 27.1)
bo        BOLIVIA             (-72.0, -50.0, -24.0, -8.0)
bots      BOTSWANA            (19.0, 29.6, -27.0, -17.0)
br        BARBADOS            (-62.5, -56.5, 12.45, 13.85)
bt        BRITISH INDIAN OC   (71.25, 72.6, -7.5, -5.0)
bu        BULGARIA            (22.0, 30.0, 40.0, 45.0)
bv        BOUVET ISLANDS      (3.0, 4.0, -55.0, -54.0)
bw        BANGLADESH          (87.0, 93.0, 20.8, 27.0)
by        BYELORUSSIA         (19.0, 33.0, 51.0, 60.0)
bz        BRAZIL              (-75.0, -30.0, -35.0, 5.0)
cais      CANTON ISLAND       (-172.0, -171.0, -3.0, -2.0)
nwcar     NWX CARIBBEAN       (-120.0, -50.0, -15.0, 35.0)
cari      CARIBBEAN           (-103.0, -53.0, 3.0, 36.0)
cb        CHAD                (13.0, 25.0, 7.0, 24.0)
ce        CENTRAL AFRICA      (14.0, 29.0, 2.0, 11.5)
cg        CONGO               (10.0, 20.0, -6.0, 5.0)
ch        CHILE               (-80.0, -66.0, -56.0, -15.0)
ci        CHINA               (85.0, 145.0, 14.0, 48.5)
cm        CAMEROON            (7.5, 17.1, 1.0, 14.0)
colm      COLUMBIA            (-81.0, -65.0, -5.0, 14.0)
cr        CANARY ISLANDS      (-19.0, -13.0, 27.0, 30.0)
cs        COSTA RICA          (-86.5, -81.5, 8.2, 11.6)
cu        CUBA                (-85.0, -74.0, 19.0, 24.0)
cv        CAPE VERDE ISLAND   (-26.0, -22.0, 14.0, 18.0)
cy        CYPRUS              (32.0, 35.0, 34.0, 36.0)
cz        CZECH REPUBLIC      (8.9, 22.9, 47.4, 52.4)
dj        DJIBOUTI            (41.5, 44.1, 10.5, 13.1)
dl        GERMANY             (4.8, 16.8, 47.0, 55.0)
dn        DENMARK             (8.0, 11.0, 54.0, 58.6)
do        DOMINICA            (-61.6, -61.2, 15.2, 15.8)
dr        DOMINICAN REPUBLIC  (-72.2, -68.0, 17.5, 20.2)
eg        EGYPT               (24.0, 37.0, 21.0, 33.0)
eq        ECUADOR             (-85.0, -74.0, -7.0, 3.0)
er        UAE                 (50.0, 57.0, 22.0, 26.6)
es        EL SALVADOR         (-90.3, -87.5, 13.0, 14.6)
et        ETHIOPIA            (33.0, 49.0, 2.0, 19.0)
fa        FAEROES             (-8.0, -6.0, 61.0, 63.0)
fg        FRENCH GUIANA       (-55.0, -49.0, 1.0, 7.0)
fi        FINLAND             (20.9, 35.1, 59.0, 70.6)
fj        FIJI ISLANDS        (176.0, 181.0, 16.0, 19.0)
fk        FALKLAND ISLANDS    (-61.3, -57.5, -53.0, -51.0)
fn        NIGER               (0.0, 17.0, 11.0, 24.0)
fr        FRANCE              (-5.0, 11.0, 41.0, 51.5)
gb        GAMBIA              (-17.1, -13.5, 13.0, 14.6)
gc        CAYMAN ISLANDS      (-82.8, -77.6, 17.9, 21.1)
gh        GHANA               (-4.5, 1.5, 4.0, 12.0)
gi        GIBRALTAR           (-8.0, -4.0, 35.0, 38.0)
gl        GREENLAND           (-60, -20, 58.3, 85)
glp       GUADALOUPE          (-64.2, -59.8, 14.8, 19.2)
gm        GUAM                (144.5, 145.1, 13.0, 14.0)
gn        GUINEA              (2.0, 16.0, 3.5, 15.5)
go        GABON               (8.0, 14.5, -4.6, 3.0)
gr        GREECE              (20.0, 27.6, 34.0, 42.0)
gu        GUATEMALA           (-95.6, -85.0, 10.5, 21.1)
gw        GUINEA-BISSAU       (-17.5, -13.5, 10.8, 12.8)
gy        GUYANA              (-62.0, -55.0, 0.0, 10.0)
ha        HAITI               (-75.0, -71.0, 18.0, 20.0)
he        ST HELENA           (-6.1, -5.5, -16.3, -15.5)
hk        HONG KONG           (113.5, 114.7, 22.0, 23.0)
ho        HONDURAS            (-90.0, -83.0, 13.0, 16.6)
hu        HUNGARY             (16.0, 23.0, 45.5, 49.1)
ic        COMOROS             (43.0, 45.0, -13.2, -11.0)
icel      ICELAND             (-24.1, -11.5, 63.0, 67.5)
ie        IRELAND             (-11.1, -4.5, 50.0, 55.6)
inda      INDIA               (67.0, 92.0, 4.2, 36.0)
indo      INDONESIA           (95.0, 141.0, -8.0, 6.0)
iq        IRAQ                (38.0, 50.0, 29.0, 38.0)
ir        IRAN                (44.0, 65.0, 25.0, 40.0)
is        ISRAEL              (34.0, 37.0, 29.0, 34.0)
iv        IVORY COAST         (-9.0, -2.0, 4.0, 11.0)
iw        WEST BANK           (34.8, 35.6, 31.2, 32.6)
iy        ITALY               (6.6, 20.6, 35.6, 47.2)
jd        JORDAN              (34.0, 39.6, 29.0, 33.6)
jm        JAMAICA             (-80.0, -76.0, 16.0, 19.0)
jp        JAPAN               (123.0, 155.0, 24.0, 47.0)
ka        CAROLINE ISLANDS    (131.0, 155.0, 1.0, 9.6)
kash      JAMMU & KASHMIR     (74.0, 78.0, 32.0, 35.0)
kb        KIRIBATI            (172.0, 177.0, -3.0, 3.2)
khm       CAMBODIA            (102.0, 108.0, 10.0, 15.0)
ki        CHRISTMAS ISLAND    (105.2, 106.2, -11.0, -10.0)
kn        KENYA               (32.5, 42.1, -6.0, 6.0)
kna       ST KITTS & NEVIS    (-62.9, -62.4, 17.0, 17.5)
ko        KOREA               (124.0, 131.5, 33.0, 43.5)
ku        COOK ISLANDS        (-168.0, -155.0, -24.1, -6.1)
kw        KUWAIT              (46.5, 48.5, 28.5, 30.5)
laos      LAOS                (100.0, 108.0, 13.5, 23.1)
lb        LEBANON             (34.5, 37.1, 33.0, 35.0)
lc        ST LUCIA            (60.9, 61.3, 13.25, 14.45)
li        LIBERIA             (-12.0, -7.0, 4.0, 9.0)
ln        LINE ISLANDS        (-162.1, -154.9, -4.2, 6.0)
ls        LESOTHO             (27.0, 29.6, -30.6, -28.0)
lt        LIECHTENSTEIN       (9.3, 9.9, 47.0, 47.6)
lux       LUXEMBOURG          (5.6, 6.6, 49.35, 50.25)
ly        LIBYA               (8.0, 26.0, 19.0, 35.0)
maar      ST MAARTEN          (-63.9, -62.3, 17.0, 18.6)
made      MADEIRA             (-17.3, -16.5, 32.6, 33.0)
mala      MALAYSIA            (100.0, 119.6, 1.0, 8.0)
mali      MALI                (-12.5, 6.0, 8.5, 25.5)
maur      MAURITIUS           (57.2, 57.8, -20.7, -19.9)
maut      MAURITANIA          (-17.1, -4.5, 14.5, 28.1)
mc        MOROCCO             (-13.0, -1.0, 25.0, 36.0)
mg        MADAGASCAR          (43.0, 50.6, -25.6, -12.0)
mh        MARSHALL ISLANDS    (160.0, 172.0, 4.5, 12.1)
ml        MALTA               (14.3, 14.7, 35.8, 36.0)
mmr       MYANMAR             (92.0, 102.0, 7.5, 28.5)
mong      MONGOLIA            (87.5, 123.1, 38.5, 52.6)
mr        MARTINIQUE          (-61.2, -60.8, 14.3, 15.1)
mu        MACAO               (113.0, 114.0, 22.0, 23.0)
mv        MALDIVE ISLANDS     (70.1, 76.1, -6.0, 10.0)
mw        MALAWI              (32.5, 36.1, -17.0, -9.0)
mx        MEXICO              (-119.0, -83.0, 13.0, 34.0)
my        MARIANNA ISLANDS    (142.5, 148.5, 9.0, 25.0)
mz        MOZAMBIQUE          (29.0, 41.0, -26.5, -9.5)
nama      NAMIBIA             (11.0, 25.0, -29.5, -16.5)
ncal      NEW CALEDONIA       (158.0, 172.0, -23.0, -18.0)
ng        NEW GUINEA          (130.0, 152.0, -11.0, 0.0)
ni        NIGERIA             (2.0, 14.6, 3.0, 14.0)
nk        NICARAGUA           (-88.0, -83.0, 10.5, 15.1)
nl        NETHERLANDS         (3.5, 7.5, 50.5, 54.1)
no        NORWAY              (3.0, 35.0, 57.0, 71.5)
np        NEPAL               (80.0, 89.0, 25.0, 31.0)
nw        NAURU               (166.4, 167.4, -1.0, 0.0)
nz        NEW ZEALAND         (165.0, 179.0, -48.0, -33.0)
om        OMAN                (52.0, 60.0, 16.0, 25.6)
os        AUSTRIA             (9.0, 18.0, 46.0, 50.0)
pf        FRENCH POLYNESIA    (-154.0, -134.0, -28.0, -8.0)
ph        PHILIPINES          (116.0, 127.0, 4.0, 21.0)
pi        PHOENIX ISLANDS     (-177.5, -167.5, -9.0, 1.0)
pk        PAKISTAN            (60.0, 78.0, 23.0, 37.0)
pl        POLAND              (14.0, 25.0, 48.5, 55.0)
pm        PANAMA              (-83.0, -77.0, 7.0, 10.0)
po        PORTUGAL            (-10.0, -4.0, 36.5, 42.5)
pr        PERU                (-82.0, -68.0, -20.0, 5.0)
pt        PITCAIRN ISLANDS    (-130.6, -129.6, -25.56, -24.56)
pu        PUERTO RICO         (-67.5, -65.5, 17.5, 18.5)
py        PARAGUAY            (-65.0, -54.0, -32.0, -17.0)
qg        EQUATORIAL GUINEA   (7.0, 12.0, -2.0, 3.0)
qt        QATAR               (50.0, 52.0, 24.0, 27.0)
ra        RUSSIA              (40.0, 190.0, 35.0, 70.0)
re        REUNION             (55.0, 56.0, -21.5, -20.5)
riro      RIO DE ORO          (-18.0, -12.0, 17.5, 27.5)
ro        ROMANIA             (19.0, 31.0, 42.5, 48.5)
rw        RWANDA              (29.0, 31.0, -3.0, -1.0)
saudi     SAUDI ARABIA        (4.6, 92.5, -13.2, 60.3)
sb        SRI LANKA           (79.0, 83.0, 5.0, 10.0)
seyc      SEYCHELLES ISLANDS  (55.0, 56.0, -5.0, -4.0)
sg        SENEGAL             (-18.0, -10.0, 12.0, 17.0)
si        SOMALIA             (39.5, 52.1, -4.5, 13.5)
sk        SARAWAK             (109.5, 119.3, 1.0, 7.0)
sl        SIERRA LEONE        (-13.6, -10.2, 6.9, 10.1)
sm        SURINAME            (-59.0, -53.0, 1.0, 6.0)
sn        SWEDEN              (10.0, 25.0, 55.0, 69.6)
so        SOLOMON ISLANDS     (156.0, 167.0, -12.0, -6.0)
sp        SPAIN               (-10.0, 6.0, 35.0, 44.0)
sr        SINGAPORE           (103.0, 105.0, 1.0, 2.0)
su        SUDAN               (21.5, 38.5, 3.5, 23.5)
sv        SWAZILAND           (30.5, 33.1, -27.5, -25.3)
sw        SWITZERLAND         (5.9, 10.5, 45.8, 48.0)
sy        SYRIA               (35.0, 42.6, 32.0, 37.6)
tanz      TANZANIA            (29.0, 40.6, -13.0, 0.0)
td        TRINIDAD & TOBAGO   (-62.1, -60.5, 10.0, 11.6)
tg        TOGO                (-0.5, 2.5, 5.0, 12.0)
th        THAILAND            (97.0, 106.0, 5.0, 21.0)
ti        TURKS ISLANDS       (-71.6, -70.6, 21.0, 22.0)
tk        TOKELAU ISLANDS     (-173.0, -171.0, -11.5, -7.5)
to        TONGA               (-178.5, -170.5, -22.0, -15.0)
tp        SAO TOME-PRINCIPE   (6.0, 7.6, 0.0, 2.0)
ts        TUNISIA             (7.0, 13.0, 30.0, 38.0)
tu        TURKEY              (25.0, 48.0, 34.1, 42.1)
tv        TUVALU              (176.0, 180.0, -11.0, -5.0)
tw        TAIWAN              (120.0, 122.0, 21.9, 25.3)
ug        UGANDA              (29.0, 35.0, -3.5, 5.5)
uk        UNITED KINGDOM      (-11.0, 5.0, 49.0, 60.0)
ur        UKRAINE             (20.0, 41.0, 45.0, 52.0)
uy        URUGUAY             (-60.0, -52.0, -35.5, -29.5)
vanu      VANUATU             (167.0, 170.0, -21.0, -13.0)
vi        VIRGIN ISLANDS      (-65.5, -64.0, 16.6, 19.6)
vk        SLOVAKIA            (13.8, 25.8, 46.75, 50.75)
vn        VENEZUELA           (-75.0, -60.0, -2.0, 14.0)
vs        VIETNAM             (102.0, 110.0, 8.0, 24.0)
wk        WAKE ISLAND         (166.1, 167.1, 18.8, 19.8)
ye        YEMEN               (42.5, 54.1, 12.5, 19.1)
yg        YUGOSLAVIA          (13.5, 24.6, 40.0, 47.0)
za        SOUTH AFRICA        (16.0, 34.0, -36.0, -22.0)
zb        ZAMBIA              (21.0, 35.0, -20.0, -7.0)
zm        WESTERN SAMOA       (170.5, 173.5, -15.0, -13.0)
zr        ZAIRE               (12.0, 31.6, -14.0, 6.0)
zw        ZIMBABWE            (25.0, 34.0, -22.9, -15.5)

Example Using Bounds and Projection for an Area#

Each area string given in the table above have a descriptive name, extent bounds, and a projection associated with each entry. We can pull any of this information to help us make a plot over the area domain.

# Select the area string
area = 'epac'

# Get the extent and project for the selected area
extent = named_areas[area].bounds
proj = named_areas[area].projection

# Plot a simple figure for the selected area
plt.figure(1, figsize=(10, 10))
ax = plt.subplot(111, projection=proj)
ax.set_extent(extent, ccrs.PlateCarree())
ax.add_feature(cfeature.STATES.with_scale('10m'), edgecolor='grey', linewidth=0.75)
ax.add_feature(cfeature.COASTLINE.with_scale('10m'), linewidth=1.1)
ax.add_feature(cfeature.BORDERS.with_scale('10m'), edgecolor='black')
ax.set_title(f'area={area}          name={named_areas[area].description}'
             f'\nproj={proj.coordinate_operation.method_name}')
plt.show()
area=epac          name=E PACIFIC proj=PROJ ob_tran o_proj=latlon

Examaple Using Declarative Syntax#

Here is an example using a predefined area with the declarative plotting syntax for plotting some surface observations.

# Set the observation time
obs_time = datetime(2019, 7, 1, 12)

# Read in data
df = metar.parse_metar_file(get_test_data('metar_20190701_1200.txt', False), year=2019,
                            month=7)

# Plot desired data
obs = declarative.PlotObs()
obs.data = df
obs.time = obs_time
obs.time_window = timedelta(minutes=15)
obs.level = None
obs.fields = ['cloud_coverage', 'air_temperature', 'dew_point_temperature',
              'air_pressure_at_sea_level', 'current_wx1_symbol']
obs.plot_units = [None, 'degF', 'degF', None, None]
obs.locations = ['C', 'NW', 'SW', 'NE', 'W']
obs.formats = ['sky_cover', None, None, lambda v: format(v * 10, '.0f')[-3:],
               'current_weather']
obs.reduce_points = 0.75
obs.vector_field = ['eastward_wind', 'northward_wind']

# Panel for plot with Map features
panel = declarative.MapPanel()
panel.layout = (1, 1, 1)
panel.projection = 'area'
panel.area = 'in+'
panel.layers = ['states']
panel.title = f'Surface plot for {obs_time}'
panel.plots = [obs]

# Bringing it all together
pc = declarative.PanelContainer()
pc.size = (10, 10)
pc.panels = [panel]

pc.show()
Surface plot for 2019-07-01 12:00:00

Total running time of the script: (0 minutes 10.394 seconds)

Gallery generated by Sphinx-Gallery