Versions Compared

Key

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

...

Section


Column
width76px


Column

This icon performs can directly visualise ODB data in various plot types. Optionally it can perform an ODB/SQL query on an ODB database (ODB-1) or file the input ODB and visualises the resulting (intermediate) data. It works for both databases (ODB-2). The result is always an ODB file (in 1) and files (ODB-2 format).

Info

From Macro/Python the icon can be called as odb_filtervisualiser().


Tip

A tutorial about using ODB in Metview can be found here.

What is ODB?

ODB is a database developed at ECMWF to store and retrieve large volumes of meteorological observational and feedback data efficiently for use within the IFS.

Currently, ODB comes in two flavours:

  • ODB-1 (the original hierarchical table format capable of running in a parallel environment within IFS)
  • ODB-2 (a new flat format with a modern API used for archiving in MARS).

The ODB Filter Editor

It performs the query, defines which ODB columns should be interpreted as latitude, longitude and value(s) and specifies the plot type (symbol or wind plotting), as well.

Create a new ODB Visualiser icon (right-click in the desktop when no icons are selected and use the New icon ... menu) and rename it 'tb_plot'.

First, open its editor and set Odb Plot Type to 'Geo Points' to indicate that we want to plot the values on a map.

Second, drop your 'AMSUA.odb' database icon into the Odb Data field. This specifies the database for which the query will be performed.

Third, specify the ODB/SQL query and the way the columns are interpreted to generate the plot. We want to perform the following query:

SELECT
 lat@hdr,
 lon@hdr,
 obsvalue@body
WHERE
 vertco_reference_1@body = 5

In the ODB Visualiser interface this query cannot be typed in directly but has to be split into the following individual items:

...

specifies the WHERE statement. In our example it is as follows:

vertco_reference_1@body = 5

How does ODB/SQL query work in the ODB Visualiser?

We illustrate it with a simple example. Let us suppose we want to perform this ODB/SQL query on our data then want to plot the results as points on a map:

Code Block
SELECT
 lat@hdr,
 lon@hdr,
 fg_depar@body
WHERE
 vertco_reference_1@body = 5
ORDERBY
 obsvalue@body

Then in the icon editor we need to set the following parameters:

ODB Latitude Variablelat@hdr
ODB Longitude variablelon@hdr
ODB Value Variablefg_depar@body
ODB Where
vertco_reference_1@body = 5
ODB Orderby
obsvalue@body



The ODB Visualiser Editor

ODB

Last, we have to specify the units of the geographical co-ordinates (here lat@hdr and lon@hdr) in the Odb Coordinates Unit field. It is necessary since Metview requires geographical co-ordinates in degrees, but there is no general way to find out their units in an ODB database. Instead an explicit declaration is needed from the users. Our database stores co-ordinates in degrees. So, to correctly interpret our co-ordinate values Odb Coordinates Unit should be set to 'Degrees' (which is the default value so we do not need to change it).

Having finished the modifications your icon editor should look like this:

Image Removed

Remarks

  1. The ODB database for which the query is performed can be alternatively specified by the database path via the Odb Filename input field. Please note that the typed-in database path is only used by Metview if no database icon is present.
  2. The maximum number of rows accepted in the ODB retrieval is specified in the Odb Nb Rows input field. By default (-1) there is no upper limit for the number of rows.
  3. If column latlon_rad@desc is available in an ODB (it is defined for our 'AMSUA.odb' database) it tells us the geographical co-ordinate units. Its 0 value indicates degrees while 1 means radians (you can use the ODB Examiner to check this value for our database). Besides, it is worth mentioning that all ODBs retrieved from MARS, as a generic rule, use degrees as geographical co-ordinate units.

ODB Plot Type

Specifies the plot type to be generated. The possible values are as follows:

  • geo_points (points plotted onto a map)
  • geo_vectors (vectors plotted onto a map)
  • xy_points (points plotted into a Cartesian View)
  • xy_vectors (vectors plotted into a Cartesian View)
  • xy_binning (gridded values by binning plotted into a  a Cartesian View)

...

Specifies the path to the input ODB.

ODB Data

Specifies the input ODB as an icon. If both an icon (in ODB Data) and a filename (in ODB Filename) are specified the icon takes precedence.

...

Specifies the ODB column interpreted as longitude when ODB Plot Type is set to geo_points or geo_vectors. The default is lon@hdr.

ODB X Component Variable

Specifies the ODB column interpreted as the x component of the vector when ODB Plot Type is set to geo_vectors or xy_vectors. The default is obsvalue@body.

ODB Y Component Variable

Specifies the ODB column interpreted as the y component of the vector when ODB Plot Type is set to geo_vectors or xy_vectors. The default is obsvalue@body#1.

ODB X Type

Specifies the type of the x coordinate when ODB Plot Type is set to xy_points, xy_vectors or xy_binning. The possible values are: number and date. The default is number.

ODB Y Type

Specifies the type of the y coordinate when ODB Plot Type is set to xy_points, xy_vectors or xy_binning. The possible values are: number and date. The default is number.

ODB X variable

Specifies the ODB column interpreted as the x coordinate when ODB Plot Type is set to geo_vectors, xy_vectors or xy_binning. The default is an empty string.

ODB Y Variable

Specifies the ODB column interpreted as the y coordinate when ODB Plot Type is set to geo_vectors, xy_vectors or xy_binning. The default is an empty string.

ODB Value Variable

Specifies the ODB column interpreted as the value in each plot type. The default is obsvalue@body.

ODB Metadata Variables

Specifies the list of columns extracted and added to the resulting ODB file on top of the columns directly used for visualisation. This parameter accepts wildcards (e.g. *.hdr), to add all the columns from the source ODB to the result use : *. The default is an empty string (no extra columns added).

ODB Parameters

The default is an empty string.

ODB From

Defines the FROM statement of the ODB/SQL query.

ODB Where

ODB OrderbyDefines the WHERE statement of the ODB/SQL query.

ODB

...

Orderby

Defines the ORDERBY statement of Specifies the ODB/SQL query to run.

ODB NB Rows

Specifies the maximum number of rows in the result. If -1 is given here the number of rows is not limited in the output. The default value is -1.

ODB Coordinate Units

Specifies the units of the geographical co-ordinates in the input ODB. The possible values are: degrees and radians. The default is degrees.

Info

For older ODBs if column latlon_rad@desc tells us the geographical co-ordinate units. Its 0 value indicates degrees while 1 means radians. Newer ODBs, especially the ones retrieved from MARS, as a generic rule, always use degrees as geographical co-ordinate units.

ODB Binning

Specifies the Binning used to grid scattered data when the ODB Plot Type is xy_binning.

Fail On Empty Output

When it is set to Yes the icon will not fail if the resulting ODB is empty (in Macro the return value is nil while in Python it is None). Otherwise when it is set to No the icon will fail on empty output. The default value is Yes.