You can run this notebook in Binder, in Colab, in Deepnote or in Kaggle.

[1]:
!pip install --quiet climetlab

Retrieve data ECMWF MARS archive

[2]:
import climetlab as cml
[3]:
source = cml.load_source(
    "mars",
    param=["2t", "msl"],
    levtype="sfc",
    area=[50, -50, 20, 50],
    grid=[1, 1],
    date="2012-12-13",
)
for s in source:
    cml.plot_map(s)
../_images/examples_04-source-mars_3_0.png
../_images/examples_04-source-mars_3_1.png
[4]:
source.to_xarray()
[4]:
<xarray.Dataset>
Dimensions:     (latitude: 31, longitude: 101)
Coordinates:
    number      int64 0
    time        datetime64[ns] 2012-12-13T12:00:00
    step        timedelta64[ns] 00:00:00
    surface     int64 0
  * latitude    (latitude) float64 50.0 49.0 48.0 47.0 ... 23.0 22.0 21.0 20.0
  * longitude   (longitude) float64 -50.0 -49.0 -48.0 -47.0 ... 48.0 49.0 50.0
    valid_time  datetime64[ns] 2012-12-13T12:00:00
Data variables:
    t2m         (latitude, longitude) float32 272.9 274.0 274.7 ... 297.8 298.4
    msl         (latitude, longitude) float32 1.002e+05 9.997e+04 ... 1.014e+05
Attributes:
    GRIB_edition:            1
    GRIB_centre:             ecmf
    GRIB_centreDescription:  European Centre for Medium-Range Weather Forecasts
    GRIB_subCentre:          0
    Conventions:             CF-1.7
    institution:             European Centre for Medium-Range Weather Forecasts
    history:                 2021-03-24T13:23:13 GRIB to CDM+CF via cfgrib-0....