DopplerInversionOp.h
1 /*
2 
3 MIT License
4 
5 Copyright (c) 2017 FMI Open Development / Markus Peura, first.last@fmi.fi
6 
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13 
14 The above copyright notice and this permission notice shall be included in all
15 copies or substantial portions of the Software.
16 
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 SOFTWARE.
24 
25 */
26 /*
27 Part of Rack development has been done in the BALTRAD projects part-financed
28 by the European Union (European Regional Development Fund and European
29 Neighbourhood Partnership Instrument, Baltic Sea Region Programme 2007-2013)
30 */
31 
32 
33 #ifndef DOPPLER_Inversion2_OP_H_
34 #define DOPPLER_Inversion2_OP_H_
35 
36 
37 #include "DopplerWindowOp.h"
38 
39 #include <cmath>
40 
41 
42 namespace rack {
43 
44 
46 
49 class DopplerWindOp : public DopplerOp { // DopplerWindow unused!
50 public:
51 
52 
53  virtual ~DopplerWindOp(){};
54 
55 
56  // Outputs u and v both, so dst dataSET needed
57  virtual
58  void processDataSet(const DataSet<PolarSrc> & srcSweep, DataSet<PolarDst> & dstProduct) const;
59 
60  //@Override
61  virtual
62  void processData(const Data<PolarSrc> & vradSrc, Data<PolarDst> & dstData) const {
63  throw std::runtime_error(name + "::" + __FUNCTION__ + ": not implemented");
64  }
65 
66 
67  // DopplerInversionWindowParameters parameters;
68  int widthM;
69  double heightD;
70  std::string altitudeWeight; // Functor
71  bool VVP;
72 
73 protected:
74 
76 
80  DopplerWindOp(const std::string & name, const std::string & description, int widthM = 500, double heightD = 3.0) :
81  DopplerOp(name, description) { //, widthM, heightD) {
82  parameters.link("width", this->widthM = widthM, "metres");
83  parameters.link("height", this->heightD = heightD, "degrees");
84 
85  dataSelector.setMaxCount(1);
86  VVP = false;
87  odim.type = "S";
88  odim.product = "AMV"; // ?
89  odim.quantity = "AMV"; // To be overridden tu AMVV, AMVU
90  };
91 
92 
93 };
94 
96 
101 class DopplerInversionOp : public DopplerWindOp { // DopplerWindow unused!
102 public:
103 
105 
109  DopplerInversionOp(int widthM = 500, double heightD = 3.0, double nyquistVelocity=0.0) :
110  DopplerWindOp(__FUNCTION__, "Derives 2D wind (u,v) from aliased Doppler data.", widthM, heightD) { //, widthM, heightD) {
111  // parameters.link("nyquist", nyquist = nyquistVelocity, "m/s");
112  //parameters.link("VVP", VVP=false, "0|1"); // SLOTS
113  //parameters.link("match", matchOriginal=0, "flag(aliased=1,nodata=2)"); // ALIASED=1, NODATA=2
114  parameters.link("altitudeWeight", altitudeWeight, "Functor:a:b:c..."); // ??
115  //parameters.link("testSigns", testSigns = 3, "bits");
116 
117  dataSelector.setMaxCount(1);
118  //dataSelector.selectPRF = DataSelector::Prf::ANY; // consider double
119 
120  odim.type = "S";
121  odim.product = "AMV";
122 
123  };
124 
125 
126 };
127 
128 
129 
130 
131 
132 
133 } // ::rack
134 
135 
136 #endif /* DOPPLERInversionOP_H_ */
A map of radar data, indexed by quantity code (DBZH, VRAD, etc).
Definition: Data.h:1213
Data structure consisting of plain data and an optional quality data.
Definition: Data.h:1144
Derives two-dimensional wind (u,v) from Doppler data.
Definition: DopplerInversionOp.h:101
DopplerInversionOp(int widthM=500, double heightD=3.0, double nyquistVelocity=0.0)
Constructor.
Definition: DopplerInversionOp.h:109
Base class for computing products using Doppler speed [VRAD] data.
Definition: DopplerOp.h:49
Base class for operators retrieving true wind (u,v).
Definition: DopplerInversionOp.h:49
DopplerWindOp(const std::string &name, const std::string &description, int widthM=500, double heightD=3.0)
Constructor.
Definition: DopplerInversionOp.h:80
virtual void processDataSet(const DataSet< PolarSrc > &srcSweep, DataSet< PolarDst > &dstProduct) const
Definition: DopplerInversionOp.cpp:55
Definition: DataSelector.cpp:44