Versions Compared

Key

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

...

The derivatives are computed with a second order finite-difference approximation. The resulting fieldset contains two fields for each input field: the zonal derivative followed by the meridional derivative. The output fields are bitmapped on the poles (they contain missing values there). Please note that this function is only implemented for regular latitude-longitude grids.

Warning

Please be aware that in versions before Metview 5.5.3 the resulting fields of gradient() appear in the wrong order.  The correct order should look like this:

[gradx_f1, grady_f1, gradx_f2, grady_f2, ....]

but instead of it the following order is produced:

[gradx_f1, gradx_f2,..., grady_f1, grady_f2, ....]


grib_get
Anchor
grib_get
list
grib_get
(fieldset, list)
list grib_get (fieldset, list, [string])

For the efficient retrieval of multiple GRIB keys from a fieldset. A single call to grib_get can replace multiple calls to the other grib_get_* functions and is hence more efficient. The keys are provided as a list for the second argument; by default they will be retrieved as strings, but their type can be specified by adding a modifier to their names, following the convention used by grib_ls where the key name is followed by a colon and then one or two characters which specify the type (:

    • s=string

...

    • l=long

...

    • d=double

...

    • la=long array

...

    • da=double array
    • n=native type New in Metview version 5.14.0

). For example, the key 'centre' can be retrieved as a string with 'centre' or 'centre:s', or as a number with 'centre:l'. Each GRIB key has a ‘native type’, e.g. long or string. If the type is specified as “n” then the type that is returned. The native type for the key ‘centre’ is str, so ‘centre:n’ will return a str.

The result is always a list of lists; by default, or if the optional third argument is 'field', the result will be grouped by field, containing one list per field, each of these lists containing one element per key; if the optional third parameter is 'key', the result will be grouped by key, containing one list per key, each of these lists containing one element per field. Example - the following lines of Macro code on a particular 6-field fieldset:

...