SunShineOp.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 #ifndef SunShineOp_H_
32 #define SunShineOp_H_
33 
34 #include <algorithm>
35 
36 
37 
38 //#include "RackOp.h"
39 #include "PolarProductOp.h"
40 
41 namespace rack
42 {
43 
44 using namespace drain::image;
45 
46 
48 
50 class SunShineOp : public PolarProductOp {
51 
52 public:
53 
54  SunShineOp() : // const std::string & type="S", double gain=100.0, long int nbins=0, double rscale=0) :
55  PolarProductOp(__FUNCTION__, "Computes the sun position")
56  {
57  dataSelector.setMaxCount(1); // or 0? does not need input data arrays
58 
59  odim.product = "SUNSHINE";
60  odim.area.width = 500;
61  odim.area.height = 360;
62  odim.rscale = 500;
63 
64  odim.type = "C";
65  odim.scaling.scale = 1.0/200.0;
66  odim.scaling.offset = -0.1;
67 
68  //parameters.link("quantity", odim.quantity);
69  parameters.link("timestamp", timestamp="200527071845");
70  parameters.link("quantity", odim.quantity="SUNSHINE");
71 
72  odim.quantity = "SUNSHINE";
73  //dataSelector.setQuantity("");
74  // NOTE! A dataset for each elevation groups; should suffit for nbins and rscale.
75  // However, if a user wants to use quantity, /dataN/ should be reached.
76 
77 
78  this->allowedEncoding.link("type", odim.type);
79  this->allowedEncoding.link("gain", odim.scaling.scale);
80  this->allowedEncoding.link("offset", odim.scaling.offset);
81 
82 
83  };
84 
85  std::string timestamp;
86  //std::string quantity;
87 
88  virtual
89  void processData(const Data<PolarSrc> & src, Data<PolarDst> & dst) const;
90 
91 
92 
93 };
94 
95 
96 
97 
98 
99 } // ::rack
100 
101 #endif /*POLARCappi_H_*/
102 
103 // Rack
Data structure consisting of plain data and an optional quality data.
Definition: Data.h:1144
Base class for flat (2D) products computed in the polar coordinate system. Volume is used as input.
Definition: PolarProductOp.h:61
A single-ray "product" storing the altitude at each bin.
Definition: SunShineOp.h:50
Namespace for images and image processing tools.
Definition: AccumulationArray.cpp:45
Definition: DataSelector.cpp:44