Metview's documentation is now on readthedocs!

For more information, see Migrating from Metview 3 to Metview 4.

There are two ways that the Split Contour functionality of Metview 3 can be emulated (or improved upon) in Metview 4.

The first is to use three contour definitions instead of one, as shown in this comparison below.

 

Metview 3 code

# Metview Macro

# **************************** LICENSE START ***********************************
#
# Copyright 2012 ECMWF. This software is distributed under the terms
# of the Apache License version 2.0. In applying this license, ECMWF does not
# waive the privileges and immunities granted to it by virtue of its status as
# an Intergovernmental Organization or submit itself to any jurisdiction.
#
# ***************************** LICENSE END ************************************

# NOTE: THIS EXAMPLE EXISTS FOR THE COMPARISON OF METVIEW 3 AND METVIEW 4
# FEATURES, AND SHOULD NOT BE USED AS A TEMPLATE FOR METVIEW 4 CODE.

# ---------------------------------------------------------------
# Tags: Contour,Metview3,MARS
# Title: Split Contouring Metview 3
# Description: Demonstrates Metview 3's split contouring facility
# ---------------------------------------------------------------


data = retrieve(param:'t', levelist: 1000, grid: [1.5,1.5], date: -10)

split = pcont
(
    contour_line_plotting: "split"
)



# Define the output media

to_psfile = output
(
    format       : "postscript",
    destination  : "file",
    ncopies      : 1,
    file_name    : "plot.ps"
)


# Check the runmode and decide which media to putput the plot to
    
mode = runmode()
if  mode = "execute" or mode = "batch" then setoutput(to_psfile)
else                                        setoutput(to_screen)
end if


dw = plot_superpage ()
plot (dw, data, split)

Metview 4 code

# Metview Macro

# **************************** LICENSE START ***********************************
#
# Copyright 2015 ECMWF. This software is distributed under the terms
# of the Apache License version 2.0. In applying this license, ECMWF does not
# waive the privileges and immunities granted to it by virtue of its status as
# an Intergovernmental Organization or submit itself to any jurisdiction.
#
# ***************************** LICENSE END ************************************

# ---------------------------------------------------------------
# Tags: Contour,Metview3,MARS
# Title: Split Contouring Metview 4
# Description: Demonstrates how to emulate Metview 3's split
#              contouring facility using multiple Contouring
#              definitions in Metview 4
# ---------------------------------------------------------------

data = retrieve(param:'t', levelist: 1000, grid: [1.5,1.5], date: -10)

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
)

# Define the output media

to_psfile = ps_output
(
    output_name : "plot" # extension is added automatically
)


# Check the runmode and decide which media to putput the plot to
    
mode = runmode()
if  mode = "execute" or mode = "batch" then
    setoutput(to_psfile)
end if


plot (data, split_below, split_above, split_on)

The second method is to use the Rainbow Contouring method to do something similar in a single Contouring icon as shown in the example below. Note that this example has more sophistication in the colours than the Split Contouring in Metview 3. To get the old behaviour, contour_line_colour_rainbow_colour_list can be set to ['blue', 'blue', 'blue', 'black', 'red', 'red', 'red'].

Unable to render {include} The included page could not be found.