Versions Compared

Key

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

Table of Contents

Introduction

The intention behind this page is not to advertise the new features of Metview 4 (see Version 4 Complete Change History for this), but to help users migrate existing plots and macros from Metview 3 to Metview 4. In general, icons and macros which do no plotting should require very little, if any, modification. Many icons and macros used to produce plots will likewise require little or no modification, but some will need to be updated. These changes, plus some other points of interest are briefly described on this page.

...

To make use of the new features of Magics, Metview 4 uses a new Contouring icon. One feature of Metview 3 which is not directly available in Metview 4 is Contour Splitting. This was a feature which enabled different isoline styles to be applied above, below and on a particular threshold (typically zero, for the purpose of examining the difference between two fields). To emulate this behaviour in Metview 4 requires either the use of the Rainbow contour settings, or the creation of three separate contour icons which can then be dropped together into the plot (or converted into three separate calls to mcont). See Migration: Split Contours for example Macro code and plots.

Automatic computation and plotting of isotachs is no longer supported in Magics. A small macro can be used to compute wind speed like this:

Code Block
speed = sqrt(u*u + v*v) # where u and v are field(set)s of u and v wind components
plot(speed)

...

In Macro, pcont is replaced by mcont.

...

Metview 3 had an Empty View icon for reserving a blank area of a page. It also had a Text View, into which Annotation icons could be dropped. Metview 4 (from version 4.4 onwards) simplifies these functionalities by introducing a single view, the Annotation View, into which Text Plotting icons can be dropped. The Import View functionality will be available in the Annotation View in the future. An Empty View can be simulated by simply having an Annotation View with nothing in it. This means that the Empty View, Text View, Import View and Annotation icons from Metview 3 are no longer supported.Image Removed

Curve Plotting

...

In Metview 4, the default behaviour is to always overlay fields from different sources, even if their meta-data, such as date/time, do not match. This is different from Metview 3, whose default behaviour was to only overlay data whose timestamps 'match'. In Metview 3, there was a separate icon, the Overlay Control icon, which could be dropped into a View icon to change the overlay settings. In Metview 4 this is simpler, with a Map Overlay Control parameter directly in the Geographical View icon.

Cross Section Data, Average Data, Hovmoeller Data

These icons are currently restricted to returning a single frame (Metview 3 could, for instance, return a set of cross sections if there were multiple parameters or times in the input data). This feature is in the process of being implemented, and further documentation is available specifically for the 4.4 release of Metview, which contains further small revisions to the interface. See New Cross Section, Average, Vertical Profile and Hovmoeller modules in Metview 4.4.

Display Window Contents

The Display Window's Contents Drawer was an advanced feature which enabled the quick fine-tuning of a plot. This feature is not currently enabled in Metview 4, although it is planned to be in the future.

Macro

Metview's macro language now handles missing values in its data in a more consistent and useful way. Previously, functions such as integrate() returned a 'missing value indicator' if all its input values were missing. This was not easy to test for, and computations could use the result incorrectly without realising it. Now, all such functions return a nil variable when their inputs are invalid. Macros which do not test for this condition will fail if they try to use a nil variable in a computation. Example code:

See Data Overlay for more information.

Layer Ordering and Drawing Priority

Metview 3 used the Drawing Priority rules to determine which layers appeared on top of others (e.g. wind flags on top of shaded contouring). This was true even in the Macro plot() command, so that the order in which the layers were specified was not necessarily the order in which they were drawn. In Metview 4, the intention is that the plot() command honours the order in which the layers are specified, ignoring the old Drawing Priority rules - the first data layer supplied will appear as the bottom layer of the plot, etc. This is the case when using the new visdefs such as mcont and mwind, but when using the old ones such as pcont and pwind, the old Drawing Priority rules are applied as they were in Metview 3, allowing some backwards compatibility. This separation of behaviour breaks down when old and new visdefs are mixed in a single plot() command, e.g. plot(t_data, pcont_def, wind_data, mwind_def). In this case, the two behaviours clash and the results might not be as desired. It is best to convert old visdefs to their new equivalents, and use the order in which they appear in the plot() command to determine the order in which they are rendered.

Cross Section Data, Average Data, Hovmoeller Data

These icons are currently restricted to returning a single frame (Metview 3 could, for instance, return a set of cross sections if there were multiple parameters or times in the input data). This feature is in the process of being implemented, and further documentation is available specifically for the 4.4 release of Metview, which contains further small revisions to the interface. See New Cross Section, Average, Vertical Profile and Hovmoeller modules in Metview 4.4.

Display Window Contents

The Display Window's Contents Drawer was an advanced feature which enabled the quick fine-tuning of a plot. This feature is not currently enabled in Metview 4, although it is planned to be in the future.

Macro

Metview's macro language now handles missing values in its data in a more consistent and useful way. Previously, functions such as integrate() returned a 'missing value indicator' if all its input values were missing. This was not easy to test for, and computations could use the result incorrectly without realising it. Now, all such functions return a nil variable when their inputs are invalid. Macros which do not test for this condition will fail if they try to use a nil variable in a computation. Example code:

  a = integrate(data)  a = integrate(data)
  if (a = nil) then
    fail ('Integration failed')
  end if

Another change in Macro is the expansion of the vector data type (see Vectors). Many Macro functions which previously returned lists of numbers will now return a vector (which is more efficient). This should mostly be transparent, since accessing a vector's elements is the same as for a list. However, user functions which explicitly test whether the returned variable is a list should be revised. See List of Operators and Functionssee Vectors). Many Macro functions which previously returned lists of numbers will now return a vector (which is more efficient). This should mostly be transparent, since accessing a vector's elements is the same as for a list. However, user functions which explicitly test whether the returned variable is a list should be revised. See List of Operators and Functions.

Inline Fortran/C in Macro

Even within Metview 3, the GRIB_API-based inline Fortran/C routines (the 'MFI' routines) were available and preferred over the 'legacy' GRIBEX-based routines. Recent versions of Metview 4 have used newer versions of emoslib, which do not have GRIBEX support. It is thus now necessary to use the 'MFI' routines to pass parameters between Macro and inline C/Fortran. See Articles and find the PDF link at the top of the page for details on these interface routines.

Output Formats in Macro

Instead of a single output function, Metview 4 uses a set of functions to specify the desired output format, one for each type: ps_output, png_output, etc. It is possible to supply more than one of these to the setoutput() or the plot() commands. in order to obtain multiple formats in one go. One way to see the possible parameters for these functions is to type the appropriate function name in the Macro Editor and press F5 for an interactive help tool.

...