Versions Compared

Key

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

...

Operation between two geopoints. op is one of the following :

+ 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 )

...

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

 

list columns ( geopoints )

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


number count ( geopoints )

Returns the total number of elements in the geopoints.


geopoints create_geo ( number )
geopoints
geopoints create_geo ( number, string )
geopoints geopoints create_geo ( number, string, number )

Creates a new geopoints variable with the given number of points, all set to default values and coordinates. It is intended that this function be used in conjunction with the set_xxx geopoints functions in order to populate the geopoints with data. If saved, the geopoints file will be in the `traditional' 6-column format. If another format is desired, supply a string as the second parameter, possible values being 'polar_vector ', 'xy_vector ', 'xyv ' and 'xyv '.

 

list date ( geopoints )

ncols'. If format 'ncols' is specified, then the number of value columns can be given as the third argument (default is 1). 


list date ( geopoints )

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

...

Returns information about the database retrieval which generated the geopoints. The first string parameter specifies which piece of information you would like; possible values are:

name

the name of the database system, e.g. ODB

path

the path to the database

query

a list of strings containing the multi-line data query

column

the name of the database column used to populate a given element of the geopoints. A second string must be provided, naming the geopoints element of interest - possible values are `lat ', `lon ', `level ', `date ', `time ', `value ' and `value2 '.

alias

similar to column above, but returns the name of the database alias used instead of the full column name

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).

...

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

 

geopoints geopoints filter ( geopoints,number )
geopoints filter ( geopoints,list vector )

A filter function to extract a subset of its geopoints input using model levels the values in a vector as criteria.

    • 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.

...

The vector should contain the same number of elements as there are in the geopoints. An example, which uses a named column for the filter criteria is:

new_gpt = filter(gpt, gpt['precip'] > 5)  # "gpt['precip'] > 5" returns a vector of 1s and 0s


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

A filter function to extract a subset of its geopoints input using dates model levels as criteria.

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

 

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

A filter function to extract a subset of its geopoints input using a geographical area dates as criteria.The

    • 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 )

A filter function to extract a subset of its geopoints input using a geographical area as criteria.

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.

 

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).

 

geopoints

 

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).

 

geopoints interpolate ( fieldset,geopoints )

...

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
geopoints set_values ( geopoints, number or vector or number or vector or list )
geopoints geopoints set_value2values ( geopoints, number or vector or string, number or vector or list )

Returns a new geopoints variable with either its latitude, longitude, level, date, time, stnid, value or value2 component , value2 or another value column modified.

All these functions take two or three parameters: first one must be a geopoints variable. If three parameters are given, the second should be either the index or name of the values column to update. The last parameter defines the new values, and can be a number, a vector or a list of numbers. If a number is given then all the corresponding values (latitude, longitude, level, or ...) are replaced by the given value.

If a vector or list is given as the second last parameter then the corresponding values are replaced from the given vector or list. If the vector or list is shorter than the geopoints count then only the first values that have a corresponding value in the vector or list are changed.

NOTE: for dates, 8 digit integers must be used. If the list contains non-numbers, then a missing value is written into the corresponding geopoints value.

 

geopoints subsample ( geopoints, geopoints )

Returns a geopoints variable containing the same locations (latitude, longitude and height) as the second geopoints variable, but whose values are from the first geopoints variable (or a missing value if point not found in the first variable). Note that the resulting geopoints variable is sorted in the same way as performed by the geosort() function. This means that you need to be careful if performing functions between the results of a subsample() operation and another geopoints variable; if the locations in the two geopoints are the same, then you should geosort() the second geopoints beforehand.

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 value ( geopoints )

Examples of usage:

Code Block
languagepy
new_gpt_a = set_latitudes(gpt_a, |30, 40, 50|)
new_gpt_b = set_values(gpt_b, |12.4, 13.3, 1.1|)
new_gpt_c = set_values(gpt_c, 4, |3.3, 4.4, 5.5|) # update the 4th value column
new_gpt_d = set_values(gpt_d, 'precip', |0.3, 0.2, 0.1|) # update the column labelled 'precip'

Note that the above functions generate a new geopoints variable, leaving the original one intact. If you wish to modify the original variable, then a more efficient way is to directly access the columns using the following syntax, following the examples above:

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 )

Extracts the station id strings from all the geopoints and returns them as a list.


geopoints subsample ( geopoints, geopoints )

Returns a geopoints variable containing the same locations (latitude, longitude and height) as the second geopoints variable, but whose values are from the first geopoints variable (or a missing value if point not found in the first variable). Note that the resulting geopoints variable is sorted in the same way as performed by the geosort() function. This means that you need to be careful if performing functions between the results of a subsample() operation and another geopoints variable; if the locations in the two geopoints are the same, then you should geosort() the second geopoints beforehand.

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 values of all the geopoints and returns them as a vector. If the values are strings, then the result is a list of strings. A value column other than the first one can be specified either by index (1-based in Macro or 0-based in Python) or by name, e.g. values(gpt, 4) or values(gpt, 'geopotential'). See the description of the NCOLS subformat on the Geopoints page for more details of storing multiple value columns. Another syntax is to use direct indexing, e.g.

a = gpt['geopotential']


vector value2 ( geopoints )

Extracts the second Extracts the values of all the geopoints and returns them as a vector. If the values are strings, then the result is a list of strings.

 

...

list value_columns ( geopoints )

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

...

Returns a list containing the names of just the non-coordinate value columns in the given geopoints variable.


geopoints xy_vector ( geopoints, geopoints )

...