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 6 Next »

Things to document:

  • pgraph -> mgraph
  • ptext->mtext
    new projections
  • axis plotting

Introduction

The intention behind this page is not to advertise the new features of Metview, 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.

System Settings, Macro libraries and Defaults

With the aim of allowing Metview 3 and Metview 4 to be run side-by-side, Metview 4 stores the system settings in a different folder. Everything which was previously stored in the ~/metview/Metview folder is now stored in ~/metview/System. This includes default icons, icon templates, the contents of icon drawers and Metview preferences. These will be initially set to the new defaults, so any icon drawers or defaults you have created yourself will not be there (although you can still copy your old icons across to the new folders). Note that any macros in your Macros folder will not be automatically copied over - these can be copied by hand.

Metview 3 icons greyed out

One of the aims of Metview 4 is to utilise the new features of Magics++. This requires some icons to be updated, specifically the visual definition icons such as Contouring and Coastlines. In order not to interfere with Metview 3's existing icons, Metview 4 defines a new set. These icons look the same as the old ones, but have some different parameters available. Metview 3's icons continue to work as normal (with some possible changes in behaviour), but they will appear slightly greyed out. The following screenshot shows this difference.

mv3-and-mv4-contour-icons.png

Metview 4 will not allow you to directly create new instances of the 'old' icons, but you will find the new ones in the desktop drawers and in the New Icon desktop menu.

From the point of view of macros, these icons have different icon-function names with the 'p' prefix replaced with an 'm'; instead of pcoast, we have mcoast, etc.

Although your old icons will still work in Metview 4, you may wish to convert some of them to the new formats in order to use the new parameters available. As an example, suppose you have a Contouring icon from Metview 3 which you wish to convert into a Metview 4 Contouring icon. In Metview 4, first create a new contour icon. Edit this icon, and drop your old icon into the icon editor. The parameters which are valid in the new icon will be transferred; you can now click Apply to save the new icon.

Contouring

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 the creation of three separate contour icons which can then be dropped together into the plot (or converted into three separate calls to mcont). The following code examples show a default split contour definition in Metview 3 alongside the equivalent code in Metview 4.

  

split = pcont
(
    contour_line_plotting: "split"
)

plot (data, split)

 

 

split_below = mcont
(
    contour_line_style      : "dash",
    contour_highlight_style : "dash",
    contour_max_level       : 0,
    contour_level_count     : 5
)

split_above = mcont
(
    contour_line_colour      : "red",
    contour_highlight_colour : "red",
    contour_min_level        : 0,
    contour_level_count      : 5
)

split_on = mcont
(
    contour_line_thickness : 3,
    contour_line_colour    : "black",
    contour_highlight      : "off",
    contour_max_level      : 0,
    contour_min_level      : 0
)

plot (data, split_below, split_above, split_on)

 

In Macro, pcont is replaced by mcont.

Coastlines

Metview 4's Coastlines icon has many more features than in Metview 3. One important thing to note is that in Metview 4 the coastline resolution has a much greater impact on the plot; a full-globe map with high resolution coastlines will be much too detailed, will take a long time to plot and will produce a very large (vector format) output file. The default resolution setting, Automatic, is intended to provide a reasonable balance between detail and efficiency. In Macro, pcoast is replaced by mcoast.

Map View

Metview's Map View has been replaced by Geo View, allowing access to the new projections of Metview 4. Note that there is now a new parameter with which you must specify whether you wish a global or non-global area.

Legends

Metview 4 has a new icon for handling legends - the Legend icon in the Visual Definitions drawer. This replaces the functionality that used to be in the Text Plotting and Legend Entry icons.

Curve Plotting

This is perhaps the area which has experienced the greatest change. Curve plotting is now achieved via one of the Visualiser icons. The Curve View is replaced by the more general-purpose Cartesian View. There is a Macro example which shows, side by side, Metview 3 and 4 code for plotting curves - Migration: Curve Plotting.

Symbol Plotting

The new Symbol Plotting icon provides access to a particularly useful feature of Magics - Advanced symbol plotting mode. This allows the automatic creation of colour scales in much the same way as is available for contouring. In Macro, psymb is replaced by msymb.

Vectors

Metview 3 had a Vectors icon which was used for combining two scalar fields and plotting them as a vector pair. It also allowed the use of a third field for the purpose of colouring the vector arrows. This functionality is now in a new icon, Grib Vectors.

ODB

Metview 4 completely revised its handling of ODB data and does not recognise any Metview 3 ODB icons. Consequently, such icons will not be visible in Metview 4. However, all the ODB functionality of Metview 3, plus a lot more, is available in Metview 4. Please see the Tutorials page for the ODB tutorial.

Overlay

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. The Overlay icon allows the configuration of this behaviour.

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.

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.

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

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

 

  • No labels