Metview's documentation is now on readthedocs!

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

A Simple Data Visualisation

When you first start Metview, you will see something like this:

This sort of window is called a Metview desktop.

 

If doing this tutorial outside of the ECMWF training course, download all data files and icons by clicking here:

They should be saved into your $HOME/metview folder. In the Metview user interface you should see an icon representing the downloaded files, which are compressed into a tarball. Right-click the icon and choose execute to uncompress the files.

 

Copy a GRIB data file into your Metview directory (~/metview); if you are attending the training course at ECMWF, then you can instead type the following command in a terminal window:

 

cp ~trx/mv_data/t1000.grb ~/metview

 

 

You should now see a new GRIB icon in your Metview window:

 

Introduction

A fundamental concept in Metview is the View. A View specifies the following definitions in a Metview plot:

  • type of visualisation (e.g. geographical map, cross section, vertical profile)
  • parameters specific to that plot type (e.g. geographical area, cross section line, min/max axes values)
  • plot position within the page (several plots can share a page)
  • how to overlay different data in the same plot (covered later in this course)
  • how to draw the frame around the plot

Without a view specification, Metview would not plot anything; if you do not provide a view, then Metview will use a sensible default view.

 

One of Metview's most powerful features is its data processing ability. Data from various sources can be combined and manipulated using high- or low-level commands.

XXXX Download data

Fieldset Manipulation

A fieldset is a collection of fields stored physically in GRIB files. Metview has many built-in features to manipulate fieldsets, from simple arithmetic operators to vertical integrations through the atmosphere. The results can be stored on disk, or passed to other functions for further manipulation.

XXX diagram of how fieldset operations are done?

Computing a Forecast - Analysis Difference

XXXX

As a simple example, let's compute the difference between a set of forecast fields and the corresponding set of analysis fields for the same time step.

Have a look at the supplied GRIB files (right-click, examine) to confirm that temperature_forecast contains, at multiple vertical levels, 48-hour temperature forecasts for the same date and time as the analysis data in temperature_analysis.

Create a new Simple Formula icon and rename it to fc_an_diff. Edit the icon, ensure that the first tab is selected (F+G) and that the operator is minus ( - ). Drop your temperature_forecast GRIB icon into the Parameter 1 box, and drop temperature_analysis into the Parameter 2 box. Save the icon and execute it. The icon should turn green, indicating the result has been computed and cached. Further operations on this icon will not re-compute the result unless either of its input icons are modified. If you simply wanted the result to be stored, you could right-click and choose save result to bring up a file save dialogue, but instead choose visualise to plot it. Note that all 6 fields in each data icon are used in the computation - the result is a set of 6 fields. The solutions folder contains two Contouring icons which can be used to show the differences: select both pos_shade and neg_shade with the mouse and drop them both together into the Display Window. It is also possible to drop them one at a time, but they do not accumulate - one will replace the other. Edit the icons to see which parameters were used to create the positive and negative shading effects. There is also a Contouring icon called rainbow_diffs - this uses Metview's ability to draw isolines of different colours rather than using shading. This can be useful if it is important to see another layer underneath the temperature.

We could have done this a bit quicker - there was no need to execute the fc_an_diff icon. If you right-click the icon and choose clear result, you can now directly choose visualise - the execute action is performed in the background, as it is required before visualisation can occur.

Putting it into a Macro

Ensure that the difference fieldset is visualised with the contouring applied. One way to generate a Metview Macro script from this plot is to click the Generate Macro button (also available from the File menu). A new Macro script will be generated - have a look at it to confirm that it contains code to read the data, compute the difference and plot the result. Run the macro to obtain the plot, either by using the Run button from the Macro Editor, or by selecting visualise from the icon's context menu). By default, the macro is written so that it will produce an interactive plot window; it will generate a PostScript file if it is run with the execute command, or if it is run from the command line.

Notice how simple the computation of the field differences is:

 

fc_an_diff = temperature_forecast - temperature_analysis

 

The variables temperature_forecast and temperature_analysis are fieldset variables, coming, as they do, from GRIB data. Any operation on or between fieldsets is applied to every grid point in every field in the fieldset. Metview Macro has a large set of functions and operators on fieldsets.

 

  • No labels