32#include <BESInternalError.h>
34#include <libdap/Float32.h>
38#include "FONcAttributes.h"
51 _f =
dynamic_cast<Float32 *
>(b) ;
54 string s = (string)
"File out netcdf, FONcFloat was passed a "
55 +
"variable that is not a DAP Float32" ;
87 D4Attributes *d4_attrs = _f->attributes();
88 updateD4AttrType(d4_attrs,NC_FLOAT);
91 AttrTable &attrs = _f->get_attr_table();
92 updateAttrType(attrs,NC_FLOAT);
98 _varname, _orig_varname ) ;
116 BESDEBUG(
"fonc",
"FONcFloat::write for var " << _varname << endl ) ;
117 size_t var_index[] = {0} ;
118 float *data =
new float ;
123 _f->intern_data(*get_eval(), *get_dds());
125 _f->buf2val( (
void**)&data ) ;
126 int stax = nc_put_var1_float( ncid, _varid, var_index, data ) ;
127 ncopts = NC_VERBOSE ;
128 if( stax != NC_NOERR )
130 string err = (string)
"fileout.netcdf - "
131 +
"Failed to write float data for "
136 BESDEBUG(
"fonc",
"FONcFloat::done write for var " << _varname << endl ) ;
168 strm << BESIndent::LMarg <<
"FONcFloat::dump - ("
169 << (
void *)
this <<
")" << endl ;
170 BESIndent::Indent() ;
171 strm << BESIndent::LMarg <<
"name = " << _f->name() << endl ;
172 BESIndent::UnIndent() ;
exception thrown if internal error encountered
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.
A DAP BaseType with file out netcdf information included.
virtual void define(int ncid)
Define the variable in the netcdf file.
virtual nc_type type()
returns the netcdf type of the DAP Float32
virtual void write(int ncid)
Write the float out to the netcdf file.
virtual string name()
returns the name of the DAP Float32
FONcFloat(libdap::BaseType *b)
Constructor for FONcFloat that takes a DAP Float32.
virtual void dump(ostream &strm) const
dumps information about this object for debugging purposes
virtual void define(int ncid)
define the DAP Float32 in the netcdf file
virtual ~FONcFloat()
Destructor that cleans up this instance.
static void handle_error(int stax, const string &err, const string &file, int line)
handle any netcdf errors