Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Scroll pdf ignore
Panel
titleDownload
Expand
titleClick here for files to download...
Excerpt Include
A Quick Tour of Metview
A Quick Tour of Metview
nopaneltrue

Attachments
uploadfalse
oldfalse
patterns*.tar.gz,*.grib,*.grb
sortByname

Overview

In addition to all its interactive functionality, Metview can be run in a purely batch mode from the command line. Of course, in this mode we cannot have an interactive plot window, but we can save plots in various formats (see Working with graphical output) and we can save computed data into files of various formats (see Processing Data).

...

Environment variables can be queried, not only in batch mode but also in interactive mode. This can be an alternative way to pass information to a macro.

From a command line, inspect the current environment variables with  env | sort  and choose one, for example HOST, which provides the name of the machine you are working on. In a macro, get the value of this variable a chosen environment variable (e.g. HOST) using the getenv() function. For example:

...

Invoking Metview's Data Examiners from the Command Line

Metview has a special shortcut specifically for invoking the data examiners from the command line for quick data inspection.

...

This works for GRIB, BUFR, ODB and netCDF files. The file type must be the first argument.

Plotting a Data File from the Command Line

For the same GRIB file, from the command-line, type:

Code Block
metview -p /path/to/grib

This gives a quick way to plot a file outside the Metview environment. The visualisation uses the same settings as ecCharts, so depending on the meteorological parameter you will get different contouring styles.

Extra Work

Take some of the macros you've already written and convert them so that they can run in batch mode. In most cases it will not require much work - here are the main things to consider:

  • the macro should be runnable both interactively and in batch mode
  • if the macro returns data, it should write it to disk instead
  • if the macro plots data, it should generate a graphics file instead
  • if the macro has some parameters hard-coded into it, they should become command-line arguments

...