51 size_t master_theshold=10*1024*1024,
52 size_t variable_threshold=100*1024*1024
70 static string GetDataDir(
string path);
89 string varname,
size_t ts,
string &path,
size_t &file_ts,
95 virtual int GetDimLensAtLevel(
96 string varname,
int level, std::vector <size_t> &dims_at_level,
97 vector <size_t> &bs_at_level
107 static bool DataDirExists(
string path) ;
116 virtual int Initialize(
117 const vector <string> &paths,
AccessMode mode,
size_t chunksizehint = 0
120 string path,
AccessMode mode,
size_t chunksizehint = 0
122 std::vector <string> paths;
123 paths.push_back(path);
124 return(Initialize(paths, mode, chunksizehint));
141 int OpenVariableRead(
142 size_t ts,
string varname,
int level=0,
int lod=-1
152 int OpenVariableWrite(
size_t ts,
string varname,
int lod=-1);
156 int Write(
const float *region);
158 int WriteSlice(
const float *slice);
162 int Read(
float *region);
166 int ReadSlice(
float *slice);
171 const std::vector<size_t> &min,
172 const std::vector<size_t> &max,
float *region
178 const vector <size_t> &min,
const vector <size_t> &max,
float *region
183 int PutVar(
string varname,
int lod,
const float *data);
187 int PutVar(
size_t ts,
string varname,
int lod,
const float *data);
191 int GetVar(
string varname,
int level,
int lod,
float *data);
195 int GetVar(
size_t ts,
string varname,
int level,
int lod,
float *data);
200 bool CompressionInfo(
201 std::vector <size_t> bs,
string wname,
size_t &nlevels,
size_t &maxcratio
204 virtual bool VariableExists(
215 #ifndef DOXYGEN_SKIP_THIS
216 virtual int _WriteMasterMeta();
217 virtual int _ReadMasterMeta();
224 class open_file_info {
236 WASP *wasp,
bool write, BaseVar var,
size_t slice_num,
237 size_t ts,
size_t file_ts,
string varname,
int level
242 _slice_num(slice_num),
259 open_file_info _ofimask;
261 VetsUtil::SmartBuf _sb_slice_buffer;
262 VetsUtil::SmartBuf _mask_buffer;
263 float *_slice_buffer;
265 size_t _chunksizehint;
266 size_t _master_threshold;
267 size_t _variable_threshold;
270 int _WriteMasterDimensions();
271 int _WriteMasterAttributes (
272 string prefix,
const map <string, Attribute> &atts
274 int _WriteMasterAttributes ();
275 int _WriteMasterBaseVarDefs(
string prefix,
const BaseVar &var);
276 int _WriteMasterCoordVarsDefs();
277 int _WriteMasterDataVarsDefs();
278 int _WriteSlice(WASP *file,
const float *slice);
279 int _WriteSlice(NetCDFCpp *file,
const float *slice);
281 int _ReadMasterDimensions();
282 int _ReadMasterAttributes (
283 string prefix, map <string, Attribute> &atts
285 int _ReadMasterAttributes ();
286 int _ReadMasterBaseVarDefs(
string prefix, BaseVar &var);
287 int _ReadMasterCoordVarsDefs();
288 int _ReadMasterDataVarsDefs();
289 int _ReadSlice(WASP *file,
float *slice);
290 int _ReadSlice(NetCDFCpp *file,
float *slice);
296 const Attribute &attr
299 int _DefBaseVar(WASP *ncdf,
const VDC::BaseVar &var,
size_t max_ts);
300 int _DefDataVar(WASP *ncdf,
const VDC::DataVar &var,
size_t max_ts);
301 int _DefCoordVar(WASP *ncdf,
const VDC::CoordVar &var,
size_t max_ts);
303 bool _var_in_master(
const VDC::BaseVar &var)
const;
305 string _get_mask_varname(
string varname)
const;
307 unsigned char *_read_mask_var(
308 vector <size_t> start, vector <size_t> count
311 WASP *_OpenVariableRead(
312 size_t ts,
const VDC::BaseVar &var,
int clevel,
int lod,
Defines API for reading, writing, and appending data to a VAPOR Data Collection (Version 3) ...
virtual int Initialize(string path, AccessMode mode, size_t chunksizehint=0)
size_t GetVariableThreshold() const
Implements WASP compression conventions for NetCDF.
Implements the VDC abstract class, providing storage of VDC data in NetCDF files. ...
size_t GetMasterThreshold() const