Next: Class NcAtt, Previous: Class NcTypedComponent, Up: NetCDF Classes
NcVar
is derived from NcTypedComponent, and represents a netCDF
variable. A netCDF variable has a name, a type, a shape, zero or more
attributes, and a block of values associated with it. Because variables
are only associated with open netCDF files, there are no public
constructors for this class. Use member functions of NcFile
to
get variables or add new variables.
NcToken name( void ) const
NcType type( void ) const
ncByte
, ncChar
, ncShort
, ncInt
,
ncFloat
, or ncDouble
.
int num_dims( void ) const
NcDim* get_dim( int n ) const
long* edges( void ) const
int num_atts( void ) const
NcAtt* get_att( NcToken attname ) const
NcAtt* get_att( int n ) const
NcBool is_valid( void ) const
TRUE
if the variable is valid, FALSE
otherwise.
long num_vals( void ) const
NcValues* values( void ) const
get
member function instead, to get single
values or selected cross-sections of values.
NcBool put(const ncbyte* vals, long c0, long c1, long c2, long c3, long c4)
NcBool put(const char* vals, long c0, long c1, long c2, long c3, long c4)
NcBool put(const short* vals, long c0, long c1, long c2, long c3, long c4)
NcBool put(const int* vals, long c0, long c1, long c2, long c3, long c4)
NcBool put(const long* vals, long c0, long c1, long c2, long c3, long c4)
NcBool put(const float* vals, long c0, long c1, long c2, long c3, long c4)
NcBool put(const double* vals, long c0, long c1, long c2, long c3, long c4)
[0,0,..., 0]
by default, but may
be reset using the set_cur()
member function for this variable.
FALSE
is returned if type of values is not convertible to
external netCDF type for
variable. For more than 5 dimensions, use the overloaded n-dimensional
form of the put
member function.
NcBool put(const ncbyte* vals, const long* counts)
NcBool put(const char* vals, const long* counts)
NcBool put(const short* vals, const long* counts)
NcBool put(const int* vals, const long* counts)
NcBool put(const long* vals, const long* counts)
NcBool put(const float* vals, const long* counts)
NcBool put(const double* vals, const long* counts)
[0, 0, ..., 0]
by
default, may be reset with set_cur()
. FALSE
is returned
if type of values is not convertible to
external netCDF type for variable.
NcBool get(ncbyte* vals, long c0, long c1, long c2, long c3, long c4) const
NcBool get(char* vals, long c0, long c1, long c2, long c3, long c4) const
NcBool get(short* vals, long c0, long c1, long c2, long c3, long c4) const
NcBool get(int* vals, long c0, long c1, long c2, long c3, long c4) const
NcBool get(long* vals, long c0, long c1, long c2, long c3, long c4) const
NcBool get(float* vals, long c0, long c1, long c2, long c3, long c4) const
NcBool get(double* vals, long c0, long c1, long c2, long c3, long c4) const
[0,0,..., 0]
by default, but may
be reset using the set_cur()
member function. FALSE
is
returned if type of values is not convertible from
external netCDF type for variable.
NcBool get(ncbyte* vals, const long* counts) const
NcBool get(char* vals, const long* counts) const
NcBool get(short* vals, const long* counts) const
NcBool get(int* vals, const long* counts) const
NcBool get(long* vals, const long* counts) const
NcBool get(float* vals, const long* counts) const
NcBool get(double* vals, const long* counts) const
[0, 0, ..., 0]
by default,
may be reset with set_cur()
member function. FALSE
is
returned if type of values is not convertible from
external netCDF type for variable.
NcBool set_cur(long c0=-1, long c1=-1, long c2=-1, long c3=-1, long c4=-1)
NcBool set_cur(long* cur)
NcBool add_att( NcToken, char )
NcBool add_att( NcToken, ncbyte )
NcBool add_att( NcToken, short )
NcBool add_att( NcToken, int )
NcBool add_att( NcToken, long )
NcBool add_att( NcToken, float )
NcBool add_att( NcToken, double )
NcBool add_att( NcToken, const char* )
NcBool add_att( NcToken, int, const char* )
NcBool add_att( NcToken, int, const ncbyte* )
NcBool add_att( NcToken, int, const short* )
NcBool add_att( NcToken, int, const int* )
NcBool add_att( NcToken, int, const long* )
NcBool add_att( NcToken, int, const float* )
NcBool add_att( NcToken, int, const double* )
NcBool rename( NcToken newname )
ncbyte as_ncbyte( int n ) const
char as_char( int n ) const
short as_short( int n ) const
int as_int( int n ) const
nclong as_nclong( int n ) const // deprecated
long as_long( int n ) const
float as_float( int n ) const
double as_double( int n ) const
char* as_string( int n ) const
as_string
method.
int id( void ) const
NcBool sync( void )
~NcVar( void )
The following member functions are intended for record variables. They will also work for non-record variables, if the first dimension is interpreted as the record dimension.
long rec_size( void )
long rec_size( NcDim* )
NcValues* get_rec( void )
NcValues* get_rec( long n )
NcValues* get_rec( NcDim* )
NcValues* get_rec( NcDim*, long n )
NcBool put_rec( const ncbyte* vals )
NcBool put_rec( const char* vals )
NcBool put_rec( const short* vals )
NcBool put_rec( const int* vals )
NcBool put_rec( const long* vals )
NcBool put_rec( const float* vals )
NcBool put_rec( const double* vals )
NcBool put_rec( NcDim*, const ncbyte* vals )
NcBool put_rec( NcDim*, const char* vals )
NcBool put_rec( NcDim*, const short* vals )
NcBool put_rec( NcDim*, const int* vals )
NcBool put_rec( NcDim*, const long* vals )
NcBool put_rec( NcDim*, const float* vals )
NcBool put_rec( NcDim*, const double* vals )
NcBool put_rec( const ncbyte* vals, long rec )
NcBool put_rec( const char* vals, long rec )
NcBool put_rec( const short* vals, long rec )
NcBool put_rec( const int* vals, long rec )
NcBool put_rec( const long* vals, long rec )
NcBool put_rec( const float* vals, long rec )
NcBool put_rec( const double* vals, long rec )
NcBool put_rec( NcDim*, const ncbyte* vals, long slice )
NcBool put_rec( NcDim*, const char* vals, long slice )
NcBool put_rec( NcDim*, const short* vals, long slice )
NcBool put_rec( NcDim*, const int* vals, long slice )
NcBool put_rec( NcDim*, const long* vals, long slice )
NcBool put_rec( NcDim*, const float* vals, long slice )
NcBool put_rec( NcDim*, const double* vals, long slice )
long get_index( const ncbyte* vals )
long get_index( const char* vals )
long get_index( const short* vals )
long get_index( const int* vals )
long get_index( const long* vals )
long get_index( const float* vals )
long get_index( const double* vals )
long get_index( NcDim*, const ncbyte* vals )
long get_index( NcDim*, const char* vals )
long get_index( NcDim*, const short* vals )
long get_index( NcDim*, const int* vals )
long get_index( NcDim*, const long* vals )
long get_index( NcDim*, const float* vals )
long get_index( NcDim*, const double* vals )
void set_rec ( long rec )
void set_rec ( NcDim*, long rec )