Versions Compared

Key

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

...

Code Block
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='Static mapFire 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': '3.4_1',
            'dataset            'year': 'Intermediate dataset2020',
            'year            'month': '202007',
            'month            'day': '0701',
            'day            'grid': '010.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