libdap Namespace Reference


Functions

bool double_eq (double lhs, double rhs, double epsilon=1.0e-5)
double * extract_double_array (Array *a)
double extract_double_value (BaseType *arg)
string extract_string_argument (BaseType *arg)
BaseTypefunc_one (int argc, BaseType *argv[], DDS &dds, const string &dataset)
BaseTypefunction_geoarray (int argc, BaseType *argv[], DDS &, const string &dataset)
BaseTypefunction_geogrid (int argc, BaseType *argv[], DDS &, const string &dataset)
BaseTypefunction_grid (int argc, BaseType *argv[], DDS &, const string &dataset)
BaseTypefunction_linear_scale (int argc, BaseType *argv[], DDS &, const string &dataset)
BaseTypefunction_version (int, BaseType *[], DDS &, const string &)
void register_functions (ConstraintEvaluator &ce)
void set_array_using_double (Array *dest, double *src, int src_len)


Function Documentation

bool libdap::double_eq ( double  lhs,
double  rhs,
double  epsilon = 1.0e-5 
) [inline]

Is lhs equal to rhs? Use epsilon to determine equality.

Definition at line 93 of file ce_functions.cc.

Referenced by function_linear_scale().

double * libdap::extract_double_array ( Array a  ) 

Given a pointer to an Array which holds a numeric type, extract the values and return in an array of doubles. This function allocates the array using 'new double[n]' so delete[] can be used when you are done the data.

Definition at line 235 of file ce_functions.cc.

References dods_array_c, dods_byte_c, dods_float32_c, dods_float64_c, dods_int16_c, dods_int32_c, dods_str_c, dods_uint16_c, dods_uint32_c, dods_url_c, BaseType::is_simple_type(), malformed_expr, BaseType::name(), BaseType::read_p(), BaseType::type(), and Vector::var().

Referenced by function_linear_scale().

Here is the call graph for this function:

double libdap::extract_double_value ( BaseType arg  ) 

Given a BaseType pointer, extract the numeric value it contains and return it in a C++ double.

Parameters:
arg The BaseType pointer
Returns:
A C++ double
Exceptions:
Error thrown if the referenced BaseType object does not contain a DAP numeric value.

Definition at line 281 of file ce_functions.cc.

References BaseType::buf2val(), DBG, dods_byte_c, dods_float32_c, dods_float64_c, dods_int16_c, dods_int32_c, dods_str_c, dods_uint16_c, dods_uint32_c, dods_url_c, BaseType::is_simple_type(), malformed_expr, BaseType::read_p(), and BaseType::type().

Referenced by function_geoarray(), function_geogrid(), and function_linear_scale().

Here is the call graph for this function:

string libdap::extract_string_argument ( BaseType arg  ) 

Given a BaseType pointer, extract the string value it contains and return it.

Parameters:
arg The BaseType pointer
Returns:
A C++ string
Exceptions:
Error thrown if the referenced BaseType object does not contain a DAP String.

Definition at line 108 of file ce_functions.cc.

References BaseType::buf2val(), DBG, dods_str_c, malformed_expr, BaseType::read_p(), and BaseType::type().

Referenced by function_geoarray().

Here is the call graph for this function:

BaseType* libdap::func_one ( int  argc,
BaseType argv[],
DDS dds,
const string &  dataset 
)

BaseType * libdap::function_geoarray ( int  argc,
BaseType argv[],
DDS dds,
const string &  dataset 
)

Perform a selection on the array using geographical coordinates. This function takes several groups of arguments.

Note:
Only the plat-carre projection and wgs84 datum are currently supported.
Parameters:
argc 
argv 
dds 
dataset 
Returns:
The Array, constrained by the selection
Exceptions:
Error Thrown if thins go awry.

Definition at line 996 of file ce_functions.cc.

References ArrayGeoConstraint::apply_constraint_to_data(), DBG, extract_double_value(), extract_string_argument(), ArrayGeoConstraint::get_constrained_array(), BaseType::ptr_duplicate(), GeoConstraint::set_bounding_box(), and Str::set_value().

Referenced by register_functions().

Here is the call graph for this function:

BaseType * libdap::function_geogrid ( int  argc,
BaseType argv[],
DDS dds,
const string &  dataset 
)

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:

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:
argc The number of values in argv.
argv An 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.
dds The DDS which holds the Grid. This DDS must include attributes.
dataset Name of the dataset.
Returns:
The constrained and read Grid, ready to be sent.

Definition at line 616 of file ce_functions.cc.

References GridGeoConstraint::apply_constraint_to_data(), DBG, extract_double_value(), Grid::get_array(), GridGeoConstraint::get_constrained_grid(), gse_arg::get_gsec(), Grid::map_begin(), Grid::map_end(), BaseType::ptr_duplicate(), BaseType::read(), GeoConstraint::set_bounding_box(), Vector::set_read_p(), and Str::set_value().

Referenced by register_functions().

Here is the call graph for this function:

BaseType * libdap::function_grid ( int  argc,
BaseType argv[],
DDS dds,
const string &  dataset 
)

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:

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.
Todo:
In order to be used by geogrid() , this code may have to be modified so that the maps and array are not re-read by the serialize() method. It might also be a good idea to change from the '?grid(SST,"10<time<20")' syntax in a URL to '?SST&grid(SST,"10<time<20")' even though it's more verbose in the URL, it would make the function a true 'selection operator' and allow several grids to be returned with selections in one request.
Parameters:
argc The number of values in argv.
argv An 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.
dds The DDS which holds the Grid.
dataset Name of the dataset.
See also:
geogrid() (func_geogrid_select) A function which has logic specific to longitude/latitude selection.

Definition at line 503 of file ce_functions.cc.

References DBG, Grid::get_array(), gse_arg::get_gsec(), Grid::map_begin(), Grid::map_end(), Grid::ptr_duplicate(), BaseType::read(), Vector::set_send_p(), and Str::set_value().

Referenced by register_functions().

Here is the call graph for this function:

BaseType * libdap::function_linear_scale ( int  argc,
BaseType argv[],
DDS dds,
const string &  dataset 
)

Given a BaseType, scale it using 'y = mx + b'. Either provide the constants 'm' and 'b' or the function will look for the COARDS attributes 'scale_factor' and 'add_offset'.

Parameters:
argc 
argv 
dds 
dataset 
Returns:
The scaled variable, represented using Float64
Exceptions:
Error Thrown 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 838 of file ce_functions.cc.

References Array::add_var(), DBG, DBG2, dods_grid_c, dods_str_c, dods_url_c, double_eq(), extract_double_array(), extract_double_value(), BaseType::get_parent(), Vector::length(), BaseType::name(), BaseType::read(), Vector::set_send_p(), Str::set_value(), BaseType::type(), BaseType::val2buf(), and Vector::val2buf().

Referenced by register_functions().

Here is the call graph for this function:

BaseType* libdap::function_version ( int  ,
BaseType [],
DDS ,
const string &   
)

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

Definition at line 384 of file ce_functions.cc.

References Str::set_value().

Referenced by register_functions().

Here is the call graph for this function:

void libdap::register_functions ( ConstraintEvaluator ce  ) 

Definition at line 1085 of file ce_functions.cc.

References ConstraintEvaluator::add_function(), function_geoarray(), function_geogrid(), function_grid(), function_linear_scale(), and function_version().

Referenced by ConstraintEvaluator::ConstraintEvaluator().

Here is the call graph for this function:

void libdap::set_array_using_double ( Array dest,
double *  src,
int  src_len 
)

Given an array that holds some sort of numeric data, load it with values using an array of doubles. This function makes several assumptions. First, it assumes the caller really wants to put the doubles into whatever types the array holds! Caveat emptor. Second, it assumes that if the size of source (src) array is different than the destination (dest) the caller has made a mistake. In that case it will throw an Error object.

After setting that values, this method sets the read_p property for dest.

Parameters:
dest An Array. The values are written to this array, reusing its storage. Existing values are lost.
src The source data.
src_len The number of elements in the src array.
Exceptions:
Error Thrown if dest is not a numeric-type array (Byte, ..., Float64) or if the number of elements in src does not match the number is dest.

Definition at line 157 of file ce_functions.cc.

References dods_array_c, dods_byte_c, dods_float32_c, dods_float64_c, dods_int16_c, dods_int32_c, dods_str_c, dods_uint16_c, dods_uint32_c, dods_url_c, BaseType::is_simple_type(), Vector::length(), long_to_string(), Vector::set_read_p(), BaseType::type(), and Vector::var().

Referenced by GridGeoConstraint::apply_constraint_to_data().

Here is the call graph for this function:


Generated on Wed Jun 27 12:58:34 2007 for libdap++ by  doxygen 1.4.7