Loading...
Searching...
No Matches
Cart2PolarOp.h
1/*
2
3MIT License
4
5Copyright (c) 2017 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 Cart_Polar_ProductOP
33#define Cart_Polar_ProductOP
34
35#include "data/PolarODIM.h"
36#include "RadarProductOp.h"
37
38namespace rack {
39
40// using namespace drain::image;
41
43
59class Cart2PolarOp : public RadarProductOp<const CartesianODIM, PolarODIM> {
60public:
61
62 Cart2PolarOp(const std::string & name = __FUNCTION__, const std::string & description = "");
63
64
66
67 virtual
68 ~Cart2PolarOp(){};
69
70 static
71 const CoordinatePolicy polarCoordPolicy;
72
73
74 // int rangeM = 250000; // metres
75
76 virtual
77 void processData(const Data<src_t > & srcData, Data<dst_t > & dstData) const override final;
78
79 virtual
80 void setGeometry(const CartesianODIM & srcODIM, PlainData<dst_t > & dstData) const final;
81
82protected:
83
84 // bool aboveSeaLevel; // True, if altitude (input or output) is measured from sea level or radar site.
85
86 inline
87 void copyPolarGeometry(const PolarODIM & srcODIM, PlainData<PolarDst> & dstData) const {
88 dstData.odim.area.width = srcODIM.area.width;
89 dstData.odim.area.height = srcODIM.area.height;
90 dstData.odim.rscale = srcODIM.rscale;
91 dstData.data.setGeometry(dstData.odim.area.width, dstData.odim.area.height);
92 if (!dstData.odim.type.empty()){
93 dstData.data.setType(dstData.odim.type.at(0));
94 }
95 else {
96 // warn type not set?
97 }
98 };
99
100 // Copy Polar could be enough?
101 virtual inline
102 void setGeometry(const PolarODIM & srcODIM, PlainData<PolarDst> & dstData) const {
103 copyPolarGeometry(srcODIM, dstData);
104 }
105
107
124
133};
134
135
136} // namespace rack
137
138#endif /* RACKOP_H_ */
139
140// Rack
const std::string description
Brief, human-readable description of this bean.
Definition BeanLike.h:309
const std::string name
Name of this bean, typically also the name of the (derived) class.
Definition BeanLike.h:306
Policies for coordinate underflows and overflows.
Definition CoordinatePolicy.h:100
Base class for flat (2D) products computed in the polar coordinate system. Volume is used as input.
Definition Cart2PolarOp.h:59
Metadata structure for Cartesian radar data products (single-radar or composites).
Definition CartesianODIM.h:47
A map of radar data, indexed by quantity code (DBZH, VRAD, etc).
Definition Data.h:1293
Metadata structure for single-radar data (polar scans, volumes and products).
Definition PolarODIM.h:45
Polar and Cartesian products.
Definition RadarProductOp.h:78
Definition AltitudeOp.cpp:42