Loading...
Searching...
No Matches
DataModifier.h
1/*
2
3MIT License
4
5Copyright (c) 2026 FMI Open Development / Markus Peura, first.last@fmi.fi
6
7Permission is hereby granted, free of charge, to any person obtaining a copy
8of this software and associated documentation files (the "Software"), to deal
9in the Software without restriction, including without limitation the rights
10to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11copies of the Software, and to permit persons to whom the Software is
12furnished to do so, subject to the following conditions:
13
14The above copyright notice and this permission notice shall be included in all
15copies or substantial portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23SOFTWARE.
24
25*/
26/*
27Part of Rack development has been done in the BALTRAD projects part-financed
28by the European Union (European Regional Development Fund and European
29Neighbourhood Partnership Instrument, Baltic Sea Region Programme 2007-2013)
30*/
31
32#ifndef RACK_DATA_MODIFIER
33#define RACK_DATA_MODIFIER
34
35/*
36#include <map>
37#include <drain/image/CoordinatePolicy.h>
38#include <drain/util/ReferenceMap.h>
39#include "ODIM.h"
40#include "PolarODIM.h"
41*/
42#include "DataSelector.h"
43// #include "DataTools.h"
44
45namespace rack {
46
48
53
54public:
55
56
58 static
59 void remove(Hi5Tree & dst, const DataSelector & dataSelector);
60
62
65 static
66 int removeEmptyGroups(Hi5Tree & dst, const ODIMPath & path = ODIMPath());
67 // { return handleEmptyGroups(dst, true); }
68
70 static
71 void keep(Hi5Tree & dst, const DataSelector & selector);
72
73
75 static inline
77 markTree(src, true, filter);
78 }
79
81 static inline
83 markTree(src, false, filter);
84 }
85
87 static
88 void markIncluded(Hi5Tree & dst, const DataSelector & dataSelector);
89
91 static inline
92 void markPathIncluded(Hi5Tree & dst, const ODIMPath & path){
93 markPath(dst, path, false);
94 }
95
96
97
98protected:
99
100
101
102 // static
103 // int handleEmptyGroups(Hi5Tree & dst, const ODIMPath & path = ODIMPath()); // bool REMOVE,
104
106
112 static
113 void markTree(Hi5Tree &src, bool exclude, ODIMPathElem::group_t filter = ODIMPathElem::ALL_GROUPS);
114
116 static
117 void markPath(Hi5Tree &src, const Hi5Tree::path_t & path, bool exclude);
118
119
120
121};
122
123
124} // rack::
125
126#endif // DATA_MODIFIER
127
Definition Path.h:135
Tool for selecting datasets based on paths, quantities and min/max elevations.
Definition DataModifier.h:52
static void markPathIncluded(Hi5Tree &dst, const ODIMPath &path)
Mark everything along the path included.
Definition DataModifier.h:92
static void keep(Hi5Tree &dst, const DataSelector &selector)
Complement of remove(): keep the selected, remove else.
Definition DataModifier.cpp:100
static void markTree(Hi5Tree &src, bool exclude, ODIMPathElem::group_t filter=ODIMPathElem::ALL_GROUPS)
Mark exclusion/inclusion in the whole tree.
Definition DataModifier.cpp:40
static void markPath(Hi5Tree &src, const Hi5Tree::path_t &path, bool exclude)
Mark exclusion/inclusion along a path.
Definition DataModifier.cpp:55
static int removeEmptyGroups(Hi5Tree &dst, const ODIMPath &path=ODIMPath())
Quick removal of empty groups.
Definition DataModifier.cpp:150
static void markIncluded(Hi5Tree &src, ODIMPathElem::group_t filter=ODIMPathElem::ALL_GROUPS)
Mark everything included.
Definition DataModifier.h:82
static void markExcluded(Hi5Tree &src, ODIMPathElem::group_t filter=ODIMPathElem::ALL_GROUPS)
Mark everything excluded.
Definition DataModifier.h:76
static void remove(Hi5Tree &dst, const DataSelector &dataSelector)
Remove selected parts of the structure.
Definition DataModifier.cpp:78
Tool for selecting datasets based on paths, quantities and min/max elevations.
Definition DataSelector.h:106
A map of radar data, indexed by quantity code (DBZH, VRAD, etc).
Definition Data.h:1293
unsigned int group_t
In H5, "groups" correspond to directories or folders in file system.
Definition ODIMPath.h:92
static const group_t ALL_GROUPS
User defined group, name stored as a separate string. Index allowed, but only catenated in the string...
Definition ODIMPath.h:140
Definition AltitudeOp.cpp:42