Versions Compared

Key

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

...

Panel
borderColor#556699
bgColor#eaf6ff

Geopointset is the format used by Metview to combine a set of Geopoints variables into a single entity for ease of processing. Thus, a set of observations can be grouped in the same way that fields are grouped into a fieldset variable.

Creating a geopointset

A geopointset can be created with the create_geo_set() function, which takes any number of geopoints variables as arguments, or none. Both geopoints and geopointset variables can be concatenated to a geopointset.

Code Block
languagepy
set1 = create_geo_set()             # creates an empty set
set2 = create_geo_set(g1, g2, g3)   # assuming that g1,g2,g3 are geopoints variables
set3 = set1 & g1 & g2               # set3 has 2 geopoints
set4 = set2 & set3                  # set4 has 5 geopoints

Operations on geopointsets

The count() function returns the number of geopoints variables contained by the set.

As a geopointset is simply a container for geopoints variables, most operations on geopointsets are performed on each of their component geopoints. For example, the following line of code with return a new geopointset where each geopoints variable has had the cos() function applied to its values:

Code Block
cgset = cos(gset)

Operations between geopointsets are performed on each pair of geopoints, as long as they both contain the same number of geopoints, or one geopoints variable. For example:

Code Block
gsetdiff = gset1 - gset2

If gset1 and gset2 both contain 5 geopoints, then 5 operations will be performed (gset1[1] - gset2[1], etc). If gset1 contains 1 geopoints, then the result will again be 5 geopoints - the difference between gset1[1] and gset2[1..5].


The Geopointset file format

...