Metview's documentation is now on readthedocs!

Download source and data


Spherical Harmonics Spectrum 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 file - contains only one
# spherical harmonic (spectral) field
f = read("z_for_spectra.grib")

# generate spectra plot definition
sp = spec_graph(
    data: f,
    truncation: 106,
    y_axis_type: "logartihmic"
    )
    
# define the output plot file
setoutput(pdf_output(output_name : 'spectra'))

# generate the plot
plot(sp)

 
Spherical Harmonics Spectrum 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 file - contains only one
# spherical harmonic (spectral) field
f = mv.read("z_for_spectra.grib")

# generate spectra plot definition
sp = mv.spec_graph(
    data=f,
    truncation=106,
    y_axis_type="logartihmic"
    )
    
# define the output plot file
mv.setoutput(mv.pdf_output(output_name='spectra'))

# generate the plot
mv.plot(sp)