135 virtual int Create(
string path,
int cmode,
size_t initialsz,
size_t &bufrsizehintp,
int numfiles);
144 virtual int Open(
string path,
int mode);
148 virtual int SetFill(
int fillmode,
int &old_modep);
185 virtual int InqVarDimlens(
string name,
int level, vector<size_t> &dims, vector<size_t> &bs)
const;
189 virtual int InqVarDims(
string name, vector<string> &dimnames, vector<size_t> &dims)
const;
232 static int InqDimsAtLevel(
string wname,
int level, vector<size_t> dims, vector<size_t> bs, vector<size_t> &dims_at_level, vector<size_t> &bs_at_level);
305 virtual int DefVar(
string name,
int xtype, vector<string> dimnames,
string wname, vector<size_t> bs, vector<size_t> cratios);
321 virtual int DefVar(
string name,
int xtype, vector<string> dimnames,
string wname, vector<size_t> bs, vector<size_t> cratios,
double missing_value);
325 virtual int DefVar(
string name,
int xtype, vector<string> dimnames) {
return (NetCDFCpp::DefVar(name, xtype, dimnames)); };
329 int DefDim(
string name,
size_t len)
const;
428 virtual int PutVara(vector<size_t> start, vector<size_t> count,
const float *data);
431 virtual int PutVara(vector<size_t> start, vector<size_t> count,
const double *data);
434 virtual int PutVara(vector<size_t> start, vector<size_t> count,
const int *data);
437 virtual int PutVara(vector<size_t> start, vector<size_t> count,
const int16_t *data);
440 virtual int PutVara(vector<size_t> start, vector<size_t> count,
const unsigned char *data);
441 virtual int PutVar(
const unsigned char *data);
459 virtual int PutVara(vector<size_t> start, vector<size_t> count,
const float *data,
const unsigned char *mask);
460 virtual int PutVar(
const float *data,
const unsigned char *mask);
462 virtual int PutVara(vector<size_t> start, vector<size_t> count,
const double *data,
const unsigned char *mask);
463 virtual int PutVar(
const double *data,
const unsigned char *mask);
465 virtual int PutVara(vector<size_t> start, vector<size_t> count,
const int *data,
const unsigned char *mask);
466 virtual int PutVar(
const int *data,
const unsigned char *mask);
468 virtual int PutVara(vector<size_t> start, vector<size_t> count,
const int16_t *data,
const unsigned char *mask);
469 virtual int PutVar(
const int16_t *data,
const unsigned char *mask);
471 virtual int PutVara(vector<size_t> start, vector<size_t> count,
const unsigned char *data,
const unsigned char *mask);
472 virtual int PutVar(
const unsigned char *data,
const unsigned char *mask);
498 virtual int GetVara(vector<size_t> start, vector<size_t> count,
float *data);
499 virtual int GetVara(vector<size_t> start, vector<size_t> count,
double *data);
500 virtual int GetVara(vector<size_t> start, vector<size_t> count,
int *data);
501 virtual int GetVara(vector<size_t> start, vector<size_t> count, int16_t *data);
503 virtual int GetVara(vector<size_t> start, vector<size_t> count,
unsigned char *data);
525 virtual int GetVaraBlock(vector<size_t> start, vector<size_t> count,
float *data);
526 virtual int GetVaraBlock(vector<size_t> start, vector<size_t> count,
double *data);
527 virtual int GetVaraBlock(vector<size_t> start, vector<size_t> count,
int *data);
528 virtual int GetVaraBlock(vector<size_t> start, vector<size_t> count, int16_t *data);
529 virtual int GetVaraBlock(vector<size_t> start, vector<size_t> count,
unsigned char *data);
596 static std::vector<string>
GetPaths(
string path,
int numfiles)
599 return (mkmultipaths(path, numfiles));
601 std::vector<string> t(1, path);
634 vector<NetCDFCpp> _ncdfcs;
635 vector<NetCDFCpp *> _ncdfcptrs;
646 vector<size_t> _open_bs;
647 vector<size_t> _open_cratios;
648 vector<size_t> _open_udims;
649 vector<size_t> _open_dims;
654 string _open_varname;
655 nc_type _open_varxtype;
656 vector<Compressor *> _open_compressors;
658 int _GetBlockAlignedDims(vector<string> dimnames, vector<size_t> bs, vector<string> &badimnames, vector<size_t> &badims)
const;
660 int _GetCompressedDims(vector<string> dimnames,
string wname, vector<size_t> bs, vector<size_t> cratios,
int xtype, vector<string> &cdimnames, vector<size_t> &cdims,
661 vector<string> &encoded_dim_names, vector<size_t> &encoded_dims)
const;
663 int _InqDimlen(
string name,
size_t &len)
const;
665 void _get_encoding_vectors(
string wname, vector<size_t> bs, vector<size_t> cratios,
int xtype, vector<size_t> &ncoeffs, vector<size_t> &encoded_dims)
const;
667 bool _validate_compression_params(
string wname, vector<size_t> dims, vector<size_t> bs, vector<size_t> cratios)
const;
669 bool _validate_put_vara_compressed(vector<size_t> start, vector<size_t> count, vector<size_t> bs, vector<size_t> udims, vector<size_t> cratios)
const;
671 bool _validate_get_vara_compressed(vector<size_t> start, vector<size_t> count, vector<size_t> bs, vector<size_t> udims, vector<size_t> cratios,
bool unblock)
const;
673 int _get_compression_params(
string name, vector<size_t> &bs, vector<size_t> &cratios, vector<size_t> &udims, vector<size_t> &dims,
string &wname)
const;
675 template<
class T,
class U>
int _GetVara(vector<size_t> start, vector<size_t> count,
bool unblock, T *data, U dummy);
677 template<
class T>
int _GetVara(vector<size_t> start, vector<size_t> count,
bool unblock_flag, T *data);
679 static void _dims_at_level(vector<size_t> dims, vector<size_t> bs,
int level,
string wname, vector<size_t> &dims_level, vector<size_t> &bs_level);
681 static vector<string> mkmultipaths(
string path,
int n);
683 template<
class T,
class U>
int _PutVara(vector<size_t> start, vector<size_t> count,
const T *data,
const unsigned char *mask, U dummy);
685 template<
class T>
int _PutVara(vector<size_t> start, vector<size_t> count,
const T *data,
const unsigned char *mask);
687 template<
class T>
int _CopyHyperSlice(
string varname,
NetCDFCpp &src_ncdf,
NetCDFCpp &dst_ncdf, vector<size_t> start, vector<size_t> count, T *buf)
const;
693 int _NetCDFType(
float dummy) {
return NC_FLOAT; }
694 int _NetCDFType(
char dummy) {
return NC_BYTE; }
695 int _NetCDFType(
double dummy) {
return NC_DOUBLE; }
696 int _NetCDFType(
unsigned char dummy) {
return NC_UBYTE; }
697 int _NetCDFType(int16_t dummy) {
return NC_SHORT; }
698 int _NetCDFType(
int dummy) {
return NC_INT; }
699 int _NetCDFType(
long dummy) {
return NC_INT64; }
Defines simple C++ wrapper for NetCDF.
Implements WASP compression conventions for NetCDF.
virtual int OpenVarWrite(string name, int lod)
virtual int CopyVarTo(string varname, NetCDFCpp &ncdf)
static bool InqCompressionInfo(vector< size_t > bs, string wname, size_t &nlevels, size_t &maxcratio)
virtual int PutVar(const float *data)
static string AttNameCRatios()
NetCDF attribute name specifying compression ratios.
virtual int CopyVarFrom(string varname, NetCDFCpp &ncdf)
virtual int PutVar(const double *data)
virtual int PutVara(vector< size_t > start, vector< size_t > count, const int *data, const unsigned char *mask)
virtual int PutVar(const float *data, const unsigned char *mask)
virtual int InqVarCompressionParams(string name, string &wname, vector< size_t > &bs, vector< size_t > &cratios) const
virtual int PutVar(const int *data)
virtual int GetVar(int *data)
virtual int GetVaraBlock(vector< size_t > start, vector< size_t > count, double *data)
virtual int GetVara(vector< size_t > start, vector< size_t > count, unsigned char *data)
virtual int PutVar(const int *data, const unsigned char *mask)
static string AttNameNumFiles()
NetCDF attribute name specifying number of compression files.
virtual int PutVara(vector< size_t > start, vector< size_t > count, const double *data)
virtual int GetVar(int16_t *data)
virtual int InqVarNumRefLevels(string name) const
virtual int GetVar(double *data)
virtual int DefVar(string name, int xtype, vector< string > dimnames)
Define a variable.
virtual int Open(string path, int mode)
virtual int PutVara(vector< size_t > start, vector< size_t > count, const float *data, const unsigned char *mask)
virtual int GetVaraBlock(vector< size_t > start, vector< size_t > count, unsigned char *data)
virtual int Create(string path, int cmode, size_t initialsz, size_t &bufrsizehintp, int numfiles)
virtual int PutVar(const unsigned char *data)
int DefDim(string name, size_t len) const
Define a dimension.
virtual int PutVar(const int16_t *data)
virtual int InqVarDims(string name, vector< string > &dimnames, vector< size_t > &dims) const
static string AttNameVersion()
NetCDF attribute name specifying WASP version number.
virtual int GetVar(unsigned char *data)
virtual int PutVara(vector< size_t > start, vector< size_t > count, const int *data)
int InqVarWASP(string varname, bool &wasp) const
virtual int PutVara(vector< size_t > start, vector< size_t > count, const float *data)
virtual int GetVara(vector< size_t > start, vector< size_t > count, float *data)
virtual int PutVara(vector< size_t > start, vector< size_t > count, const int16_t *data)
static string AttNameMissingValue()
NetCDF attribute name specifying if missing data values are present.
virtual int InqVarCompressed(string varname, bool &compressed) const
virtual int PutVar(const double *data, const unsigned char *mask)
static string AttNameWASP()
virtual int PutVar(const int16_t *data, const unsigned char *mask)
virtual int PutVara(vector< size_t > start, vector< size_t > count, const double *data, const unsigned char *mask)
virtual int GetVaraBlock(vector< size_t > start, vector< size_t > count, int16_t *data)
virtual int GetVara(vector< size_t > start, vector< size_t > count, int16_t *data)
static int InqDimsAtLevel(string wname, int level, vector< size_t > dims, vector< size_t > bs, vector< size_t > &dims_at_level, vector< size_t > &bs_at_level)
static string AttNameWavelet()
NetCDF attribute name specifying Wavelet name.
virtual int OpenVarRead(string name, int level, int lod)
static std::vector< string > GetPaths(string path, int numfiles)
static string AttNameBlockSize()
NetCDF attribute name specifying compression block dimensions.
virtual int PutVar(const unsigned char *data, const unsigned char *mask)
virtual int PutVara(vector< size_t > start, vector< size_t > count, const int16_t *data, const unsigned char *mask)
virtual int CopyVar(string varname, WASP &wasp)
virtual int InqVarDimlens(string name, int level, vector< size_t > &dims, vector< size_t > &bs) const
virtual int SetFill(int fillmode, int &old_modep)
Set the fill value.
virtual int GetVaraBlock(vector< size_t > start, vector< size_t > count, int *data)
virtual int EndDef() const
End the metadata definition section.
virtual int GetVara(vector< size_t > start, vector< size_t > count, double *data)
virtual int DefVar(string name, int xtype, vector< string > dimnames, string wname, vector< size_t > bs, vector< size_t > cratios)
virtual int GetVar(float *data)
virtual int PutVara(vector< size_t > start, vector< size_t > count, const unsigned char *data)
virtual int DefVar(string name, int xtype, vector< string > dimnames, string wname, vector< size_t > bs, vector< size_t > cratios, double missing_value)
virtual int GetVaraBlock(vector< size_t > start, vector< size_t > count, float *data)
static string AttNameDimNames()
NetCDF attribute name specifying names of uncompressed dimensions.
virtual int GetVara(vector< size_t > start, vector< size_t > count, int *data)
virtual int PutVara(vector< size_t > start, vector< size_t > count, const unsigned char *data, const unsigned char *mask)