{ "cells": [ { "cell_type": "markdown", "id": "0", "metadata": {}, "source": [ "# Computing indices on weather forecasts\n", "\n", "The PAVICS data catalog includes the latest weather forecast from the Global Ensemble Prediction System ([GEPS](https://eccc-msc.github.io/open-data/msc-data/nwp_geps/readme_geps_en/)) from Environment and Climate Change Canada. For the 20 members in the ensemble, two variables are available (precipitation and air temperature), every 3 hours for the first 8 days of the forecast, then every 6 hours for the following 8 days. \n", "\n", "This notebook shows how to access the forecast data and compute climate indices using xclim. The first step is to open the catalog and get the URL to the data. " ] }, { "cell_type": "code", "execution_count": 1, "id": "1", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | license_type | \n", "title | \n", "institution | \n", "member | \n", "variable_name | \n", "variable_long_name | \n", "path | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "permissive | \n", "Global Ensemble Prediction System (GEPS) - ECCC | \n", "Canadian Meteorological Service - Montreal | \n", "NaN | \n", "['pr', 'tas', 'member'] | \n", "['depth of water-equivalent precipitation', '2... | \n", "https://pavics.ouranos.ca/twitcher/ows/proxy/t... | \n", "
<xarray.Dataset>\n", "Dimensions: (lon: 720, lat: 361, time: 97, member: 20)\n", "Coordinates:\n", " * lon (lon) float64 0.0 0.5 1.0 1.5 2.0 ... 357.5 358.0 358.5 359.0 359.5\n", " * lat (lat) float64 -90.0 -89.5 -89.0 -88.5 -88.0 ... 88.5 89.0 89.5 90.0\n", " reftime datetime64[ns] 2022-01-13\n", " * time (time) datetime64[ns] 2022-01-13 2022-01-13T03:00:00 ... 2022-01-29\n", " * member (member) float32 1.0 2.0 3.0 4.0 5.0 ... 16.0 17.0 18.0 19.0 20.0\n", "Data variables:\n", " pr (member, time, lat, lon) float32 ...\n", " tas (member, time, lat, lon) float32 ...\n", "Attributes: (12/14)\n", " GRIB_edition: 2\n", " GRIB_centre: cwao\n", " GRIB_centreDescription: Canadian Meteorological Service - Montreal \n", " GRIB_subCentre: 0\n", " Conventions: CF-1.7\n", " institution: Canadian Meteorological Service - Montreal \n", " ... ...\n", " abstract: Global ensemble forecasts are made twice a day u...\n", " dataset_description: https://weather.gc.ca/grib/grib2_ens_geps_e.html\n", " dataset_id: GEPS\n", " type: forecast\n", " license_type: permissive\n", " license: https://open.canada.ca/en/open-government-licenc...
array([ 0. , 0.5, 1. , ..., 358.5, 359. , 359.5])
array([-90. , -89.5, -89. , ..., 89. , 89.5, 90. ])
array('2022-01-13T00:00:00.000000000', dtype='datetime64[ns]')
array(['2022-01-13T00:00:00.000000000', '2022-01-13T03:00:00.000000000',\n", " '2022-01-13T06:00:00.000000000', '2022-01-13T09:00:00.000000000',\n", " '2022-01-13T12:00:00.000000000', '2022-01-13T15:00:00.000000000',\n", " '2022-01-13T18:00:00.000000000', '2022-01-13T21:00:00.000000000',\n", " '2022-01-14T00:00:00.000000000', '2022-01-14T03:00:00.000000000',\n", " '2022-01-14T06:00:00.000000000', '2022-01-14T09:00:00.000000000',\n", " '2022-01-14T12:00:00.000000000', '2022-01-14T15:00:00.000000000',\n", " '2022-01-14T18:00:00.000000000', '2022-01-14T21:00:00.000000000',\n", " '2022-01-15T00:00:00.000000000', '2022-01-15T03:00:00.000000000',\n", " '2022-01-15T06:00:00.000000000', '2022-01-15T09:00:00.000000000',\n", " '2022-01-15T12:00:00.000000000', '2022-01-15T15:00:00.000000000',\n", " '2022-01-15T18:00:00.000000000', '2022-01-15T21:00:00.000000000',\n", " '2022-01-16T00:00:00.000000000', '2022-01-16T03:00:00.000000000',\n", " '2022-01-16T06:00:00.000000000', '2022-01-16T09:00:00.000000000',\n", " '2022-01-16T12:00:00.000000000', '2022-01-16T15:00:00.000000000',\n", " '2022-01-16T18:00:00.000000000', '2022-01-16T21:00:00.000000000',\n", " '2022-01-17T00:00:00.000000000', '2022-01-17T03:00:00.000000000',\n", " '2022-01-17T06:00:00.000000000', '2022-01-17T09:00:00.000000000',\n", " '2022-01-17T12:00:00.000000000', '2022-01-17T15:00:00.000000000',\n", " '2022-01-17T18:00:00.000000000', '2022-01-17T21:00:00.000000000',\n", " '2022-01-18T00:00:00.000000000', '2022-01-18T03:00:00.000000000',\n", " '2022-01-18T06:00:00.000000000', '2022-01-18T09:00:00.000000000',\n", " '2022-01-18T12:00:00.000000000', '2022-01-18T15:00:00.000000000',\n", " '2022-01-18T18:00:00.000000000', '2022-01-18T21:00:00.000000000',\n", " '2022-01-19T00:00:00.000000000', '2022-01-19T03:00:00.000000000',\n", " '2022-01-19T06:00:00.000000000', '2022-01-19T09:00:00.000000000',\n", " '2022-01-19T12:00:00.000000000', '2022-01-19T15:00:00.000000000',\n", " '2022-01-19T18:00:00.000000000', '2022-01-19T21:00:00.000000000',\n", " '2022-01-20T00:00:00.000000000', '2022-01-20T03:00:00.000000000',\n", " '2022-01-20T06:00:00.000000000', '2022-01-20T09:00:00.000000000',\n", " '2022-01-20T12:00:00.000000000', '2022-01-20T15:00:00.000000000',\n", " '2022-01-20T18:00:00.000000000', '2022-01-20T21:00:00.000000000',\n", " '2022-01-21T00:00:00.000000000', '2022-01-21T06:00:00.000000000',\n", " '2022-01-21T12:00:00.000000000', '2022-01-21T18:00:00.000000000',\n", " '2022-01-22T00:00:00.000000000', '2022-01-22T06:00:00.000000000',\n", " '2022-01-22T12:00:00.000000000', '2022-01-22T18:00:00.000000000',\n", " '2022-01-23T00:00:00.000000000', '2022-01-23T06:00:00.000000000',\n", " '2022-01-23T12:00:00.000000000', '2022-01-23T18:00:00.000000000',\n", " '2022-01-24T00:00:00.000000000', '2022-01-24T06:00:00.000000000',\n", " '2022-01-24T12:00:00.000000000', '2022-01-24T18:00:00.000000000',\n", " '2022-01-25T00:00:00.000000000', '2022-01-25T06:00:00.000000000',\n", " '2022-01-25T12:00:00.000000000', '2022-01-25T18:00:00.000000000',\n", " '2022-01-26T00:00:00.000000000', '2022-01-26T06:00:00.000000000',\n", " '2022-01-26T12:00:00.000000000', '2022-01-26T18:00:00.000000000',\n", " '2022-01-27T00:00:00.000000000', '2022-01-27T06:00:00.000000000',\n", " '2022-01-27T12:00:00.000000000', '2022-01-27T18:00:00.000000000',\n", " '2022-01-28T00:00:00.000000000', '2022-01-28T06:00:00.000000000',\n", " '2022-01-28T12:00:00.000000000', '2022-01-28T18:00:00.000000000',\n", " '2022-01-29T00:00:00.000000000'], dtype='datetime64[ns]')
array([ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14.,\n", " 15., 16., 17., 18., 19., 20.], dtype=float32)
[504244800 values with dtype=float32]
[504244800 values with dtype=float32]