Versions Compared

Key

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

...

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 ' and 'xyv '.

 

list date ( geopoints )

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

 

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

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

 

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.

 

geopoints filter ( geopoints,geopoints )

A filter function to extract a subset of its geopoints input using a second geopoints as criteria. The two input geopoints must have the same number of values. The resulting output geopoints contains the values of the first geopoints where the value of the second geopoints is non-zero. It is usefully employed in conjunction with the comparison operators :


...

freeze

...

=

...

filter(temperature,temperature

...

<

...

273.15)

...

The variable freeze will contain a subset of temperature where the value is below 273.15 . The following example shows how to plot a geopoints set with different colours :

...

#

...

Filter

...

from

...

"temperature"

...

points

...

at,

...

above,

...

below

...

273.15

...


...

cold

...

=

...

filter(

...

temperature,temperature<273.15

...

)

...


...

zero

...

=

...

filter(

...

temperature,temperature=273.15

...

)

...


...

warm

...

=

...

filter(

...

temperature,temperature>273.

...


  # Create three symbol plotting definitions
 red   = psymb( symbol_colour : "red" )
 blue  = psymb( symbol_colour : "blue" )
 black = psymb( symbol_colour : "black" )

  # Plot everything

...

15 

# Create three symbol plotting definitions
red = psymb( symbol_colour : "red" )
blue = psymb( symbol_colour : "blue" )
black = psymb( symbol_colour : "black" )

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

...

 

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

A filter function to extract a subset of its geopoints input using model levels 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.

 

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

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

    • 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 find ( fieldset,number )

geopoints find ( fieldset,number,number )

A filtering function that returns a geopoints holding the grid points whose value is equal to the value of the first number. If a second number is given as the third argument it is a tolerance threshold and the geopoints will hold the grid points for which :


...

abs(data-value)

...

<=

...

threshold

...

 

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 )

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

 

list latitude ( geopoints )

Extract the latitude of all the geopoints and returns it as a list of numbers.

 

list level ( geopoints )

Extract the height of all the geopoints and returns it as a list of numbers.

 

list longitude ( geopoints )

Extract the longitude of all the geopoints and returns it as a list of numbers.

 

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.

 

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 offset ( geopoints,number,number )
geopoints offset ( geopoints,list)

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_latitude ( geopoints, number or list )
geopoints set_longitude ( geopoints, number or list )
geopoints set_level ( geopoints, number or list )
geopoints set_date ( geopoints, number or list )
geopoints set_time ( geopoints, number or list )
geopoints set_value ( geopoints, number or list )
geopoints set_value2 ( geopoints, number or list )

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

All these functions take two parameters: first one must be a geopoints variable, the second can be a number 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 list is given as the second parameter then the corresponding values are replaced from the given list. If the list is shorter than geopoints then only the first values that have a corresponding value in the 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.

 

list value ( geopoints )

Extracts the value of all the geopoints and returns it as a list of numbers.

 

list value2 ( geopoints )

Extracts the second value of all the geopoints and returns it as a list of numbers.

 

geopoints xy_vector ( geopoints, 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.

 

Storing Data Origin Information in a Geopoints File