Metview's documentation is now on readthedocs!

Download source and data


SST on Extended Cylindrical Map Example
#Metview Macro

#  **************************** LICENSE START ***********************************
# 
#  Copyright 2019 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 ************************************
# 

# read GRIB
sst = read("sst.grib")

# define contouring
cont = mcont(
    contour_automatic_setting : "ecmwf",
    legend                    : "on"
    )

# define land-sea shading
coast = mcoast(
    map_coastline_land_shade        : "on",
    map_coastline_land_shade_colour : "RGB(0.16,0.16,0.16)",
    map_coastline_sea_shade         : "on",
    map_coastline_sea_shade_colour  : "RGB(0.4686,0.4686,0.4686)",
    map_coastline_colour            : "RGB(0.6686,0.6686,0.6686)",
    map_grid_colour                 : "RGB(0.2686,0.2686,0.2686)",
    map_grid_longitude_increment    : 30,  
    map_grid_latitude_increment     : 20  
    )

    
# define the view - recentred and lon range is larger than 360!
view = geoview(
		map_area_definition	:	"corners",
		area	:	[-90,20,90,420],
		coastlines: coast
	)
	
# define the output plot file
setoutput(pdf_output(output_name : 'sst_extended_latlon'))
	
# generate plot	
plot(view, sst, cont)	
SST on Extended Cylindrical Map Example
#  **************************** LICENSE START ***********************************
# 
#  Copyright 2019 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 ************************************
# 

import metview as mv

# read GRIB
sst = mv.read("sst.grib")

# define contouring
cont = mv.mcont(
    contour_automatic_setting = "ecmwf",
    legend                    = "on"
    )

# define land-sea shading
coast = mv.mcoast(
    map_coastline_land_shade        = "on",
    map_coastline_land_shade_colour = "RGB(0.16,0.16,0.16)",
    map_coastline_sea_shade         = "on",
    map_coastline_sea_shade_colour  = "RGB(0.4686,0.4686,0.4686)",
    map_coastline_colour            = "RGB(0.6686,0.6686,0.6686)",
    map_grid_colour                 = "RGB(0.2686,0.2686,0.2686)",
    map_grid_longitude_increment    = 30,  
    map_grid_latitude_increment     = 20  
    )
    

# define the view - recentred and lon range is larger than 360!
view = mv.geoview(
		map_area_definition	 =	"corners",
		area	=	[-90,20,90,420],
		coastlines = coast
	)
	
# define the output plot file
mv.setoutput(mv.pdf_output(output_name = 'sst_extended_latlon'))
	
# generate plot	
mv.plot(view, sst, cont)