Orfeo Toolbox  4.0
otbSarRadiometricCalibrationFunctor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ORFEO Toolbox
4  Language: C++
5  Date: $Date$
6  Version: $Revision$
7 
8 
9  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
10  See OTBCopyright.txt for details.
11 
12 
13  This software is distributed WITHOUT ANY WARRANTY; without even
14  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  PURPOSE. See the above copyright notices for more information.
16 
17 =========================================================================*/
18 
19 #ifndef __otbSarRadiometricCalibrationFunctor_h
20 #define __otbSarRadiometricCalibrationFunctor_h
21 
22 #include "otbMath.h"
23 #include "itkNumericTraits.h"
24 
25 namespace otb
26 {
27 
28 namespace Functor
29 {
36 template<class TInput, class TOutput>
38 {
39 public:
40  typedef TInput InputType;
41  typedef TOutput OutputType;
43 
45  {
46  m_Noise = 0.0;
47  m_Scale = 1.0;
48  m_IncidenceAngle = CONST_PI_2;
49  m_AntennaPatternOldGain = 1.0;
50  m_AntennaPatternNewGain = 1.0;
51  m_RangeSpreadLoss = 1.0;
52  };
53 
55 
56  inline TOutput operator ()(const TInput& value) const
57  {
58  RealType digitalNumber = static_cast<RealType> (vcl_abs(value));
59  RealType sigma;
60 
61  sigma = m_Scale * (digitalNumber * digitalNumber - m_Noise);
62  sigma *= vcl_sin(m_IncidenceAngle);
63  sigma *= m_AntennaPatternOldGain;
64  sigma /= m_AntennaPatternNewGain;
65  sigma *= m_RangeSpreadLoss;
66 
67  if(sigma < 0.0)
68  {
69  sigma = 0.0;
70  }
71 
72  return static_cast<OutputType>(sigma);
73  }
74 
76  void SetNoise(RealType value)
77  {
78  m_Noise = value;
79  }
80 
82  RealType GetNoise() const
83  {
84  return m_Noise;
85  }
86 
88  void SetScale(RealType value)
89  {
90  m_Scale = value;
91  }
92 
94  RealType GetScale() const
95  {
96  return m_Scale;
97  }
98 
100  void SetAntennaPatternNewGain(RealType value)
101  {
102  m_AntennaPatternNewGain = value;
103  }
104 
106  RealType GetAntennaPatternNewGain() const
107  {
108  return m_AntennaPatternNewGain;
109  }
110 
112  void SetAntennaPatternOldGain(RealType value)
113  {
114  m_AntennaPatternOldGain = value;
115  }
116 
118  RealType GetAntennaPatternOldGain() const
119  {
120  return m_AntennaPatternOldGain;
121  }
122 
124  void SetIncidenceAngle(RealType value)
125  {
126  m_IncidenceAngle = value;
127  }
128 
130  RealType GetIncidenceAngle() const
131  {
132  return m_IncidenceAngle;
133  }
134 
136  void SetRangeSpreadLoss(RealType value)
137  {
138  m_RangeSpreadLoss = value;
139  }
140 
142  RealType GetRangeSpreadLoss() const
143  {
144  return m_RangeSpreadLoss;
145  }
146 
147 private:
154 };
155 }
156 
157 }
158 
159 #endif

Generated at Sat Mar 8 2014 16:16:49 for Orfeo Toolbox with doxygen 1.8.3.1