Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To harness the power of the CDS, users are invited to familiarise with the CDS Toolbox. This is an interactive environment that allows to process and plot data without necessarily downloading them. This is particularly useful for users with limited bandwidth and/or unstable connections. The toolbox is designed to develop python applications that can be shared with other users, hence streamlining collaborative research and development. The script below can be pasted in the toolbox editor to generate a static map of the Fire Weather Index (as they are shown in the EFFIS and GWIS platform) that can be exported and used for reports and publications. 

Image Added

Code Block
languagepy
titleExample Plotting FWI from Reanalysis in CDS Toolbox
collapsetrue
import cdstoolbox as ct
# Magics plot configuration dictionary
MAP_CONFIG = {    
    'contour': {
        'contour_level_selection_type': 'level_list',
        'contour_level_list': [0, 5.2, 11.2, 21.3, 38, 50, 150],
        'contour_shade': 'on',
        'contour_label': 'off',
        'contour_shade_method': 'area_fill',
        'contour_shade_colour_method': 'list',
        'contour_shade_colour_list': ['#84F07F', '#FFEB3C', '#FFB00C',
                                      '#FA4F00', '#B40000', '#280923'],
        'contour': 'off',
        'legend': 'on',
    },
    'legend': {
        'legend_text_colour': 'black',
        'legend_text_font_size': 0.4,
        'legend_display_type':'continuous',
    }
}
# Initialise the application
@ct.application(title='Fire Weather Index 2020-07-01', fullscreen=True)
@ct.output.figure()
def application():
    # Retrieve full resolution FWI data for a single date
    data = ct.catalogue.retrieve(
        'cems-fire-historical-v1',
        {
            'product_type': 'reanalysis',
            'variable': 'fire_weather_index',
            'dataset_type': 'consolidated_dataset',
            'system_version': '4_1',
            'year': '2020',
            'month': '07',
            'day': '01',
            'grid': '0.5/0.5',
        }
    )
    # Plot the data using the defined configuration MAP_CONFIG on a dynamic map
    plot = ct.map.plot(data, **MAP_CONFIG)
     
    return plot

...