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

[4]:
# !pip install --quiet climetlab

Meteonet

This is an retrieve an plot various data types from https://github.com/meteofrance/meteonet

[5]:
import climetlab as cml

Radar images

[6]:
ds = cml.load_dataset("meteonet-samples-radar")
/Users/baudouin/git/climetlab/climetlab/readers/unknown.py:17: UserWarning: Unknown file type /var/folders/gt/_nyhyz497ns5szsvxw16gz6m0000gn/T/climetlab-baudouin/url-59f620fef7d5c24eb8d34d46e14cb939adc56ea5af70e1945b89652873b54b14.d/lats.npy (b'\x93NUMPY\x01\x00'), ignoring
  warnings.warn(f"Unknown file type {path} ({magic}), ignoring")
/Users/baudouin/git/climetlab/climetlab/readers/unknown.py:17: UserWarning: Unknown file type /var/folders/gt/_nyhyz497ns5szsvxw16gz6m0000gn/T/climetlab-baudouin/url-59f620fef7d5c24eb8d34d46e14cb939adc56ea5af70e1945b89652873b54b14.d/lons.npy (b'\x93NUMPY\x01\x00'), ignoring
  warnings.warn(f"Unknown file type {path} ({magic}), ignoring")
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-6-f34292b510aa> in <module>
----> 1 ds = cml.load_dataset("meteonet-samples-radar")

~/git/climetlab/climetlab/datasets/__init__.py in load_dataset(name, *args, **kwargs)
    221         TERMS_OF_USE_SHOWN.add(name)
    222
--> 223     ds = klass(*args, **kwargs).mutate()
    224     if getattr(ds, "name", None) is None:
    225         ds.name = name

~/git/climetlab/climetlab/datasets/meteonet-samples/radar.py in __init__(self, domain, variable, year, month, part)
     34         )
     35
---> 36         coords = np.load(download_and_cache(url), allow_pickle=True)
     37
     38         resolution = 0.01

~/git/climetlab/climetlab/utils/__init__.py in download_and_cache(url)
     20     from climetlab import load_source
     21
---> 22     return load_source("url", url).path
     23
     24

AttributeError: 'EmptySource' object has no attribute 'path'
[4]:
ds
[4]:

meteonet-samples-radar

Home pagehttps://meteonet.umr-cnrm.fr
Documentationhttps://meteofrance.github.io/meteonet/
Citation
-
Licencehttps://meteonet.umr-cnrm.fr/dataset/LICENCE.md
[5]:
ds.licence
[5]:
'https://meteonet.umr-cnrm.fr/dataset/LICENCE.md'
[6]:
cml.plot_map(ds)
../_images/examples_10-meteonet_8_0.png
[7]:
ds.to_xarray()
[7]:
<xarray.Dataset>
Dimensions:   (time: 45, x: 784, y: 565)
Coordinates:
  * x         (x) int64 0 1 2 3 4 5 6 7 8 ... 776 777 778 779 780 781 782 783
  * y         (y) int64 0 1 2 3 4 5 6 7 8 ... 557 558 559 560 561 562 563 564
    lon       (y, x) float64 -5.832 -5.822 -5.812 -5.802 ... 1.978 1.988 1.998
    lat       (y, x) float64 51.89 51.89 51.89 51.89 ... 46.25 46.25 46.25 46.25
  * time      (time) datetime64[ns] 2016-08-21T00:10:00 ... 2016-08-31T00:30:00
Data variables:
    rainfall  (time, y, x) int16 -1 -1 -1 -1 -1 -1 -1 -1 -1 ... 0 0 0 0 0 0 0 0

Ground station observations

[8]:
ds = cml.load_dataset("meteonet-samples-ground-stations", domain='SE')
[9]:
ds.to_pandas()
[9]:
number_sta lat lon height_sta date dd ff precip hu td t psl
0 1027003 45.83000 5.11000 196.0 2016-01-01 00:00:00 NaN NaN NaN 98.0 278.75 279.05 NaN
1 1033002 46.09000 5.81000 350.0 2016-01-01 00:00:00 0.0 0.0 0.0 99.0 278.25 278.35 NaN
2 1034004 45.77000 5.69000 330.0 2016-01-01 00:00:00 0.0 0.0 0.0 100.0 279.15 279.15 NaN
3 1072001 46.20000 5.29000 260.0 2016-01-01 00:00:00 NaN NaN 0.0 NaN NaN 276.55 NaN
4 1089001 45.98000 5.33000 252.0 2016-01-01 00:00:00 0.0 0.0 0.0 95.0 278.85 279.55 102720.0
... ... ... ... ... ... ... ... ... ... ... ... ...
111618 84085004 43.94000 5.23000 488.0 2016-01-01 23:54:00 100.0 2.0 0.0 94.0 280.05 280.95 NaN
111619 84086001 43.81000 5.15000 672.0 2016-01-01 23:54:00 140.0 7.6 0.0 93.0 279.65 280.75 NaN
111620 84087001 44.14000 4.86000 55.0 2016-01-01 23:54:00 130.0 5.0 0.0 76.0 281.25 285.35 101760.0
111621 84107002 44.04067 5.49283 836.0 2016-01-01 23:54:00 120.0 3.8 0.2 99.0 278.55 278.65 NaN
111622 84150001 44.34000 4.91000 141.0 2016-01-01 23:54:00 110.0 3.1 0.0 82.0 281.85 284.85 NaN

111623 rows × 12 columns

[10]:
cml.plot_map(ds)
../_images/examples_10-meteonet_13_0.png

Weather models

[11]:
ds = cml.load_dataset("meteonet-samples-weather-models", model='arome')
[12]:
ds.to_xarray()
[12]:
<xarray.Dataset>
Dimensions:            (heightAboveGround: 1, latitude: 227, longitude: 315, step: 25, time: 1)
Coordinates:
  * time               (time) datetime64[ns] 2018-05-01
  * step               (step) timedelta64[ns] 00:00:00 ... 1 days 00:00:00
  * heightAboveGround  (heightAboveGround) float64 2.0
  * latitude           (latitude) float64 51.9 51.87 51.85 ... 46.3 46.27 46.25
  * longitude          (longitude) float64 -5.842 -5.817 -5.792 ... 1.983 2.008
    valid_time         (time, step) datetime64[ns] dask.array<chunksize=(1, 25), meta=np.ndarray>
Data variables:
    t2m                (time, step, heightAboveGround, latitude, longitude) float32 dask.array<chunksize=(1, 25, 1, 227, 315), meta=np.ndarray>
    d2m                (time, step, heightAboveGround, latitude, longitude) float32 dask.array<chunksize=(1, 25, 1, 227, 315), meta=np.ndarray>
    r                  (time, step, heightAboveGround, latitude, longitude) float32 dask.array<chunksize=(1, 25, 1, 227, 315), meta=np.ndarray>
Attributes:
    GRIB_edition:            1
    GRIB_centre:             lfpw
    GRIB_centreDescription:  French Weather Service - Toulouse
    GRIB_subCentre:          0
    Conventions:             CF-1.7
    institution:             French Weather Service - Toulouse
    history:                 2021-06-07T10:39 GRIB to CDM+CF via cfgrib-0.9.9...
[13]:
ds = cml.load_dataset("meteonet-samples-weather-models", model='arpege', variable='P_sea_level')
[14]:
cml.plot_map(ds[0])
../_images/examples_10-meteonet_18_0.png

Masks

[15]:
ds = cml.load_dataset("meteonet-samples-masks", domain='SE')
[16]:
cml.plot_map(ds[0])
../_images/examples_10-meteonet_21_0.png
[17]:
cml.plot_map(ds[1])
../_images/examples_10-meteonet_22_0.png