|
OPeNDAP Hyrax Back End Server (BES)
Updated for version 3.8.3
|
Utilities used to help in the return of an OPeNDAP DataDDS object as a netcdf file. More...
#include <FONcUtils.h>

Static Public Member Functions | |
| static FONcBaseType * | convert (BaseType *v) |
| creates a FONc object for the given DAP object More... | |
| static string | gen_name (const vector< string > &embed, const string &name, string &original) |
| generate a new name for the embedded variable More... | |
| static nc_type | get_nc_type (BaseType *element) |
| translate the OPeNDAP data type to a netcdf data type More... | |
| static void | handle_error (int stax, string &err, const string &file, int line) |
| handle any netcdf errors More... | |
| static string | id2netcdf (string in) |
| convert the provided string to a netcdf allowed identifier. More... | |
| static void | reset () |
| Resets the FONc transformation for a new input and out file. More... | |
Static Public Attributes | |
| static string | name_prefix = "" |
| If a variable name, dimension name, or attribute name begins with a character that is not supported by netcdf, then use this prefix to prepend to the name. More... | |
Utilities used to help in the return of an OPeNDAP DataDDS object as a netcdf file.
This class includes static functions to help with the conversion of an OPeNDAP DataDDS object into a netcdf file.
Definition at line 55 of file FONcUtils.h.
|
static |
creates a FONc object for the given DAP object
| v | The DAP object to convert |
| BESInternalError | if the DAP object is not an expected type |
Definition at line 178 of file FONcUtils.cc.
Referenced by FONcStructure::convert(), and FONcTransform::transform().
|
static |
generate a new name for the embedded variable
This function takes the name of a variable as it exists in a data file, and generates a new name given that netcdf does not have structures or grids. Variables within structures and grids are considered embedded variables, so a new name needs to be generated.
The new name is then passed top id2netcdf to remove any characters that are not allowed by netcdf.
| embed | A list of names for parent structures |
| name | The name of the variable to use for the new name |
| original | The variable name before calling id2netcdf |
Definition at line 150 of file FONcUtils.cc.
References FONC_EMBEDDED_SEPARATOR, and id2netcdf().
Referenced by FONcSequence::convert(), FONcGrid::convert(), FONcArray::convert(), FONcStr::define(), and FONcBaseType::define().

|
static |
translate the OPeNDAP data type to a netcdf data type
| element | The OPeNDAP element to translate |
Definition at line 103 of file FONcUtils.cc.
Referenced by FONcArray::convert().
|
static |
handle any netcdf errors
Looks up the netcdf error message associated with the provided netcdf return value and throws an exception with that information appended to the provided error message
| stax | A netcdf return value, NC_NOERR if no error occurred |
| err | A provided error message to begin the error message with |
| file | The source code file name where the error was generated |
| line | The source code line number where the error was generated |
| BESInternalError | if the return value represents a netcdf error |
Definition at line 238 of file FONcUtils.cc.
Referenced by FONcAttributes::add_original_name(), FONcSequence::define(), FONcStr::define(), FONcDim::define(), FONcBaseType::define(), FONcArray::define(), FONcBaseType::isNetCDF4(), FONcTransform::transform(), FONcFloat::write(), FONcDouble::write(), FONcInt::write(), FONcShort::write(), FONcByte::write(), FONcStr::write(), and FONcArray::write().
|
static |
convert the provided string to a netcdf allowed identifier.
The function makes a copy of the incoming parameter to use and returns the new string.
| in | identifier to convert |
Definition at line 73 of file FONcUtils.cc.
References name_prefix.
Referenced by FONcDim::define(), and gen_name().
|
static |
Resets the FONc transformation for a new input and out file.
Definition at line 56 of file FONcUtils.cc.
References FONcArray::Dimensions, FONcDim::DimNameNum, and FONcGrid::Maps.
Referenced by FONcTransform::transform().
|
static |
If a variable name, dimension name, or attribute name begins with a character that is not supported by netcdf, then use this prefix to prepend to the name.
Definition at line 58 of file FONcUtils.h.
Referenced by FONcTransform::FONcTransform(), and id2netcdf().