Versions Compared

Key

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

...

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

 

...

vector latitudes ( geopoints )

...

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

 

...

vector levels ( geopoints )

...

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

 

...

vector longitudes ( geopoints )

...

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

 

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_

...

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

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.

 

...

vector value2 ( geopoints )

Extracts the second

...

values of all the geopoints and returns

...

them as a

...

vector.

 

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