Loading...
Searching...
No Matches
Zarr.h
1/*
2
3 Copyright 2001 - 2017 Markus Peura, Finnish Meteorological Institute (First.Last@fmi.fi)
4
5
6 This file is part of Rack for C++.
7
8 Rack is free software: you can redistribute it and/or modify
9 it under the terms of the GNU Lesser Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 any later version.
12
13 Rack is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU Lesser Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with Rack. If not, see <http://www.gnu.org/licenses/>.
20
21 */
22
23
24
25/*
26#include <iostream>
27#include <sstream>
28#include <string.h> // plain C strlen
29#include <map>
30#include <list>
31#include <vector>
32#include <set>
33*/
34
35#include "JSON.h"
36
37#ifndef DRAIN_ZARR
38#define DRAIN_ZARR
39
40namespace drain {
41
42
43class Zarr3 {
44
45protected:
46
47 // Must be defined before referencing definitions below.
48 drain::JSONtree json;
49
50public:
51
52 drain::Variable & zarr_format = json["zarr_format"] = 3;
53 drain::Variable & node_type = json["node_type"] = "array";
54 drain::Variable & shape = json["shape"] = {0,0};
55 drain::JSONtree & chunk_grid = json["chunk_grid"];
56 drain::Variable & chunk_grid_type = chunk_grid["type"] = "regular";
57 drain::Variable & chunk_grid_shape = chunk_grid["chunk_shape"] = {0,0};
58 drain::Variable & data_type = json["data_type"] = "float32";
59 drain::JSONtree & chunk_key_encoding = json["chunk_key_encoding"];
60 drain::Variable & chunk_key_encoding_separator = chunk_key_encoding["separator"] = ".";
61
62 inline
63 const drain::JSONtree & getJSON() const {return json;};
64
65 static
66 const std::string ATTRIBUTE_PATH;
67
68 static
69 const std::string ARRAY_PATH;
70
71 /*
72 template <class ...T>
73 inline
74 void setDir(const T & ... args){
75 dirPath.set(args...);
76 }
77
78 drain::FilePath dirPath;
79 */
80
81 // void writeAttributes() const ;
82 void writeMetadata(const drain::FilePath & dirPath) const ;
83
84 virtual inline
85 void writeArray(const drain::FilePath & dirPath) const {
86 Logger mout(__FILE__, __FUNCTION__);
87 mout.unimplemented("Under constr.");
88 };
89};
90
91}
92
93#endif
94
95
Extracts and stores directory path, base filename and extension.
Definition FilePath.h:58
LogSourc e is the means for a function or any program segment to "connect" to a Log.
Definition Log.h:313
Logger & unimplemented(const TT &... args)
Feature to be done. Special type of Logger::note().
Definition Log.h:512
Definition Zarr.h:43
Definition DataSelector.cpp:1277
DRAIN_VARIABLE Variable
Value container supporting dynamic type.
Definition Variable.h:63