Versions Compared

Key

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

...

+ Addition

- Subtraction

* Multiplication

/ Division

^ Power

 


The geopoints returned by these boolean operators are boolean geopoints (containing only 1 where result is true, 0 where it is false) :

> Larger Than

< Smaller Than

>= Larger or Equal

<= Smaller or Equal

= Equal

<> Not Equal

...


geopoints ( geopoints op number )
geopoints ( number op geopoints )

Operations between geopoints and numbers. op is any of the operations defined above. Missing values retain their value of geo_missing_value .

 


geopoints ( geopoints op fieldsets )
geopoints ( fieldsets op geopoints )

Operations between geopoints and fielsets. op is any of the operations defined above. Missing values, both in the fieldset and in the original geopoints variable result in a value of geo_missing_value .

 


geopoints ( geopoints and geopoints )
geopoints ( geopoints or geopoints )
geopoints ( not geopoints)

Conjunction, Disjunction and Negation. Boolean operations on geopoints consider all null values to be false and all non null values to be true. Missing values retain their value of geo_missing_value.

 


geopoints ( geopoints & geopoints & ... )
geopoints ( nil & geopoints & ... )
geopoints ( geopoints & nil )

Anchor
merge
merge
geopoints merge ( geopoints,geopoints,... )

Merge several sets of geopoints. The output is the concatenation of each set of geopoints. Merging with the value nil does nothing, and can be used to initialise when building a set of geopoints in a loop. Note that only geopoints that are in the same format can be merged. See Geopoints for details of the different formats.

 


definition geopoints[ number ]

Returns a definition with values of the nth point of the geopoints. Note that, unlike lists, the first geopoint is at index 0.


Anchor
abs

...

abs
geopoints abs ( geopoints )

Returns the geopoints of the absolute value of the input geopoints. Missing values retain their value of geo_missing_value.


Anchor

...

asin
asin
geopoints asin ( geopoints )
geopoints acos ( geopoints )
geopoints atan  ( geopoints )

Returns the geopoints of the arc trigonometric function of the input geopoints. Result is in radians. Missing values retain their value of geo_missing_value.


Anchor
cos

...

cos
geopoints cos ( geopoints )

Return the cosine of the input geopoints. These must be in radians. Missing values retain their value of geo_missing_value.


Anchor

...

exp
exp
geopoints exp ( geopoints )

Returns the geopoints of the exponential of the input geopoints. Missing values retain their value of geo_missing_value.


Anchor
int

...

int
geopoints int ( geopoints )

Returns the geopoints of the integer part of the input geopoints. Missing values retain their value of geo_missing_value.

...


Anchor
intbits
intbits
number intbits ( geopoints,number )
number intbits ( geopoints,number,number )

...

The number of bits available depends on the machine architecture and Metview's compilation options, but at the time of writing it should be 32. This function does not treat missing values differently from any other values (for efficiency with large datasets).


Anchor
log
 
log
geopoints log ( geopoints )

Returns the geopoints of the natural log of the input geopoints. Missing values retain their value of geo_missing_value.

...


Anchor
log10
log10
geopoints log10 ( geopoints )

Returns the geopoints of the base 10 log of the input geopoints. Missing values retain their value of geo_missing_value.


Anchor
neg

...

neg
geopoints neg ( geopoints )

Returns the geopoints of the negative of the input geopoints. The same as (- geopoints). Missing values retain their value of geo_missing_value.

...


Anchor
sgn
sgn
geopoints sgn ( geopoints )

Returns the geopoints of the sign of the values of the input geopoints : -1 for negative values, 1 for positive and 0 for null values. Missing values retain their value of geo_missing_value.


Anchor
sin

...

sin
geopoints sin ( geopoints )

Return the sine of the input geopoints. These must be in radians. Missing values retain their value of geo_missing_value.

...

.


Anchor
sqrt
sqrt
geopoints sqrt ( geopoints )

Returns the geopoints of the square root of the input geopoints. Missing values retain their value of geo_missing_value.

...


Anchor
tan
tan
geopoints tan ( geopoints )

Return the tangent of the input geopoints. These must be in radians. Missing values retain their value of geo_missing_value.

...


Anchor
columns
columns
list columns ( geopoints )

Returns a list containing the names of the columns in the given geopoints variable.


Anchor
count
count
number count ( geopoints )

Returns the total number of elements in the geopoints.


Anchor
create_geo
create_geo
geopoints create_geo ( number )
geopoints create_geo ( number, string )
geopoints create_geo ( number, string, number )
geopoints create_geo ( number, string, number, list )
geopoints create_geo ( ... )

...

Code Block
languagepy
g = create_geo(8) # default geopoints format, 8 values
g = create_geo(9, 'xyv') # XYV formatted geopoints with 9 values
g = create_geo(4, 'ncols', 3, ['t', 'z', 'precip']) # NCOLS format with 3 named columns, each containing 4 values
g = create_geo(type:'standard',
               latitudes:  |4, 5, 6|,
               longitudes: |2.3, 1.1, 6.5|,
               levels:     850,  # all rows will have 850 as their level
               values:     |1.1, 2.2, 3.3|,
               times:      nil,
               stnids:     ['aberdeen', 'aviemore', 'edinburgh'] )
g = create_geo(type:'xyv',
               latitudes:  |4, 5, 6|,
               longitudes: |2.3, 1.1, 6.5|,
               values:     |1.1, 2.2, 3.3|)


Anchor
date
date

list date ( geopoints )

Extracts the date information of all the geopoints and returns it as a list of dates.

...


Anchor
db_info
db_info

string or list db_info ( geopoints,string )
string db_info ( geopoints,string,string )

...

Note that this information is derived from the DB_INFO section (if it exists) in the geopoints file header (see Storing Data Origin Information in a Geopoints File).


Anchor
distance
distance
 

geopoints distance ( geopoints,number,number )
geopoints distance ( geopoints,list )

Returns geopoints with the value of each point being the distance in meters from the given geographical location. The location may be specified by supplying either two numbers (latitude and longitude respectively) or a 2-element list containing latitude and longitude in that order. The location should be specified in degrees.

...


Anchor
filter
filter

geopoints filter ( geopoints,geopoints )

...

# Plot everything
plot(zero,black,cold,blue,warm,red)

...


geopoints filter ( geopoints,vector )

...

    • If the second argument is a number, the function extracts all the geopoints for which the level is equal to the number.
    • If the second argument is a list of two numbers [n1,n2] , the function extracts all the geopoints for which the level lies in the n1-n2 interval.

 


geopoints filter ( geopoints,date )
geopoints filter ( geopoints,list )

...

    • If the second argument is a date, the function extracts all the geopoints for which the date is equal to the one specified as the second argument.
    • If the second argument is a list of two dates [d1,d2] , the function extracts all the geopoints for which the date lies in the d1-d2 interval.

...


geopoints filter ( geopoints,list )

...

The second argument is a list of four numbers (lat/long coordinates) defining a geographical area - [North,West,South,East] . The function extracts all the geopoints that fall within the specified area.


Anchor
geosort

...

geosort

geopoints geosort ( geopoints )

Returns a new geopoints variable that contains the input geopoints sorted geographically from North to South (and West to East in points with the same latitude value, then by height, with lowest numerical values first).

...


Anchor
interpolate
interpolate

geopoints interpolate ( fieldset,geopoints )

Generates a set of geopoints from a field. The first parameter must contain a single field. The field is interpolated for each position of the geopoints given as a second parameter. Where it is not possible to generate a sensible value due to lack of valid data in the fieldset, the internal geopoints missing value is used (this value can be checked for with the built-in variable geo_missing_value or removed with the function remove_missing_values ).


Anchor

...

latitudes
latitudes

vector latitudes ( geopoints )

Extracts the latitudes of all the geopoints and returns them as a vector..

...


Anchor
levels
levels

vector levels ( geopoints )

Extracts the heights of all the geopoints and returns them as a vector.

...


Anchor
longitudes
longitudes

vector longitudes ( geopoints )

Extracts the longitudes of all the geopoints and returns them as a vector.

...


Anchor
max
max

geopoints max ( geopoints,geopoints )
geopoints min ( geopoints,geopoints )

Returns the geopoints of maximum (minimum) value at each point. Missing values retain their value of geo_missing_value.

...


geopoints max ( geopoints,number )
geopoints min ( geopoints,number )

Returns the geopoints of the maximum (minimum) of number and the geopoints value at each point. Missing values retain their value of geo_missing_value.

...


geopoints max ( geopoints,fieldsets )
geopoints min ( geopoints,fieldsets )

Returns geopoints of maximum (minimum) of the geopoints value and the geopoints value at each grid point or spectral coefficient. Missing values, either in the fieldset or in the original geopoints variable, result in a value of geo_missing_value.

...


Anchor
maxvalue
maxvalue

Anchor
minvalue
minvalue

number maxvalue ( geopoints )
number minvalue ( geopoints )

Returns the maximum (minimum) value of all geopoints values. Missing values are bypassed in this calculation. If there are no valid values, then nil is returned.

 


number mean ( geopoints )

Computes the mean of the geopoints. Missing values are bypassed in this calculation. If there are no valid values, then nil is returned.

...


geopoints nearest_gridpoint ( fieldset,geopoints )

...

Modifies the locations of a set of geopoints by specified amounts. The offsets can be specified either as two separate numbers or as a 2-element list. The original geopoints variable is unaffected; the functions return a new variable.

 


geopoints polar_vector ( geopoints, geopoints )

Combines two single-parameter geopoints variables into a polar vector style geopoints variable. The first represents speed, the second represents direction. Both input geopoints variables should contain the same number of points.

 


geopoints remove_duplicates ( geopoints )

Returns a new geopoints variable that contains just one instance of any duplicate geopoint. Two geopoints are considered to be duplicates of each other if the files have the same format and the points have the same coordinates, height, date, time and values.

 


geopoints remove_missing_values ( geopoints )

Returns a new geopoints variable that contains just the non-missing values from the input geopoints variable. A geopoint is considered to be missing if either its value or value2 members are missing.

 


geopoints set_latitudes ( geopoints, number or vector or list )
geopoints set_longitudes ( geopoints, number or vector or list )
geopoints set_levels ( geopoints, number or vector or list )
geopoints set_dates ( geopoints, number or vector or list )
geopoints set_stnids ( geopoints, list )
geopoints set_times ( geopoints, number or vector or list )
geopoints set_values ( geopoints, number or vector or list )
geopoints set_values ( geopoints, number or string, number or vector or list )

...

Code Block
languagepy
gpt['latitude'] = |30, 40, 50|
gpt['value'] = |12.4, 13.3, 1.1|
gpt[name_of_column_4] = |3.3, 4.4, 5.5|
gpt['precip'] = |0.3, 0.2, 0.1|

...


list stnids ( geopoints )

...

You can use function remove_missing_values() if you need to get rid of the missing valued points in the returned geopoints variable.

 


number sum ( geopoints )

Computes the sum of the geopoints. Missing values are bypassed in this calculation. If there are no valid values, then nil is returned.

...


vector or list values ( geopoints )
vector or list values ( geopoints, number )
vector or list values ( geopoints, string )

...

Extracts the second values of all the geopoints and returns them as a vector.

...


list value_columns ( geopoints )

...

Combines two single-parameter geopoints variables into a u/v style geopoints variable. Both input geopoints variables should contain the same number of points.