Server Side Processing Functions: Difference between revisions

From OPeNDAP Documentation
⧼opendap2-jumptonavigation⧽
No edit summary
No edit summary
Line 2: Line 2:


All the functions here are included in the Hyrax server, version 1.6. Other servers may also support these.
All the functions here are included in the Hyrax server, version 1.6. Other servers may also support these.
== geoarray ==
Version documented: 0.9b1
The geoarray() function supports two different sets of arguments:
geoarray(var,left,top,right,bottom)
In the first version 'var' is the target of the selection and 'top', 'left', 'bottom' and 'right' are the corners of a latitude-longitude box that defines the selection. The array's position on the globe is defined by metadata associated with the dataset.
  geoarray(var,top,left,bottom,right,var_top,var_left,var_bottom,var_right,)
In the second version the array's position on the globe is specified explicitly in the function argument list.  The 'var_top', 'var_left', ..., parameters give the latitude and longitude extent of the  entire array, overriding any values provided by metadata present in the dataset.
The projection and datum are assumed to be ''Plat-Carre'' and ''WGS84''.


== geogrid ==
== geogrid ==

Revision as of 19:54, 7 January 2010

Server-side functions provide a way to access the processing power of the data server and perform operations that fall outside the scope of the DAP constraint mechanism of projection and selection. Each server can load functions at run-time, so the set of functions supported may be different than those documented here. Use the version() function to get a list of functions supported by a particular server. To get information about a particular function, call that function with no arguments. The 'help' response from both version() and a function such as linear_scale() is a simple XML document listing the function's name, version and URL to more complete documentation.

All the functions here are included in the Hyrax server, version 1.6. Other servers may also support these.

geoarray

Version documented: 0.9b1

The geoarray() function supports two different sets of arguments:

geoarray(var,left,top,right,bottom)

In the first version 'var' is the target of the selection and 'top', 'left', 'bottom' and 'right' are the corners of a latitude-longitude box that defines the selection. The array's position on the globe is defined by metadata associated with the dataset.

 geoarray(var,top,left,bottom,right,var_top,var_left,var_bottom,var_right,)

In the second version the array's position on the globe is specified explicitly in the function argument list. The 'var_top', 'var_left', ..., parameters give the latitude and longitude extent of the entire array, overriding any values provided by metadata present in the dataset.

The projection and datum are assumed to be Plat-Carre and WGS84.

geogrid

Version documented: 1.1

The geogrid() function applies a constraint given in latitude and longitude to a DAP Grid variable. The arguments to the function are:

geogrid(variable, top, left, bottom, right[, expression ...])

The variable is the data to be sub-sampled. The Top, left, bottom, right are the latitude and longitude coordinates of the northwesterm and southeastern corners of the selection box. The expressions consist of one or more quoted relational expressions. See grid() for more information about the expressions.

The function will always return a single Grid variable whose values completely cover the given region, although there may be cases when some additional data are also returned. If the longitude values 'wrap around' the right edge of the data, then the function will make two requests and return those joined together as a single Grid. If the data are stored with the southern latitudes at the top of the array, the return result will be flipped so that the northern latitudes are at the top.

grid

Version documented: 1.0

The grid() function takes a DAP Grid variable and zero or more relational expressions. Each relational expression is applied to the grid using the server's constraint evaluator and the resulting grid is returned. The expressions may use constants and the grid's map vectors but may not use any other variables. In particular, you cannot use the grid values themselves

Two forms of expression are provided:

  1. "var relop const"
  2. "const relop var relop const"

Where relop stands for one of the relational operators, like = and >

For example: grid(sst,"20>TIME>=10") and grid(sst,"20>TIME","TIME>=10") are both legal and, in this case, also equivalent.

linear_scale

Version documented: 1.0b1

The linear_scale() function applies the familiar y = mx + b equation to data. It has three forms:

  1. linear_scale(var)
  2. linear_scale(var,scale_factor,add_offset)
  3. linear_scale(var,scale_factor,add_offset,missing_value)

If only the name of a variable is given, the function looks for the COARDS/CF-1.0 scale_factor, add_offset and missing_value attributes. In the equation, 'm' is scale_factor, 'b' is add_offset and data values that match missing_value are not scaled.

If add_offset cannot be found, it defaults to zero; if missing_value cannot be found, the test for it is not performed.

In the second and third form, if the given values conflict with the dataset's attributes, the given values override.

version

The version function provides a list of the server-side processing functions available on a given server along with their versions. For information on a specific function, call it with no arguments or look at this page.