Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Scroll pdf ignore
Panel
titleDownload
Expand
titleClick here for files to download...

Excerpt

Download the icons for this session from the link below. Create a sub-directory called training inside your Metview home directory, $HOME/metview, and save the .tar.gz file there. Then, from Metview, navigate to this folder and right-click on the tar.gz icon; choose Extract to uncompress the files into their folder. Work from there. The main instructions are written for participants of the Data analysis and visualisation using Metview training course at ECMWF. Any files to be copied from the file system will also be downloadable from this page.

Attachments
uploadfalse
oldfalse
patterns*.tar.gz,*.grib,*.grb
sortByname

 

Creating and Editing an Icon

This session uses the same t1000.grib data file as A Simple Visualisation; a copy of that file already exists in the folder for this This session follows on from A Simple Visualisation. We will work in the same folder, so make sure you have already downloaded the data and icons from that session.

Metview uses icons to control the various aspects of a plot's appearance. We will look at some of these now.

Creating and Editing an Icon

Image Removed

Let’s customise , starting with the coastline plotting attributes.

Image Added

First, create a new Coastlines icon. You can right-click within the Metview desktop to obtain a context menu from where the option Create new icon is available (shortcut: CTRL-N).

...

Edit the newly-created icon by either double-clicking on it or else right-click, edit (double-clicking an icon performs the edit action for most icon types). This brings up the icon editor for coastline plotting. All user-selectable parameters for plotting coastlines are here. Set the following parameters:

Map Coastline Thickness

2
Note: an undo button now appears beside this parameter

Map Coastline Land ShadeOn
Map Coastline Land Shade ColourCream

For colour-based parameters, there are two small arrows - the one on the right reveals a drop-down list of predefined colours (use this one); then one on the left reveals an advanced colour selection tool.

...

Your Coastlines icon can be dragged into any plot, and later we’ll see how to store useful icons so that they can be easily accessed from anywhere.

...

Changing the Map Projection and Storing the Area

Image Added

Metview's default map projection is Cylindrical. However, meteorologists often use other projections when plotting data.

Create a new Geographical View icon and rename it to polar_europe. Edit the icon and change the following parameter:

Map ProjectionPolar Stereographic

Save the changes and visualise the icon. Drop the GRIB data icon into the Display Window to see it on the new map. It is also possible to visualise the GRIB icon and then drop the Geographical View icon into the plot to achieve the same effect. Have a look at some of the other projections on offer, then go back to polar stereographic.

...

Use the Zoom tools to enlarge the European area and use the Area tool to select a region over Europe. Click Ok to save your selection - your choices will now be updated in the Geographical View editor. Click Apply in the Geographical View editor to save everything. Plot your data in this view to confirm that the area and projection are as desired.Image Removed

Linking the Coastlines icon with the Geographical View Icon

...

This says, "In the polar_europe view, plot data t1000". Your complete macro should look like this:

...

Now run the macro to generate the plot - either directly from the Macro Editor, or by right-clicking on the Macro icon and selecting execute.

Note that we can put a relative path into the read() command:

...

Metview provides many ways to style the contours when plotting data. These are controlled via the Contouring icon. This is another visdef icon. Create a new instance of this icon and rename it to shade. Edit it, setting the following parameters:

Contour Shade

On

Contour Shade Method

Area Fill

Contour Shade Max Level Colour

Red

Contour Shade Min Level Colour

Blue

Contour Shade Colour Direction

Clockwise

Apply the changes, visualise the data icon again (visualise t1000.grb) again and drag the shade icon into the Display Window.

...

Create a legend by changing the first parameter in the Contour editor and dragging the icon into the Display Window again:

Legend

On

Fixing the Contour Levels

Now zoom in and out of different areas. What happens to the palette - does it stay constant? The default behaviour is to create contours at 10 levels within the range of data actually plotted. As the area changes, so does the range of values being plotted.
Let's create a palette which will not be altered when we change the area. Copy the shade icon (either right-click + duplicate, or drag with the middle mouse button), and rename the copy 'fixed_t' by clicking on its title. Edit the icon and make the following changes:

Contour Level Selection Type

Level List

Contour Level List

-35/-20/-10/-5/0/5/10/20/35

Contour Shade Colour Direction

Clockwise

Now when you apply this icon you will see that the palette is fixed wherever you zoom. There will probably be parts of the plot which are not filled; this is because our range of contour levels does not cover the whole range of values in the data. Change the list of contour levels so that the whole plot will be covered - you only need to add one number to each end of the level list to do this (or else change the current numbers at the ends of the list).

Updating the Macro

Edit your macro icon again and drop the fixed_t icon into the editor, aiming the drop so that the code is generated above the plot() command. The code to generate the contouring specification will appear, assigned to the variable fixed_t (the variable is always named after the icon that was dropped). Add this to the end of the plot command:

...

We will now change these isolines to black. Create a new Contouring icon and rename it to black_contour. Edit it and set the following:

Contour Line Thickness2
Contour Line ColourBlack
Contour HighlightOff

Drop this into the Display Window - the result is not as intended! The new Contouring definition was applied to both fields, not just the geopotential. Close the Display Window and re-run the macro to get us back to the point before we added the geopotential. This time, select both the z500.grb and black_contour icons and drop them together into the Display Window. This forces the association between the data and the visual definition. You might want to remove the temperature isolines by setting Contour to Off in the macro.

Extra Work

Map projections

Create a new Geographical View icon (or make a copy of an existing one) and try out some of the different map projections.

Image Removed

Contouring

Spend some time exploring the Contouring icon. Here are some suggestions:

  • try different types of shading by setting Contour Shade Method and Contour Shade Technique. Also try turning off Contour so that only the shading is visible, with no isolines.
  • shade only the values which are below freezing point

Map projections

Create a new Geographical View icon (or make a copy of an existing one) and try out some of the different map projections.

Image Added

Coastlines

Spend some time exploring the Coastlines icon. Here are some suggestions:

...