Dear C3S users,
I am quite new to the CDS Toolbox and C3S climate data sets and encountered a problem with the data set Extreme precipitation risk indicators for Europe and European cities from 1950 to 2019. The documentation says that, at least from the provided figure, its possible to map extreme precipitation events for a specific day e.g. 2002/08/11. However, the toolbox request only contains years instead of a specific date and entering dates in the formats "yyyy/mm/dd", "yyyy-mm-dd" etc. leads to a key error.
In the following I provide my code from so you can have a reference what exactly I tried to do:
import cdstoolbox as ct
years = {
'2001':'2001', '2003':'2003', '2005':'2005', '2007':'2007', '2009':'2009',
'2011':'2011', '2013':'2013', '2015':'2015', '2017':'2017',} # '2019':'2019',
@ct.application(title='Plot Map')
@ct.input.dropdown('year', label='year', values=years.keys())
@ct.output.figure()
def plot_map(year):
"""
Application main steps:
- set the application layout with output at the bottom
- select a variable name from a list in the dropdown menu
- retrieve the selected variable
- compose a title
- show the result on a map using the chosen title
"""
data = ct.catalogue.retrieve(
'sis-european-risk-extreme-precipitation-indicators',
{
'spatial_coverage': 'europe',
'variable': 'standardised_precipitation_exceeding_fixed_percentiles',
'percentile': '95th',
'product_type': 'e_obs',
'temporal_aggregation': 'daily',
'period': year,
'area': [58., 3., 45., 20.],
})
title = '{}'.format(' '.join([text.capitalize() for text in year.split('_')]))
fig = ct.map.plot(data, title=title, projection="dynamic")
return fig
I would be very glad if someone could give me any type of hint how to modify my request and plotting procedure in order to reproduce the given figure and to be actually able to use the daily temporal aggregation key:
'temporal_aggregation': 'daily'
I wish you a pleasant week and thanks in advance for your help!
Kind regards,
Philipp