Versions Compared

Key

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

...

# Metview Macro

#  **************************** LICENSE START ***********************************
# 
#  Copyright 20132012 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: mvlContour,Metview3,MARS
# Title: Split Contouring Metview 4
# Description: Demonstrates how to plot a line on any map emulate Metview 3's split
#              contouring facility using multiple Contouring
#              projectiondefinitions in Metview 4
# ---------------------------------------------------------------


# set up the shaded coastlines
land_sea_shade = mcoastdata = retrieve(param:'t', levelist: 1000, grid: [1.5,1.5])

split_below = mcont
(
    mapcontour_coastline_land_shade  line_style      : "ondash",
    mapcontour_coastline_land_shade_colourhighlight_style : "RGB(0.98,0.95,0.82)dash",
    mapcontour_coastline_sea_shade  max_level       : "on"0,
    mapcontour_coastline_sea_shade_colourlevel_count     : "RGB(0.85,0.93,1)"5
)

# define the geographic view
view = geoviewsplit_above = mcont
(
    mapcontour_line_projectioncolour      : "polar_stereographicred",
    mapcontour_areahighlight_definitioncolour : "cornersred",
    area contour_min_level               : [-5,-30,10,84],  # S,W,N,E: 0,
    coastlinescontour_level_count          : land_sea_shade5
)

#split_on create a geoline broken into 1-degree segments
line_increment_in_degrees = 1
geoline = mvl_geoline(-40, 57, 16, 59, line_increment_in_degrees)


# define the plotting attributes for the line
line_visdef = mgraph
(
    graph_line_colour= mcont
(
    contour_line_thickness : 3,
    contour_line_colour    : "black",
    contour_highlight      : "redoff",
    graphcontour_line_thicknessmax_level      : "4"0,
    graphcontour_linemin_stylelevel      : 'dash'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")    then setoutput(to_psfile)
else if  (mode = "batch")      then setoutput(to_psfile)
else if  (mode = "visualise")  then print('screen')
else     fail("Only execute, batch and visualise allowed")
end if



# plot the line on the map
plot(view, geoline, line_visdef(data, split_below, split_above, split_on)