2. ECMWF Web Mapping Service (WMS)


The WMS service operated by ECMWF is part of the ecCharts services to provide forecast weather maps to its users. The service is based on an in-house developed Python package translating WMS requests into the internal request to generate maps which is based on the Magics/Metview parameter language. Currently the serviceprovides WMS version 1.1.1 and 1.3.1. Access is controlled through tokens which are restricted to ranges of IP addresses. The token “public” contains, besides selected weather forecast maps and maps from the Copernicus Atmosphere Monitoring Service (CAMS).


Parameter Id Type/Level Spatial resolution Temporal resolution Frequency Format Note
500 hPa Geopotential z500_public ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 10 12 hourly png, pdf
850 hPa temperature t850_public ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 10 12 hourly png, pdf
Wind speed at 850 hPa ws850_public ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 10 12 hourly png, pdf
Ensemble mean for 500 hPa geopotential z500_mean_public ECMWF probabilistic forecast / Pressure level Global past 5 days, up to day 10 12 hourly png, pdf Ensemble data consist of 50 ensemble members and control forecast
Ensemble mean for 850 hPa temperature t850_mean_public ECMWF probabilistic forecast / Pressure level Global past 5 days, up to day 10 12 hourly png, pdf Ensemble data consist of 50 ensemble members and control forecast
Ensemble mean for 850 hPa wind speed ws850_mean_public ECMWF probabilistic forecast / Pressure level Global past 5 days, up to day 10 12 hourly png, pdf Ensemble data consist of 50 ensemble members and control forecast
Ensemble mean for mean sea level pressure msl_mean_public ECMWF probabilistic forecast / Pressure level Global past 5 days, up to day 10 12 hourly png, pdf Ensemble data consist of 50 ensemble members and control forecast
Ensemble spread for 500 hPa geopotential z500_spread_public ECMWF probabilistic forecast / Pressure level Global past 5 days, up to day 10 12 hourly png, pdf Spread is represented as the standard deviation
Ensemble spread for 850 hPa temperature t850_spread_public ECMWF probabilistic forecast / Pressure level Global past 5 days, up to day 10 12 hourly png, pdf Spread is represented as the standard deviation
Ensemble spread for 850 hPa wind speed ws850_spread_public ECMWF probabilistic forecast / Pressure level Global past 5 days, up to day 10 12 hourly png, pdf Spread is represented as the standard deviation
Ensemble spread for mean sea level pressure msl_spread_public ECMWF probabilistic forecast / Pressure level Global past 5 days, up to day 10 12 hourly png, pdf Spread is represented as the standard deviation
Mean sea level pressure msl_public ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 10 12 hourly png, pdf
Parameter Id Type/Level Spatial resolution Temporal resolution Frequency Format Note
Carbon monoxide at 300 hPa [ppbv] composition_co_300hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Carbon monoxide at 50 hPa [ppbv] composition_co_50hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Carbon monoxide at 500 hPa [ppbv] composition_co_500hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Carbon monoxide at 700 hPa composition_co700 ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Carbon monoxide at 850 hPa composition_co_850hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Carbon monoxide at pressure levels (850, 700, 500, 300, 50) composition_co_upperlevel ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Carbon monoxide at surface [ppbv] composition_co_surface ECMWF deterministic forecast / Surface Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Total column of carbon monoxide [10ˆ18 molecules / cm2 ] composition_co_totalcolumn ECMWF deterministic forecast /Total column Global past 5 days, up to day 4 3 hourly png, pdf only available from 00UTC run
Parameter Id Type/Level Spatial resolution Temporal resolution Frequency Format Note
Carbon dioxide at 300 hPa [ppmv] composition_co2_300hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Carbon dioxide at 50 hPa [ppmv] composition_co2_50hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Carbon dioxide at 500 hPa [ppmv] composition_co2_500hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Carbon dioxide at 850 hPa [ppmv] composition_co2_850hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Carbon dioxide at surface [ppmv] composition_co2_surface ECMWF deterministic forecast / Surface Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Total column of carbon dioxide [ppmv] composition_co2_totalcolumn ECMWF deterministic forecast / Total column Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Parameter Id Type/Level Spatial resolution Temporal resolution Frequency Format Note
Formaldehyde at 300 hPa [ppbv] composition_hcho_300hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 4 3 hourly png, pdf only available from 00UTC run
Formaldehyde at 50 hPa [ppbv] composition_hcho_50hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 4 3 hourly png, pdf only available from 00UTC run
Formaldehyde at 500 hPa [ppbv] composition_hcho_500hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 4 3 hourly png, pdf only available from 00UTC run
Formaldehyde at 850 hPa [ppbv] composition_hcho_850hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 4 3 hourly png, pdf only available from 00UTC run
Formaldehyde at surface composition_hcho_surface ECMWF deterministic forecast /Surface Global past 5 days, up to day 4 3 hourly png, pdf only available from 00UTC run
Total column of formaldeyde [10ˆ15 molecules / cm2] composition_hcho_totalcolumn ECMWF deterministic forecast / Total column Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Parameter Id Type/Level Spatial resolution Temporal resolution Frequency Format Note
Methane at 300 hPa [ppbv] composition_hcho_300hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Methane at 50 hPa [ppbv] composition_hcho_50hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Methane at 500 hPa [ppbv] composition_hcho_500hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Methane at 850 hPa [ppbv] composition_hcho_850hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Methane at surface composition_hcho_surface ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Total column of methane [ppbv] composition_ch4_totalcolumn ECMWF deterministic forecast / Total column Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Parameter Id Type/Level Spatial resolution Temporal resolution Frequency Format Note
Nitrogen dioxide at 300 hPa [ppbv] composition_no2_300hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Nitrogen dioxide at 50 hPa [ppbv] composition_no2_50hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Nitrogen dioxide at 500 hPa [ppbv] composition_no2_500hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Nitrogen dioxide at 850 hPa [ppbv] composition_no2_850hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Nitrogen dioxide at surface composition_no2_surface ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Total column of nitrogen dioxide [10ˆ15 molecules / cm2] composition_no2_totalcolumn ECMWF deterministic forecast /Total column Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Parameter Id Type/Level Spatial resolution Temporal resolution Frequency Format Note
Ozone at 300 hPa [ppbv] composition_o3_300hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Ozone at 50 hPa [ppbv] composition_o3_50hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Ozone at 500 hPa [ppbv] composition_o3_500hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Ozone at 850 hPa [ppbv] composition_o3_850hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Ozone at surface composition_o3sfc ECMWF deterministic forecast / Surface Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Ozone at surface [ppbv] composition_o3_surface ECMWF deterministic forecast / Surface Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Total column of ozone composition_o3_totalcolumn ECMWF deterministic forecast / Total column Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Parameter Id Type/Level Spatial resolution Temporal resolution Frequency Format Note
Sulphur dioxide at 300 hPa [ppbv] composition_so2_300hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Sulphur dioxide at 50 hPa [ppbv] composition_so2_50hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Sulphur dioxide at 500 hPa [ppbv] composition_so2_500hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Sulphur dioxide at 850 hPa [ppbv] composition_so2_850hpa ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Sulphur dioxide at surface [ppbv] composition_so2_surface ECMWF deterministic forecast / Surface Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Total column of sulphur dioxide [0ˆ15 molecules / cm2] composition_so2_totalcolumn ECMWF deterministic forecast / Total column Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Parameter Id Type/Level Spatial resolution Temporal resolution Frequency Format Note
Aerosol optical depth at 550 nm composition_aod550 ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Biomass burning aerosol optical depth at 550 nm composition_bbaod550 ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Dust aerosol optical depth at 550 nm composition_duaod550 ECMWF deterministic forecast / Pressure level Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Fire radiative power [W m-2] composition_fire Analysis Global past 4 days 24 hourly png, pdf
PM10 - coarse particulate matter [microg / m3] composition_pm10 ECMWF deterministic forecast / Surface Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
PM2.5 - fine particulate matter [microg / m3] composition_pm2p5 ECMWF deterministic forecast / Surface Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Sea salt aerosol optical depth at 550 nm composition_ssaod550 ECMWF deterministic forecast / Surface Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Sulphate aerosol optical depth at 550 nm composition_suaod550 ECMWF deterministic forecast / Surface Global past 5 days, up to day 5 3 hourly png, pdf only available from 00UTC run
Parameter Id Style Name Spatial resolution Format
Background background - cream_background
- cream_sky_background
- cream_transparent_background
- darkgreen_background
- grey_background
- evergreen_navy_background
- land_background
- sea_background
- cream_medium_res_background
Global png, pdf
Boundaries boundaries - grey_boundaries
- black_boundaries
- red_boundaries
- yellow_boundaries
- thick_black_boundaries
Global png, pdf
Foreground foreground - black_foreground
- yellow_foreground
- black_thick_foreground
- medium_res_foreground
Global png, pdf
Grid only, no coastlines grid - grid_10x20_tan
- grid_10x20_blue
- grid_1x1_tan
- grid_5x5_tan
Global png, pdf
Rivers rivers - blue_rivers
- thick_blue_rivers
Global png, pdf

Example with owslib

Request layer information
In [1]:
from owslib.wms import WebMapService

# Create your WebMapService object
wms = WebMapService('http://apps.ecmwf.int/wms/?token=public', version='1.1.1') # version 1.3.0 works as well

# See available layers
list(wms.contents)

# Get layer description
wms['composition_co2_surface'].title
# Get bounding box information in WGS84
wms['composition_co2_surface'].boundingBoxWGS84
# Get available styles
wms['composition_co2_surface'].styles
# See available methods
[op.name for op in wms.operations]
# Get available formats
wms.getOperationByName('GetMap').formatOptions
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-d326a7f6b9fd> in <module>()
----> 1 from owslib.wms import WebMapService
      2 
      3 # Create your WebMapService object
      4 wms = WebMapService('http://apps.ecmwf.int/wms/?token=public', version='1.1.1') # version 1.3.0 works as well
      5 

ImportError: No module named owslib.wms
Request a map
In [2]:
%matplotlib inline
import os, sys
import matplotlib.image as mpimg
import matplotlib.pyplot as plt

def getMap(layerName,bbox,filename):
    wms.getOperationByName('GetMap').formatOptions
    img = wms.getmap(layers=[layerName],
                 size=(600,300),
                 srs='EPSG:4326',
                 bbox=bbox,
                 format='image/png',
                 transparent=True)

    tmpfile = open(filename,'wb')
    tmpfile.write(img.read())
    tmpfile.close()
getMap('foreground',(-180,-90,180,90), 'foreground.png')
getMap('background',(-180,-90,180,90), 'background.png')
getMap('composition_bbaod550',(-180,-90,180,90), 'bbaod550.png')


image1=mpimg.imread('background.png')
image2=mpimg.imread('bbaod550.png')
image3=mpimg.imread('foreground.png')
fig = plt.figure(figsize=(12,5))

img1=plt.imshow(image1,extent=[-180,180,-90,90],aspect='auto')
img2=plt.imshow(image2,extent=[-180,180,-90,90],aspect='auto')
img3=plt.imshow(image3,extent=[-180,180,-90,90],aspect='auto')
plt.show()
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-2-e9ec5d417d63> in <module>()
     16     tmpfile.write(img.read())
     17     tmpfile.close()
---> 18 getMap('foreground',(-180,-90,180,90), 'foreground.png')
     19 getMap('background',(-180,-90,180,90), 'background.png')
     20 getMap('composition_bbaod550',(-180,-90,180,90), 'bbaod550.png')

<ipython-input-2-e9ec5d417d63> in getMap(layerName, bbox, filename)
      5 
      6 def getMap(layerName,bbox,filename):
----> 7     wms.getOperationByName('GetMap').formatOptions
      8     img = wms.getmap(layers=[layerName],
      9                  size=(600,300),

NameError: global name 'wms' is not defined

Custom example

In [3]:
import requests
from IPython.display import Image
import xmltodict
import ipywidgets as widgets
from ipywidgets import interact
In [4]:
url = 'http://apps.ecmwf.int/wms/' 
capa =  {
            "token": "public",
            "request": "GetCapabilities",
            "version": "1.1.1",        
        }
capa = requests.get(url, capa, )

layers = xmltodict.parse(capa.text)
options = []
for layer in layers["WMT_MS_Capabilities"]["Capability"]["Layer"]["Layer"]:
    options.append(layer["Name"])
In [6]:
def getMap(param):
    params =  {
            "token": "public",
            "request": "GetMap",
            "version": "1.3.1",
            "srs": "EPSG:4326",
            "layers": "background,%s,foreground" % param,
            "width": 800,
            "height": 400,
            "format": "image/png",
        }
    r= requests.get(url,params, )

    with  open('workfile.png', 'wb') as png:
        png.write(r.content)
    return Image(filename="workfile.png")

interact(getMap, param = widgets.Dropdown( options= options) )
Out[6]:
<function __main__.getMap>

Request layer information

In [7]:
# Install R packages, if not already installed
# install.packages(c("XML"), "~/miniconda3/lib/R/library")

# Load packages
library("XML")

# GetCapabilities request
requestGetMap <- httr::GET(url = "http://apps.ecmwf.int/wms/", 
                           query = list(token = "public",
                                        version = "1.3.0",
                                        request = "GetCapabilities"))
  File "<ipython-input-7-0c072da3bd35>", line 8
    requestGetMap <- httr::GET(url = "http://apps.ecmwf.int/wms/",
                         ^
SyntaxError: invalid syntax
In [6]:
# Convert response into a list
xmlResponse <- XML::xmlToList(httr::content(requestGetMap, "text", 
                                            encoding = "UTF-8"))

# Extract only layers info
allLayers <- xmlResponse[["Capability"]][["Layer"]]

# List available layers
layerNames <- c()

for (i in seq_along(allLayers)) {
    
  layerNames <- c(layerNames, allLayers[i]$Layer$Name)
    
}

print(layerNames)
No encoding supplied: defaulting to UTF-8.
 [1] "t_uerra"                      "z500_public"                 
 [3] "t850_public"                  "ws850_public"                
 [5] "composition_aod550"           "background"                  
 [7] "composition_bbaod550"         "boundaries"                  
 [9] "composition_co2_300hpa"       "composition_co2_50hpa"       
[11] "composition_co2_500hpa"       "composition_co2_850hpa"      
[13] "composition_co2_surface"      "composition_co_300hpa"       
[15] "composition_co_50hpa"         "composition_co_500hpa"       
[17] "composition_co700"            "composition_co_850hpa"       
[19] "composition_co_upperlevel"    "composition_co_surface"      
[21] "composition_duaod550"         "z500_mean_public"            
[23] "t850_mean_public"             "ws850_mean_public"           
[25] "msl_mean_public"              "z500_spread_public"          
[27] "t850_spread_public"           "ws850_spread_public"         
[29] "msl_spread_public"            "composition_fire"            
[31] "foreground"                   "composition_hcho_300hpa"     
[33] "composition_hcho_50hpa"       "composition_hcho_500hpa"     
[35] "composition_hcho_850hpa"      "composition_hcho_surface"    
[37] "grid"                         "msl_public"                  
[39] "composition_ch4_300hpa"       "composition_ch4_50hpa"       
[41] "composition_ch4_500hpa"       "composition_ch4_850hpa"      
[43] "composition_ch4_surface"      "composition_no2_300hpa"      
[45] "composition_no2_50hpa"        "composition_no2_500hpa"      
[47] "composition_no2_850hpa"       "composition_no2_surface"     
[49] "composition_o3_300hpa"        "composition_o3_50hpa"        
[51] "composition_o3_500hpa"        "composition_o3_850hpa"       
[53] "composition_o3sfc"            "composition_o3_surface"      
[55] "composition_pm10"             "composition_pm2p5"           
[57] "rivers"                       "composition_ssaod550"        
[59] "composition_suaod550"         "composition_so2_300hpa"      
[61] "composition_so2_50hpa"        "composition_so2_500hpa"      
[63] "composition_so2_850hpa"       "composition_so2_surface"     
[65] "composition_co2_totalcolumn"  "composition_co_totalcolumn"  
[67] "composition_hcho_totalcolumn" "composition_ch4_totalcolumn" 
[69] "composition_no2_totalcolumn"  "composition_o3_totalcolumn"  
[71] "composition_so2_totalcolumn"  "tp_uerra_ens"                

Request a map

In [ ]:
# Install R packages, if not already installed
# install.packages(c("rgdal", "rworldmap", "raster", "httr"), "~/miniconda3/lib/R/library")

# Load packages
library("rworldmap")
library("raster")
library("httr")

# GET request to dowload file via URL
requestGetMap <- httr::GET(url = "http://apps.ecmwf.int/wms/",
                           query = list(token = "public",
                                        version = "1.3.0",
                                        request = "GetMap",
                                        layers = "composition_bbaod550"))

# Download png file
bbaod550 <- download.file(url = requestGetMap$url,
                          destfile = "composition_bbaod550.png")

# Convert png image to raster
bbaod550Raster <- raster(x = "composition_bbaod550.png",
                         crs = "+proj=longlat +datum=WGS84")
extent(bbaod550Raster) <- extent(-180, 180, -90, 90)
plot(bbaod550Raster, colNA = NA)

# Add a background map
newmap <- getMap(resolution = "coarse")  
plot(newmap, add=TRUE, border = 'gray')

© 2017 ECMWF

This software is licensed under the terms of the Apache Licence Version 2.0 which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. In applying this licence, ECMWF does not waive the privileges and immunities granted to it by virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.