bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
|
A class that provides static methods to help write out attributes for a given variable. More...
#include <FONcAttributes.h>
Static Public Member Functions | |
static void | add_attributes (int ncid, int varid, AttrTable &attrs, const string &var_name, const string &prepend_attr, bool is_netCDF_enhanced) |
helper function for add_attributes | |
static void | add_dap4_attributes (int ncid, int varid, D4Attributes *d4_attrs, const string &var_name, const string &prepend_attr, bool is_netCDF_enhanced) |
add_dap4_attributes | |
static void | add_original_name (int ncid, int varid, const string &var_name, const string &orig) |
Adds an attribute for the variable if the variable name had to be modified in any way. | |
static void | add_variable_attributes (int ncid, int varid, BaseType *b, bool is_netCDF_enhanced, bool is_dap4) |
Add the attributes for an OPeNDAP variable to the netcdf file. | |
static void | write_attrs_for_nc4_types (int ncid, int varid, const string &var_name, const string &global_attr_name, const string &var_attr_name, AttrTable attrs, AttrTable::Attr_iter &attr, bool is_nc_enhanced) |
writes out a single attribute that maps the datatype to netCDF-4 | |
static void | write_dap4_attrs_for_nc4_types (int ncid, int varid, const string &var_name, const string &global_attr_name, const string &var_attr_name, D4Attribute *attr, bool is_nc_enhanced) |
writes out a single attribute that maps the dap4 datatype to netCDF-4 | |
A class that provides static methods to help write out attributes for a given variable.
Given a BaseType from a DataDDS, these functions can write out attributes for that BaseType as well as all parent classes of that BaseType. Since netcdf is a flattened data structure, any variables within a structure or grid will write out attributes for the structure or grid along with its own attributes.
Definition at line 54 of file FONcAttributes.h.
|
static |
helper function for add_attributes
ncid | The id of the netcdf file being written to |
varid | The netcdf variable id |
attrs | The OPeNDAP AttrTable containing the attributes |
var_name | A string to prepend to the attribute name |
prepend_attr | Any name to prepend to the name of the attribute. As far as I know, this is no longer used; when standard attributes are prefixed client programs will (often) fail to recognize the standard attributes (since the names are no longer really standard). |
is_nc_enhanced | A flag to indicate if we want to map datatypes to netCDF-4 |
BESInternalError | if there are any problems writing out the attributes for the data object. |
Definition at line 147 of file FONcAttributes.cc.
|
static |
add_dap4_attributes
ncid | The id of the netcdf file being written to |
varid | The netcdf variable id |
attrs | The OPenDAP DAP4 attributes |
var_name | any variable name to prepend to the attribute name |
prepend_attr | Any name to prepend to the name of the attribute. As far as I know, this is no longer used; when standard attributes are prefixed client programs will (often) fail to recognize the standard attributes (since the names are no longer really standard). |
is_nc_enhanced | The flag to indicate if we want to map datatypes to netCDF-4 |
BESInternalError | if there are any problems writing out the attributes for the data object. |
Definition at line 177 of file FONcAttributes.cc.
|
static |
Adds an attribute for the variable if the variable name had to be modified in any way.
When generating a new name for a variable, the original name might contain characters that are not allowed in netcdf files. For this reason, the characters are modified and we add an attribute to the netcdf file for that variable to signify the change.
ncid | The id of the netcdf open file |
varid | The id of the variable to add the attribute to |
var_name | The name of the variable as it appears in the new * file |
orig | The name of the variable before it was modified |
Definition at line 796 of file FONcAttributes.cc.
|
static |
Add the attributes for an OPeNDAP variable to the netcdf file.
This method writes out any attributes for the provided variable and for any parent BaseType objects of this variable. For example, if this variable is a part of a structure, which is a part of another structure, then we write out all of the attributes for the outermost structure, the inner structure, and the variable of the structure. For example, if there is a structure Alpha with attribute a1, that contains a structure Point with attribute s2, which contains two variables x, with attribute a3, and y, with attribute a4, then variable Alpha.Point.x will contain attributes Alpha.a1, Alpha.Point.s2, and a3 and Alpha.Point.y will contain attributes Alpha.a1, Alpha.Point.s2, and a4.
Attributes can also be attribute containers, and not just simple attributes. In this case, just as with structures, we flatten out the attribute containers. For example, if there is an attribute container called name, with attributes first and last contained in it, then two attributes are created called name.first and name.last.
OPeNDAP can have multiple string values for a given attribute. This can not be represented in netcdf3 (can in netcdf4). To accomplish this we take each of the string values for the given attribute and append them together using a newline as a separator (recommended by Unidata).
ncid | The id of the netcdf file being written to |
varid | The netcdf variable id to associate the attributes to |
b | The OPeNDAP variable containing the attributes. |
is_nc_enhanced | The flag to indicate if we want to map datatypes to netCDF-4 |
BESInternalError | if there is a problem writing the attributes for the variable. |
Definition at line 79 of file FONcAttributes.cc.
|
static |
writes out a single attribute that maps the datatype to netCDF-4
ncid | The id of the netcdf file being written to |
varid | The netcdf variable id |
var_name | the name of the variable (flattened) |
global_attr_name | the name of the global attribute name |
var_attr_name | the name of the variable name |
attrs | the AttrTable that contains the attribute to be written |
attr | the iterator into the AttrTable for the attribute to be written |
is_nc_enhanced | The flag to indicate if we want to map datatypes to netCDF-4 |
BESInternalError | if there is a problem writing this attribute Note: This function only maps DAP2 attribute types to NC4. |
Definition at line 825 of file FONcAttributes.cc.
|
static |
writes out a single attribute that maps the dap4 datatype to netCDF-4
ncid | The id of the netcdf file being written to |
varid | The netcdf variable id |
var_name | the name of the variable (flattened) |
global_attr_name | the name of the global attribute name |
var_attr_name | the name of the variable name |
attr | the DAP4 attribute to be written |
is_nc_enhanced | The flag to indicate if we want to map datatypes to netCDF-4 |
BESInternalError | if there is a problem writing this attribute Note: the DAP4 attributes are mapped to NC4. Now only 64-bit integer are added. |
Definition at line 1085 of file FONcAttributes.cc.