Versions Compared

Key

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

...

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 Geographic 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.

Linking the Coastlines icon with the Geographic View Icon

XXX

Creating a Simple Macro

Metview incorporates a powerful Macro language, which can be used for tasks ranging from simple automation of tasks to complex post-processing of data. We will now create a simple macro which reads the GRIB file and plots it in our chosen projection.

Create a new Macro icon and edit it. This time we see a code editor, custom-built for the Macro language. The editor can automatically translate Metview icons into Macro code, so do the following:

  • drop the t1000.grb icon into the Macro Editor; a variable called XXX is assigned to the value of the read() command, which reads the GRIB data
  • rename the variable to simply t1000
  • drop your polar_europe icon into the Macro Editor
  • underneath the generated code, type the following line:
Code Block
plot(polar_europe, t1000)

This says, "In the polar_europe view, plot data t1000".

Your complete macro should look like this:

Code Block
XXXX

Now run the macro to generate the plot.

Modifying Layers

Now look at the Layers tab again. Drag the shaded Coastlines layer so that it is above the t1000.grb layer – a quick way to mask out the sea points! Imagine looking down through the layers from the top to the bottom in order to understand how they work. You can also select the Coastlines layer and change its transparency value. You can also toggle layers on and off using the checkboxes next to them. Note that these adjustments are not carried through to the various export image formats (see later).

...

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:

Code Block
plot(polar_europe, t1000, fixed_t)

Visual definition variables must appear just after the data variables to which they are to be applied.

Modifying a Default Icon

...