stvl

../../_images/STVL.png

Retrieves point data from the STVL database in Geopoints or Geopointset formats. The output format depends on the retrieval options. The generic rule is that STVL generates one Geopoints object per date, time and step. When STVL generates a single Geopoints this is returned as is. However, when multiple Geopoints objects are generated they are merged into a single Geopointset on return. The following examples show how it works.

This code retrieves a single date and time:

import metview as mv

r = mv.stvl(
    parameter="2t",
    dates=20200511,
    times=12
)

print(f"type={type(r)}")
print(f"len={len(r)}")

generating this output:

type=<class 'metview.bindings.Geopoints'>
len=8474

This code retrieves multiple times:

import metview as mv

r = mv.stvl(
    parameter="2t",
    dates=20200511,
    times=[0, 12]
)

print(f"type={type(r)}")
print(f"len={len(r)}")
for i, g in enumerate(r):
    print(f"len[{i}]={len(g)}")

and the output looks like this:

type=<class 'metview.bindings.GeopointSet'>
len=2
len[0]=7792
len[1]=8474

Warning

This function is only available for internal ECMWF use.

Note

This function performs the same task as the Stvl icon in Metview’s user interface. It accepts its parameters as keyword arguments, described below.

stvl(**kwargs)

Retrieves point data from the STVL database in Geopoints or Geopointset formats.

Warning

This function is only available for internal ECMWF use.

Parameters
  • parameter (str) – Specifies the parameter name as an ecCodes shortName.

  • period (str) – Observation period in hours (0-24), only valid for certain parameters.

  • dates (list or str or number) – Observation or forecast start dates. It can be one or more YYYYMMDD values or a MARS-style interval YYYYMMDD/to/YYYYMMDD/by/H (e.g. 20160102/to/20160229/by/3).

  • times (list or str or number) – Observation or forecast start times.

  • steps (list or str or number) – The list of forecast steps. It can be one or more steps in hours separated or a MARS- like interval, e.g. 24/to/120/by/12. Only available when table is “model”.

  • table ({"observation", "model"}, default: "observation") – Database table to retrieve data from.

  • mclass (str, default: "od") – The MARS class of model data. Only available when table is “model”.

  • stream (str, default: "oper") – The MARS stream of model data. Only available when table is “model”.

  • expver (str, default: "0001") – The MARS experiment version of model data. Only available when table is “model”.

  • mtype (str, default: "fc") – The MARS type of model data. Only available when table is “model”.

  • origin (str) – The MARS origin of model data. Only available when table is “model”.

  • anoffset (number) – The MARS analysis offset of model data. Only available when table is “model”.

  • columns (list) – Optional list of value columns in the output file. If not set all the columns will be stored.

  • sources (list) – List of original sources of observations.

Return type

Geopoints or Geopointset