eccharts

../../_images/ECCHARTS.png

Generates data to recreate the plot layers of the ecCharts web-based visualisation system in the Metview environment performing the following steps:

  1. retrieves global forecast fields for a given ecCharts layer from the MARS archive

  2. applies the required post-processing steps on the data

  3. defines the visualisation using one of the pre-defined ecCharts styles available for the layer.

eccharts() returns a list that can be directly passed onto plot() to generate a plot. This list contains the following items:

  1. the GRIB fields (Fieldset) retrieved from MARS then post-processed

  2. a plot title definition (mtext())

  3. a contouring definition (mcont()) using the specified pre-defined style associated with the layer

  4. a legend definition (mlegend())

The second item in this list is optional and only included if title is set to “style_1”.

Note

This function performs the same task as the Eccharts icon in Metview’s user interface. It accepts its parameters as keyword arguments, described below.

eccharts(**kwargs)

Generates data to recreate the plot layers of the ecCharts web-based visualisation system in the Metview environment.

Parameters
  • layer (str) – Specifies the name of the ecCharts layer.

  • style (str) –

    Specifies a named contouring style for the selected layer. Each ecCharts layer is associated with a group of predefined styles and if this parameter is left empty the default style will be assigned to layer.

    Note

    In the user interface the ecCharts icon editor contains a style browser. When a given layer is selected the style browser only shows the available styles for that layer with the default style automatically selected.

  • title ({"default", "style_1"}, default: "default") –

    Specifies the type of the title generated for the plot. The possible values are as follows:

    • ”default”: the automatic Metview title will be used and the returned list will not contain an mtext() object

    • ”style_1”: the returned list will contain an mtext() object defining a title with a different style.

    When overlaying an eccharts() object with other objects always use the “default” option, otherwise the contouring setting will be applied incorrectly to some of the fields.

  • expver (str, default: "1") –

  • date (number, default: -1) – Specifies the run date of the forecast in YYYYMMDD format. This is the same date parameter as in the MARS retrieval icon. Relative dates are allowed: e.g. -1 means yesterday, 0 means today, etc.

  • time (number, default: 0) – Specifies the run time of the forecast. This is the same time parameter as in the MARS retrieval icon.

  • step (number or list[number], default: 0) – Specifies the forecast steps in hours. Here a list of values can be given.

  • interval ({3, 6, 9, 12, 24, 48, 72}, default: 3) –

  • quantile (number or list[number]) –

  • grid (list[number], default: [1, 1]) – Specifies the resolution of the resulting global grid in [dx, dy] format, where dx is the grid increment in West-East direction, while dy is the grid increment in South-North direction (both in units of degrees).

  • fail_on_data_error ({"yes", "no"}, default: "yes") – When this parameter is set to “yes” an error in the data retrieval or the post-processing steps will force the icon to fail and a Python script running eccharts() will fail as well. When if it is set to “no” the icon will not fail and eccharts() will return None.

Return type

list