bes
Updated for version 3.20.6
|
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, const 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 54 of file FONcUtils.h.
|
static |
Creates a FONc object for the given DAP object.
This is a simple factory for FONcBaseType objects that maps the DAP2 data types into netCDF3 and netCDF4 types (actually instances of FONcBaseType's specializations).
v | The DAP object to convert |
BESInternalError | if the DAP object is not an expected type |
Definition at line 182 of file FONcUtils.cc.
|
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 148 of file FONcUtils.cc.
|
static |
translate the OPeNDAP data type to a netcdf data type
element | The OPeNDAP element to translate |
Definition at line 102 of file FONcUtils.cc.
|
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. Should be any value other than NC_NOERR |
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 |
BESError | if the return value represents a netcdf error |
Definition at line 245 of file FONcUtils.cc.
|
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 75 of file FONcUtils.cc.
|
static |
Resets the FONc transformation for a new input and out file.
Definition at line 59 of file FONcUtils.cc.
|
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 56 of file FONcUtils.h.