libdap Updated for version 3.21.1
libdap4 is an implementation of OPeNDAP's DAP protocol.
functions Namespace Reference

Classes

class  GeoConstraint
 
class  GeoGridFunction
 
class  GridFunction
 
class  GridGeoConstraint
 
struct  gse_arg
 
class  GSEClause
 

Enumerations

enum  relop {
  dods_nop_op , dods_greater_op , dods_greater_equal_op , dods_less_op ,
  dods_less_equal_op , dods_equal_op , dods_not_equal_op
}
 

Functions

void apply_grid_selection_expressions (Grid *grid, vector< GSEClause * > clauses)
 
void function_geogrid (int argc, BaseType *argv[], DDS &, BaseType **btpp)
 
void function_grid (int argc, BaseType *argv[], DDS &, BaseType **btpp)
 
void get_grids (BaseType *bt, vector< Grid * > *grids)
 
void get_grids (DDS &dds, vector< Grid * > *grids)
 
void parse_gse_expression (gse_arg *arg, BaseType *expr)
 
bool unit_or_name_match (set< string > units, set< string > names, const string &var_units, const string &var_name)
 
bool unit_or_name_match (set< string > units, set< string > names, const string &var_units, const string &var_name)
 

Enumeration Type Documentation

◆ relop

Enumerator
dods_nop_op 
dods_greater_op 
dods_greater_equal_op 
dods_less_op 
dods_less_equal_op 
dods_equal_op 
dods_not_equal_op 

Definition at line 54 of file GSEClause.h.

Function Documentation

◆ apply_grid_selection_expressions()

void functions::apply_grid_selection_expressions ( Grid * grid,
vector< GSEClause * > clauses )

Definition at line 169 of file grid_utils.cc.

◆ function_geogrid()

void functions::function_geogrid ( int argc,
BaseType * argv[],
DDS & ,
BaseType ** btpp )

The geogrid function returns the part of a Grid that includes a geographically specified rectangle. The arguments to the function are the name of a Grid, the left-top and right-bottom points of the rectangle and zero or more relational expressions of the sort that the grid function accepts. The constraints on the arguments are:

  • The Grid must have Latitude and Longitude map vectors. Those are discovered by looking for map vectors which satisfy enough of any one of a set of conventions to make the identification of those map vectors positive or by guessing which maps are which. The set of conventions supported is: COARDS, CF 1.0, GDT and CSC (see http://www.unidata.ucar.edu/software/netcdf/conventions.html). If the geogrid guesses at the maps, it adds an attribute (geogrid_warning) which says so. (in version 1.1)
  • The rectangle corner points are in Longitude-Latitude. Longitude may be given using -180 to 180 or 0 to 360. For data sources with global coverage, geogrid assumes that the Longitude axis is circular. For requests made using 0/359 notation, it assumes it is modulus 360. Requests made using -180/179 notation cannot use values outside that range.
  • The notation used to specify the rectangular region determines the notation used in the longitude/latitude map vectors of the Grid returned by the function.
  • There are no restrictions on the relational expressions beyond those for the grid() (see func_grid_select()) function.
Note
The geogrid() function is implemented as a 'BaseType function' which means that there can be only one function per request and no other variables may be named in the request.
Parameters
argcThe number of values in argv.
argvAn array of BaseType pointers which hold the arguments to be passed to geogrid. The arguments may be Strings, Integers, or Reals, subject to the above constraints.
btppA pointer to the return value; caller must delete.
Returns
The constrained and read Grid, ready to be sent.

Definition at line 81 of file GeoGridFunction.cc.

◆ function_grid()

void functions::function_grid ( int argc,
BaseType * argv[],
DDS & ,
BaseType ** btpp )

The grid function uses a set of relational expressions to form a selection within a Grid variable based on the values in the Grid's map vectors. Thus, if a Grid has a 'temperature' map which ranges from 0.0 to 32.0 degrees, it's possible to request the values of the Grid that fall between 10.5 and 12.5 degrees without knowing to which array indexes those values correspond. The function takes one or more arguments:

  • The name of a Grid.
  • Zero or more strings which hold relational expressions of the form:
    • <map var> <relop> <constant>
    • <constant> <relop> <map var> <relop> <constant>

Each of the relation expressions is applied to the Grid and the result is returned.

Note
Since this is a function and one of the arguments is the grid, the grid is read (using the Grid::read() method) at the time the argument list is built.
Parameters
argcThe number of values in argv.
argvAn array of BaseType pointers which hold the arguments to be passed to geogrid. The arguments may be Strings, Integers, or Reals, subject to the above constraints.
btppA pointer to the return value; caller must delete.
See also
geogrid() (func_geogrid_select) A function which has logic specific to longitude/latitude selection.

Definition at line 77 of file GridFunction.cc.

◆ get_grids() [1/2]

void functions::get_grids ( BaseType * bt,
vector< Grid * > * grids )

Recursively traverses the BaseType bt (if its a constructor type) and collects pointers to all of the Grid and places said pointers into the vector parameter 'grids'. If the BaseType parameter bt is an instance of Grid the it is placed in the vector.

Parameters
btThe BaseType to evaluate
gridsA vector into which to place a pointer to every Grid.

Definition at line 60 of file grid_utils.cc.

◆ get_grids() [2/2]

void functions::get_grids ( DDS & dds,
vector< Grid * > * grids )

Recursively traverses the DDS and collects pointers to all of the Grids and places said pointers into the vector parameter 'grids'.

Parameters
ddsThe dds to search
gridsA vector into which to place a pointer to every Grid in the DDS.

Definition at line 90 of file grid_utils.cc.

◆ parse_gse_expression()

void functions::parse_gse_expression ( gse_arg * arg,
BaseType * expr )

Definition at line 124 of file grid_utils.cc.

◆ unit_or_name_match() [1/2]

bool functions::unit_or_name_match ( set< string > units,
set< string > names,
const string & var_units,
const string & var_name )

Look in the containers which hold the units attributes and variable name prefixes which are considered as identifying a vector as being a latitude or longitude vector.

Parameters
unitsA container with a bunch of units attribute values.
namesA container with a bunch of variable name prefixes.
var_unitsThe value of the 'units' attribute for this variable.
var_nameThe name of the variable.
Returns
True if the units_value matches any of the accepted attributes exactly or if the name_value starts with any of the accepted prefixes

Definition at line 78 of file GeoConstraint.cc.

◆ unit_or_name_match() [2/2]

bool functions::unit_or_name_match ( set< string > units,
set< string > names,
const string & var_units,
const string & var_name )
extern