OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
libdap Namespace Reference

static class NCMLUtil overview More...

Classes

class  BBoxFunction
 
class  BBoxUnionFunction
 
class  BindNameFunction
 The LinearScaleFunction class encapsulates the linear_scale function 'function_linear_scale' along with additional meta-data regarding its use and applicability. More...
 
class  BindShapeFunction
 
class  DAP_Dataset
 DAP_Dataset is a subclass of AbstractDataset, used to process NOAA GOES data. More...
 
class  GeoConstraint
 Encapsulate the logic needed to handle geographical constraints when they are applied to DAP Grid (and some Array) variables. More...
 
class  GeoGridFunction
 
class  GridFunction
 
class  GridGeoConstraint
 Geographical constraint applied to a grid. More...
 
struct  gse_arg
 Argument to the GSE parser. More...
 
class  GSEClause
 Holds the results of parsing one of the Grid Selection Expression clauses. More...
 
class  LinearScaleFunction
 The LinearScaleFunction class encapsulates the linear_scale function 'function_linear_scale' along with additional meta-data regarding its use and applicability. More...
 
class  MakeArrayFunction
 The LinearScaleFunction class encapsulates the array builder function 'function_make_array' along with additional meta-data regarding its use and applicability. More...
 
class  NDimensionalArray
 
class  Odometer
 Map the indices of a N-dimensional array to the offset into memory that matches those indices. More...
 
class  ReProjectionFunctions
 
class  RoiFunction
 
struct  slice
 
class  StreamString
 
class  SwathToArray
 
class  SwathToGrid
 
class  TabularFunction
 
class  TabularSequence
 Specialization of Sequence for tables of data. More...
 
class  VersionFunction
 

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)
 
BaseType * bind_shape_worker (string shape, BaseType *btp)
 
void function_bind_name_dap2 (int argc, BaseType *argv[], DDS &dds, BaseType **btpp)
 Bind a new name to a variable. More...
 
BaseType * function_bind_name_dap4 (D4RValueList *args, DMR &dmr)
 
void function_bind_shape_dap2 (int argc, BaseType *argv[], DDS &, BaseType **btpp)
 Bind a shape to a DAP2 Array that is a vector. More...
 
BaseType * function_bind_shape_dap4 (D4RValueList *args, DMR &dmr)
 Bind a shape to a DAP4 Array that is a vector. More...
 
void function_dap2_bbox (int argc, BaseType *argv[], DDS &, BaseType **btpp)
 Return the bounding box for an array. More...
 
void function_dap2_bbox_union (int argc, BaseType *argv[], DDS &, BaseType **btpp)
 Combine several bounding boxes, forming their union. More...
 
void function_dap2_linear_scale (int argc, BaseType *argv[], DDS &, BaseType **btpp)
 Given a BaseType, scale it using 'y = mx + b'. More...
 
void function_dap2_roi (int argc, BaseType *argv[], DDS &, BaseType **btpp)
 Subset the N arrays using index slicing information. More...
 
void function_dap2_version (int, BaseType *[], DDS &dds, BaseType **btpp)
 This server-side function returns version information for the server-side functions. More...
 
BaseType * function_dap4_bbox (D4RValueList *, DMR &)
 Return the bounding box for an array. More...
 
BaseType * function_dap4_bbox_union (D4RValueList *, DMR &)
 Combine several bounding boxes, forming their union. More...
 
BaseType * function_dap4_linear_scale (D4RValueList *args, DMR &dmr)
 Given a BaseType, scale it using 'y = mx + b'. More...
 
BaseType * function_dap4_roi (D4RValueList *, DMR &)
 Return the bounding box for an array. More...
 
BaseType * function_dap4_version (D4RValueList *, DMR &dmr)
 This server-side function returns version information for the server-side functions. More...
 
void function_geogrid (int argc, BaseType *argv[], DDS &, BaseType **btpp)
 The geogrid function returns the part of a Grid which includes a geographically specified rectangle. More...
 
void 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. More...
 
BaseType * function_linear_scale_worker (BaseType *bt, double m, double b, double missing, bool use_missing)
 
void function_make_dap2_array (int argc, BaseType *argv[], DDS &dds, BaseType **btpp)
 Build a new DAP Array variable. More...
 
BaseType * function_make_dap4_array (D4RValueList *args, DMR &dmr)
 The linear_scale() function applies the familiar y = mx + b equation to data. More...
 
void function_swath2array (int argc, BaseType *argv[], DDS &, BaseType **btpp)
 
void function_swath2grid (int argc, BaseType *argv[], DDS &, BaseType **btpp)
 
void getGrids (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'. More...
 
void getGrids (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'. More...
 
bool isGeoGrid (Grid *grid)
 Evaluates a Grid to see if has suitable semantics for use with function_geogrid. More...
 
bool isValidTypeMatch (Type requestedType, Type argType)
 
vector< int > parse_dims (const string &shape)
 Parse the shape 'expression'. More...
 
void parse_gse_expression (gse_arg *arg, BaseType *expr)
 
auto_ptr< Array > roi_bbox_build_empty_bbox (unsigned int num_dim, const string &bbox_name)
 Build an empty Bounding Box using DAP variables. More...
 
Structureroi_bbox_build_slice (unsigned int start_value, unsigned int stop_value, const string &dim_name)
 Build a single element of a bounding box. More...
 
void roi_bbox_get_slice_data (Array *slices, unsigned int i, int &start, int &stop, string &name)
 This method extracts values from one element of the Bounding Box (i.e., Array of Structures). More...
 
void roi_bbox_valid_slice (BaseType *btp)
 Each Bounding Box is made up of a number of 'slices' - test if a given one is valid. More...
 
unsigned int roi_valid_bbox (BaseType *btp)
 Is the bound box valid? More...
 
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)
 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. More...
 

Variables

string bind_name_info
 
string bind_shape_info
 
string linear_scale_info
 
string make_array_info
 

Detailed Description

static class NCMLUtil overview

This is a repository for generic, reusable functions that many locations in the module might need.

The class design is meant to try and minimize outside dependencies beyond libdap, but already we have some BES dependencies.

Refactor out the purely libdap util functions into a LibdapUtil class so that this class can be reused within the agg_util module without introducing BES or ncml_module dependencies.

Enumeration Type Documentation

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 47 of file GSEClause.h.

Function Documentation

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

Definition at line 166 of file grid_utils.cc.

Referenced by function_geogrid(), and function_grid().

BaseType* libdap::bind_shape_worker ( string  shape,
BaseType *  btp 
)

Definition at line 59 of file BindShapeFunction.cc.

References parse_dims().

Referenced by function_bind_shape_dap2(), and function_bind_shape_dap4().

Here is the call graph for this function:

void libdap::function_bind_name_dap2 ( int  argc,
BaseType *  argv[],
DDS &  dds,
BaseType **  btpp 
)

Bind a new name to a variable.

The linear_scale() function applies the familiar y = mx + b equation to data.

The first argument to the function is the new name and the second argument is the BaseType* to (re)name. This function can be used to assign a name to an anonymous variable or change the name of a variable. If the variable is already part of the dataset, this function will make a copy and operate on that. In that case, the function will also read values into the variable.

Parameters
argcA count of the arguments
argvAn array of pointers to each argument, wrapped in a child of BaseType
btppA pointer to the return value; caller must delete.
Returns
The newly (re)named variable.
Exceptions
ErrorThrown for a variety of errors.

Definition at line 72 of file BindNameFunction.cc.

Referenced by libdap::BindNameFunction::BindNameFunction().

BaseType * libdap::function_bind_name_dap4 ( D4RValueList *  args,
DMR &  dmr 
)

Definition at line 135 of file BindNameFunction.cc.

Referenced by libdap::BindNameFunction::BindNameFunction().

void libdap::function_bind_shape_dap2 ( int  argc,
BaseType *  argv[],
DDS &  ,
BaseType **  btpp 
)

Bind a shape to a DAP2 Array that is a vector.

The product of the dimension sizes must match the number of elements in the vector. This function takes two arguments: A shape expression and a BaseType* to the DAP2 Array that holds the data. In practice, the Array can already have a shape (it's a vector, so that is a shape, e.g.) and this function simply changes that shape. The shape expression is the C bracket notation for array size and is parsed by this function.

Parameters
argcA count of the arguments
argvAn array of pointers to each argument, wrapped in a child of BaseType
btppA pointer to the return value; caller must delete.
Returns
The newly (re)named variable.
Exceptions
ErrorThrown for a variety of errors.

Definition at line 127 of file BindShapeFunction.cc.

References bind_shape_worker().

Referenced by libdap::BindShapeFunction::BindShapeFunction().

Here is the call graph for this function:

BaseType * libdap::function_bind_shape_dap4 ( D4RValueList *  args,
DMR &  dmr 
)

Bind a shape to a DAP4 Array that is a vector.

The linear_scale() function applies the familiar y = mx + b equation to data.

The product of the dimension sizes must match the number of elements in the vector. This function takes two arguments: A shape expression and a BaseType* to the DAP2 Array that holds the data. In practice, the Array can already have a shape (it's a vector, so that is a shape, e.g.) and this function simply changes that shape. The shape expression is the C bracket notation for array size and is parsed by this function.

Parameters
argsThe DAP4 function arguments list
dmrThe DMR for the dataset in question
Returns
A pointer to the return value; caller must delete.
Exceptions
ErrorThrown for a variety of errors.

Definition at line 164 of file BindShapeFunction.cc.

References bind_shape_worker().

Referenced by libdap::BindShapeFunction::BindShapeFunction().

Here is the call graph for this function:

void libdap::function_dap2_bbox ( int  argc,
BaseType *  argv[],
DDS &  ,
BaseType **  btpp 
)

Return the bounding box for an array.

Given an N-dimensional Array of simple numeric types and two minimum and maximum values, return the indices of a N-dimensional bounding box. The indices are returned using an Array of Structure, where each element of the array holds the name, start index and stop index in fields with those names.

It is up to the caller to make use of the returned values; the array is not modified in any way other than to read in it's values (and set the variable's read_p property).

The returned Structure Array has the same name as the variable it applies to, so that error messages can reference the source variable.

Note
There are both DAP2 and DAP4 versions of this function.
Parameters
argcArgument count
argvArgument vector - variable in the current DDS
ddsThe current DDS
btppValue-result parameter for the resulting Array of Structure

Definition at line 85 of file BBoxFunction.cc.

References BESDEBUG, libdap::Odometer::end(), libdap::Odometer::indices(), max, min, libdap::Odometer::next(), libdap::Odometer::offset(), roi_bbox_build_empty_bbox(), and roi_bbox_build_slice().

Referenced by libdap::BBoxFunction::BBoxFunction().

Here is the call graph for this function:

void libdap::function_dap2_bbox_union ( int  argc,
BaseType *  argv[],
DDS &  ,
BaseType **  btpp 
)

Combine several bounding boxes, forming their union.

This combines N BBox variables (Array of Structure) forming either their union or intersection, depending on the last parameter's value ("union" or "inter[section]").

If the function is passed bboxes that have no intersection, an exception is thrown. This is so that callers will know why no data were returned. Otherwise, an empty response, while correct, could be baffling to the client.

Note
There are both DAP2 and DAP4 versions of this function.
Parameters
argcArgument count
argvArgument vector - variable in the current DDS
ddsThe current DDS
btppValue-result parameter for the resulting Array of Structure

Definition at line 71 of file BBoxUnionFunction.cc.

References max, min, roi_bbox_build_empty_bbox(), roi_bbox_build_slice(), roi_bbox_get_slice_data(), and roi_valid_bbox().

Referenced by libdap::BBoxUnionFunction::BBoxUnionFunction().

Here is the call graph for this function:

void libdap::function_dap2_linear_scale ( int  argc,
BaseType *  argv[],
DDS &  ,
BaseType **  btpp 
)

Given a BaseType, scale it using 'y = mx + b'.

The linear_scale() function applies the familiar y = mx + b equation to data.

Either provide the constants 'm' and 'b' or the function will look for the COARDS attributes 'scale_factor' and 'add_offset'.

Parameters
argcA count of the arguments
argvAn array of pointers to each argument, wrapped in a child of BaseType
btppA pointer to the return value; caller must delete.
Returns
The scaled variable, represented using Float64
Exceptions
ErrorThrown if scale_factor is not given and the COARDS attributes cannot be found OR if the source variable is not a numeric scalar, Array or Grid.

Definition at line 269 of file LinearScaleFunction.cc.

References BESDEBUG, and function_linear_scale_worker().

Referenced by libdap::LinearScaleFunction::LinearScaleFunction().

Here is the call graph for this function:

void libdap::function_dap2_roi ( int  argc,
BaseType *  argv[],
DDS &  ,
BaseType **  btpp 
)

Subset the N arrays using index slicing information.

This function should be called with a series of array variables, each of which are N-dimensions or greater, where the N common dimensions should all be the same size. The intent of this function is that a N-dimensional bounding box, provided in indicial space, will be used to subset each of the arrays. There are other functions that can be used to build these bounding boxes using values of dataset variables - see bbox() and bbox_union(). Taken together, the roi(), bbox() and bbox_union() functions can be used to subset a collection of Arrays where some arrays are taken to be dependent variables and others independent variables. The result is a subset of 'discrete coverage' the collection of independent and dependent variables define.

Parameters
argcArgument count
argvArgument vector - variable in the current DDS
ddsThe current DDS
btppValue-result parameter for the resulting Array of Structure

Definition at line 98 of file RoiFunction.cc.

References BESDEBUG, roi_bbox_get_slice_data(), and roi_valid_bbox().

Referenced by libdap::RoiFunction::RoiFunction().

Here is the call graph for this function:

void libdap::function_dap2_version ( int  ,
BaseType *  [],
DDS &  dds,
BaseType **  btpp 
)

This server-side function returns version information for the server-side functions.

Note that this function takes no arguments and returns a String using the BaseType value/result parameter.

Parameters
btppA pointer to the return value; caller must delete. Change implementation to use libxml2 objects and NOT strings.

Definition at line 49 of file VersionFunction.cc.

Referenced by libdap::VersionFunction::VersionFunction().

BaseType * libdap::function_dap4_bbox ( D4RValueList *  ,
DMR &   
)

Return the bounding box for an array.

Note
The main difference between this function and the DAP2 version is to use args->size() in place of argc and args->get_rvalue(n)->value(dmr) in place of argv[n].
Not yet implemented.
See also
function_dap2_bbox

Definition at line 290 of file BBoxFunction.cc.

Referenced by libdap::BBoxFunction::BBoxFunction().

BaseType * libdap::function_dap4_bbox_union ( D4RValueList *  ,
DMR &   
)

Combine several bounding boxes, forming their union.

Note
The main difference between this function and the DAP2 version is to use args->size() in place of argc and args->get_rvalue(n)->value(dmr) in place of argv[n].
Not yet implemented.
See also
function_dap2_bbox

Definition at line 172 of file BBoxUnionFunction.cc.

Referenced by libdap::BBoxUnionFunction::BBoxUnionFunction().

BaseType * libdap::function_dap4_linear_scale ( D4RValueList *  args,
DMR &  dmr 
)

Given a BaseType, scale it using 'y = mx + b'.

The linear_scale() function applies the familiar y = mx + b equation to data.

Either provide the constants 'm' and 'b' or the function will look for the COARDS attributes 'scale_factor' and 'add_offset'.

Parameters
argcA count of the arguments
argvAn array of pointers to each argument, wrapped in a child of BaseType
btppA pointer to the return value; caller must delete.
Returns
The scaled variable, represented using Float64
Exceptions
ErrorThrown if scale_factor is not given and the COARDS attributes cannot be found OR if the source variable is not a numeric scalar, Array or Grid.

Definition at line 337 of file LinearScaleFunction.cc.

References BESDEBUG, and function_linear_scale_worker().

Referenced by libdap::LinearScaleFunction::LinearScaleFunction().

Here is the call graph for this function:

BaseType * libdap::function_dap4_roi ( D4RValueList *  ,
DMR &   
)

Return the bounding box for an array.

Note
The main difference between this function and the DAP2 version is to use args->size() in place of argc and args->get_rvalue(n)->value(dmr) in place of argv[n].
See also
function_dap2_bbox

Definition at line 186 of file RoiFunction.cc.

Referenced by libdap::RoiFunction::RoiFunction().

BaseType * libdap::function_dap4_version ( D4RValueList *  ,
DMR &  dmr 
)

This server-side function returns version information for the server-side functions.

Note that this function takes no arguments and returns a String using the BaseType value/result parameter.

Parameters
btppA pointer to the return value; caller must delete. Change implementation to use libxml2 objects and NOT strings.

Definition at line 91 of file VersionFunction.cc.

Referenced by libdap::VersionFunction::VersionFunction().

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

The geogrid function returns the part of a Grid which 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 80 of file GeoGridFunction.cc.

References libdap::GridGeoConstraint::apply_constraint_to_data(), apply_grid_selection_expressions(), libdap::GridGeoConstraint::get_constrained_grid(), libdap::gse_arg::get_gsec(), gse_arg, parse_gse_expression(), and libdap::GeoConstraint::set_bounding_box().

Referenced by libdap::GeoGridFunction::GeoGridFunction().

Here is the call graph for this function:

void libdap::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 74 of file GridFunction.cc.

References apply_grid_selection_expressions(), libdap::gse_arg::get_gsec(), gse_arg, and parse_gse_expression().

Referenced by libdap::GridFunction::GridFunction().

Here is the call graph for this function:

BaseType* libdap::function_linear_scale_worker ( BaseType *  bt,
double  m,
double  b,
double  missing,
bool  use_missing 
)

Definition at line 164 of file LinearScaleFunction.cc.

References BESDEBUG.

Referenced by function_dap2_linear_scale(), and function_dap4_linear_scale().

void libdap::function_make_dap2_array ( int  argc,
BaseType *  argv[],
DDS &  dds,
BaseType **  btpp 
)

Build a new DAP Array variable.

The make_array function .

Read the type, shape and values from the arg list. The variable will be named anon<number> and is guaranteed not to shadow the name of an existing variable in the DDS.

See also
function_bind_name
Parameters
argcA count of the arguments
argvAn array of pointers to each argument, wrapped in a child of BaseType
btppA pointer to the return value; caller must delete.
Returns
The new DAP Array variable.
Exceptions
ErrorThrown for a variety of errors.

Definition at line 255 of file MakeArrayFunction.cc.

References BESDEBUG, and parse_dims().

Referenced by libdap::MakeArrayFunction::MakeArrayFunction().

Here is the call graph for this function:

BaseType * libdap::function_make_dap4_array ( D4RValueList *  args,
DMR &  dmr 
)

The linear_scale() function applies the familiar y = mx + b equation to data.

Definition at line 361 of file MakeArrayFunction.cc.

References BESDEBUG, and parse_dims().

Referenced by libdap::MakeArrayFunction::MakeArrayFunction().

Here is the call graph for this function:

void libdap::function_swath2array ( int  argc,
BaseType *  argv[],
DDS &  ,
BaseType **  btpp 
)
Todo:
The lat and lon arrays are passed in, but there's an assumption that the source data array and the two lat and lon arrays are the same shape. But the code does not actually test that.
Todo:
Enable multiple bands paired with just the two lat/lon arrays? Not sure if that is a good idea...

Definition at line 90 of file reproj_functions.cc.

References libdap::DAP_Dataset::GetDAPArray(), and libdap::DAP_Dataset::InitialDataset().

Referenced by libdap::SwathToArray::SwathToArray().

Here is the call graph for this function:

void libdap::function_swath2grid ( int  argc,
BaseType *  argv[],
DDS &  ,
BaseType **  btpp 
)
Todo:
The lat and lon arrays are passed in, but there's an assumption that the source data array and the two lat and lon arrays are the same shape. But the code does not actually test that.
Todo:
Enable multiple bands paired with just the two lat/lon arrays? Not sure if that is a good idea...

Definition at line 152 of file reproj_functions.cc.

References libdap::DAP_Dataset::GetDAPGrid(), and libdap::DAP_Dataset::InitialDataset().

Referenced by libdap::SwathToGrid::SwathToGrid().

Here is the call graph for this function:

void libdap::getGrids ( 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 54 of file grid_utils.cc.

Referenced by libdap::GeoGridFunction::canOperateOn(), libdap::GridFunction::canOperateOn(), and getGrids().

void libdap::getGrids ( 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 87 of file grid_utils.cc.

References getGrids().

Here is the call graph for this function:

bool libdap::isGeoGrid ( Grid *  grid)

Evaluates a Grid to see if has suitable semantics for use with function_geogrid.

Note
Add an 'is' method to GeoGrid so that this code can its logic without having it throw an exception.
Parameters
gridthe Grid to evaluate.
Returns
True if the grid will work with the GeoGrid function, otherwise false.

Definition at line 104 of file grid_utils.cc.

Referenced by libdap::GeoGridFunction::canOperateOn().

bool libdap::isValidTypeMatch ( Type  requestedType,
Type  argType 
)

Definition at line 108 of file MakeArrayFunction.cc.

vector< int > libdap::parse_dims ( const string &  shape)

Parse the shape 'expression'.

The form of the expression is '[' size ']'

Note
Also used by bind_shape()
Returns
A vector of ints

Definition at line 74 of file MakeArrayFunction.cc.

Referenced by bind_shape_worker(), function_make_dap2_array(), and function_make_dap4_array().

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

Definition at line 116 of file grid_utils.cc.

References gse_delete_buffer(), gse_parse(), gse_restart(), and gse_string().

Referenced by function_geogrid(), and function_grid().

Here is the call graph for this function:

auto_ptr< Array > libdap::roi_bbox_build_empty_bbox ( unsigned int  num_dim,
const string &  bbox_name 
)

Build an empty Bounding Box using DAP variables.

A bbox is made up of an Array of Structures, where each Structure has three fields. The fields are the start and stop indices for the given dimension along with its name. The Array will have one dimension, with an element for each dimension in the source variable.

By default the bbox is named 'bbox'

Parameters
num_dimInitialize the array with this number of dimensions; corresponds to the rank of the associated variable.
dim_nameThe name for the Array's single dimension - not really that useful...
bbpx_nameDefaults to 'bbox', this is the name for the bbox Array. Setting this to the name of the associated dataset variable can make for more intelligible error messages.

Definition at line 192 of file roi_utils.cc.

Referenced by function_dap2_bbox(), and function_dap2_bbox_union().

Structure * libdap::roi_bbox_build_slice ( unsigned int  start_value,
unsigned int  stop_value,
const string &  dim_name 
)

Build a single element of a bounding box.

Use this with an existing bounding box - first build an empty bbox and then add individual elements by building them with this function and using Array::add_vec_nocopy(...) to populate the bbox with elements that describe the start, stop and names of the bbox's different dimensions.

A bbox will have N-elements in a one-dimensional array that correspond to the N-dimensions of the 'source' dataset variable. This function builds one of those elements but it's up to the caller to correctly add the element to the bbox.

Parameters
start_valueThe starting index for the 'slice'
stop_valueThe stopping index
dim_nameThe slice/dimension name - this should match the dataset variable's dimension name.

Definition at line 153 of file roi_utils.cc.

Referenced by function_dap2_bbox(), and function_dap2_bbox_union().

void libdap::roi_bbox_get_slice_data ( Array *  slices,
unsigned int  i,
int &  start,
int &  stop,
string &  name 
)

This method extracts values from one element of the Bounding Box (i.e., Array of Structures).

It assumes that the input has been validated.

Parameters
slicesThe Bounding Box (which is made up of 'slices' of different dimensions of the dataset's variable
iGet this element of the bbox array - corresponds to the ith dimension of the dataset variable
startStart index
stopStop index
nameCorresponding dimension name of the dataset variable

Definition at line 122 of file roi_utils.cc.

Referenced by function_dap2_bbox_union(), and function_dap2_roi().

void libdap::roi_bbox_valid_slice ( BaseType *  btp)

Each Bounding Box is made up of a number of 'slices' - test if a given one is valid.

A bounding box is an Array of Structures, where each Structure element of the array is one 'slice' of a dimension of some dataset variable. This function can be used to test each of those elements/slices to see if they have the correct form. This function throws an exception if the 'slice' is not valid, otherwise it simply returns.

Parameters
btpA BaseType* - the type used to pass arguments into server functions - that should reference a Structure that has to form of a bbox element.
Exceptions
ErrorIf the slice is not valid

Definition at line 56 of file roi_utils.cc.

Referenced by roi_valid_bbox().

unsigned int libdap::roi_valid_bbox ( BaseType *  btp)

Is the bound box valid?

A Bounding Box is an Array of Structure variables that holds the start and stop indices for each dimension of some dependent variable. For each dimension of the dep. variable, there is one dimension in the BBox Array. In addition to the start and stop indices, the Structure holds the dimension's name.

Parameters
btpPointer to the Array of Structure that holds the slice information
Returns
The number of slices in the slice array
Exceptions
ErrorThrown if the array si not valid.

Definition at line 90 of file roi_utils.cc.

References roi_bbox_valid_slice().

Referenced by function_dap2_bbox_union(), and function_dap2_roi().

Here is the call graph for this function:

bool libdap::unit_or_name_match ( set< string >  units,
set< string >  names,
const string &  var_units,
const string &  var_name 
)
bool libdap::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 82 of file GeoConstraint.cc.

Variable Documentation

string libdap::bind_name_info
Initial value:
=
string("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") +
"<function name=\"make_array\" version=\"1.0\" href=\"http://docs.opendap.org/index.php/Server_Side_Processing_Functions#bind_name\">\n" +
"</function>"

Definition at line 53 of file BindNameFunction.cc.

string libdap::bind_shape_info
Initial value:
=
string("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") +
"<function name=\"make_array\" version=\"1.0\" href=\"http://docs.opendap.org/index.php/Server_Side_Processing_Functions#bind_shape\">\n" +
"</function>"

Definition at line 50 of file BindShapeFunction.cc.

string libdap::linear_scale_info
Initial value:
=
string("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") +
"<function name=\"linear_scale\" version=\"1.0b1\" href=\"http://docs.opendap.org/index.php/Server_Side_Processing_Functions#linear_scale\">\n" +
"</function>"

Definition at line 50 of file LinearScaleFunction.cc.

string libdap::make_array_info
Initial value:
=
string("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") +
"<function name=\"make_array\" version=\"1.0\" href=\"http://docs.opendap.org/index.php/Server_Side_Processing_Functions#make_array\">\n" +
"</function>"

Definition at line 64 of file MakeArrayFunction.cc.