...
Section |
---|
Column |
---|
| ![](/download/thumbnails/118822740/image2018-9-20_11-33-49.png?version=1&modificationDate=1537443229207&api=v2)
|
Column |
---|
With this icon we can recreate the layers of the ecCharts web-based visualisation system in the Metview environment. The icon retrieves global forecast fields for a given ecCharts layer from the MARS archive then applies the required post-processing steps and visualises the results with one of the pre-defined ecCharts styles. For help on editing icons, please see Editing Icons. Info |
---|
From script (Macro/Python) this icon can be called as eccharts() . |
Please note that the output of the icon is not a single GRIB file but a list of the following items in the specified order: - the GRIB fields retrieved from MARS
- a plot title definition (see Text plotting icon)
- a contouring definition (see Contouring icon) using the specified pre-defined style associated with the layer
- a legend (see Legend icon) definition
The second item in this list is optional and only included if Title is set to style_1 in the EcCharts icon. Saving GRIB dataTo save a local copy of the retrieved GRIB data use the Save result action from the icon context menu.
Generating script code
The icon is equipped with the Generate Macro and Generate Python context menu actions. ![](/download/attachments/118822740/image2018-11-28_11-58-28.png?version=1&modificationDate=1543406308707&api=v2)
With these actions the actual retrieval, post-processing and visualisation steps can be saved into the specified script format (the generated script will appear in the current folder). As This is an example please see here showing the Macro code generated for layer t925.
Code Block |
---|
| # Metview Macro
# **************************** LICENSE START ***********************************
#
# Copyright 2018 ECMWF. This software is distributed under the terms
# of the Apache License version 2.0. In applying this license, ECMWF does not
# waive the privileges and immunities granted to it by virtue of its status as
# an Intergovernmental Organization or submit itself to any jurisdiction.
#
# ***************************** LICENSE END ************************************
#
# Retrieve data from MARS
data = retrieve(
class : 'od',
levelist : 925,
levtype : 'pl',
param : '130.128',
stream : 'oper',
type : 'fc',
date : '20181127',
time : '0000',
grid : [1,1],
step : '24',
expver : '1')
# Define title
title = mtext(
text_line_1 : "925 hPa temperature START: <grib_info key='base-date' format='%d.%m.%Y. %H' where='shortName=t' /> UTC STEP: <grib_info key='step' where='shortName=t' />h VALID FOR = <grib_info key='valid-date' format='%d.%m.%Y. %H' where='shortName=t' /> UTC",
text_colour : "charcoal")
# Define contouring
cont = mcont(
contour_automatic_setting : "style_name",
contour_style_name : "sh_all_fM52t48i4",
legend : "on")
# Define legend
legend = mlegend(
legend_text_colour : "charcoal")
# Generate plot
plot(data, title, cont, legend)
|
What layers are available?
A fair number of ecCharts layers are available but several layers are not yet added to the icon. To figure out more about the supported layers use the layer browser in the icon editor as shown below:
![](/download/attachments/118822740/image2018-11-28_12-3-58.png?version=1&modificationDate=1543406638276&api=v2)
|
|
...
Specifies the contouring style for the selected layer. Each ecCharts layer is associated with a group of predefined styles. When a given layer is selected in Layer the icon editor only shows the available styles for that layer and the default style is automatically selected.
Title
Specifies the type of the title generated for the plot. The possible values are as follows:
- default: the standard Metview automatic title will be used and the resulting list will not contain a Text plotting icon. This is how it looks:
Image Added
- style_1: the resulting list will contain a Text plotting icon defining a title of a different style. This is how it looks:
Image Added
The default option is default.
Note |
---|
When overlaying an EcCharts icon with other EcCharts icons or fields always use the default option (otherwise the contouring setting could be applied incorrectly to some of the fields). |
This option was introduced in Metview 5.8.0.
Date
Specifies the run date of the forecast. This is the same Date parameter as in the MARS retrieval icon. The date is given in YYYYMMDD
format. Relative dates are allowed: e.g. -1 means yesterday, 0 means today, etc. The default is -1.
...
Specifies the run time of the forecast. This is the same Date Time parameter as in the MARS retrieval icon. The default is 0.
...
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 Macro/Python script running the eccharts
command ()
function will fail as well. While if it is set to no the icon will not fail and the eccharts
command in Macro/Python will return nil/None. The default value is yes.
...