OTB  9.0.0
Orfeo Toolbox
otbSailModel.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbSailModel_h
22 #define otbSailModel_h
23 
24 #include "OTBSimulationExport.h"
25 #include "otbSpectralResponse.h"
26 #include "otbDataSpecP5B.h"
27 #include "otbSimulationStep2Base.h"
28 #include "otbSoilDataBase.h"
29 #include <string>
30 #include <memory>
31 
32 namespace otb
33 {
46 class OTBSimulation_EXPORT SailModel : public SimulationStep2Base
47 {
48 public:
50  typedef SailModel Self;
52  typedef itk::SmartPointer<Self> Pointer;
53  typedef itk::SmartPointer<const Self> ConstPointer;
54 
56  typedef std::vector<double> VectorType;
58 
59  typedef itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType;
60 
62  itkNewMacro(Self);
63  itkTypeMacro(SailModel, ProcessObject);
65 
66 
68  void SetReflectance(const SpectralResponseType* object) override;
69  SpectralResponseType* GetReflectance();
71 
72  void SetTransmittance(const SpectralResponseType* object) override;
73  SpectralResponseType* GetTransmittance();
74 
78  itkSetMacro(LAI, double);
79  itkGetMacro(LAI, double);
81 
83  itkSetMacro(Angl, double);
84  itkGetMacro(Angl, double);
86 
88  itkSetMacro(PSoil, double);
89  itkGetMacro(PSoil, double);
91 
93  itkSetMacro(Skyl, double);
94  itkGetMacro(Skyl, double);
96 
98  itkSetMacro(HSpot, double);
99  itkGetMacro(HSpot, double);
101 
103  itkSetMacro(TTS, double);
104  itkGetMacro(TTS, double);
106 
108  itkSetMacro(TTO, double);
109  itkGetMacro(TTO, double);
111 
113  itkSetMacro(PSI, double);
114  itkGetMacro(PSI, double);
116 
118  itkGetMacro(FCoverView, double);
119 
121  void UseExternalSoilDB(std::shared_ptr<SoilDataBase> SoilDB, size_t SoilIndex);
122 
124  void GenerateData() override;
125 
127  virtual SpectralResponseType* GetViewingReflectance();
128  virtual SpectralResponseType* GetHemisphericalReflectance();
129  virtual SpectralResponseType* GetViewingAbsorptance();
130  virtual SpectralResponseType* GetHemisphericalAbsorptance();
132 
133  const ParametersType GetInput();
134  void SetInput(const ParametersType&);
135  using Superclass::SetInput;
136 
137 
138 protected:
140  SailModel();
141 
143  ~SailModel() override;
144 
146  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
147 
148  DataObjectPointer MakeOutput(DataObjectPointerArraySizeType) override;
149  using Superclass::MakeOutput;
150 
152  void Calc_LIDF(const double a, VectorType& lidf) const;
153  void Campbell(const double ala, VectorType& freq) const;
155 
157  double Jfunc1(const double k, const double l, const double t) const;
158  double Jfunc2(const double k, const double l, const double t) const;
159  double Jfunc3(const double k, const double l, const double t) const;
160 
162  void Volscatt(const double tts, const double tto, const double psi, const double ttl, VectorType& result) const;
163 
164 private:
165  SailModel(const Self&) = delete;
166  void operator=(const Self&) = delete;
167 
168  double m_LAI; // leaf area index
169  double m_Angl; // average leaf angle
170  double m_PSoil; // soil coefficient
171  double m_Skyl; // diffuse/direct radiation
172  double m_HSpot; // hot spot
173  double m_TTS; // solar zenith angle
174  double m_TTO; // observer zenith angle
175  double m_PSI; // azimuth
176  double m_FCoverView; // fCover in the viewing direction
177  bool m_UseSoilFile; // use a soil file instead of DataSpecP5B
178  size_t m_SoilIndex; // which soil in the soil file
179  std::shared_ptr<SoilDataBase> m_SoilDataBase;
180 };
181 
182 } // end namespace otb
183 
184 
185 #ifndef OTB_MANUAL_INSTANTIATION
186 // #include "otbSailModel.cxx"
187 #endif
188 
189 #endif
otb::SailModel::m_SoilDataBase
std::shared_ptr< SoilDataBase > m_SoilDataBase
Definition: otbSailModel.h:179
otb::SailModel::m_UseSoilFile
bool m_UseSoilFile
Definition: otbSailModel.h:177
otb::SailModel::ParametersType
Superclass::ParametersType ParametersType
Definition: otbSailModel.h:57
otbSoilDataBase.h
otb::SailModel::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbSailModel.h:52
otb::SailModel::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbSailModel.h:53
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::SailModel::m_LAI
double m_LAI
Definition: otbSailModel.h:168
otb::SailModel::m_HSpot
double m_HSpot
Definition: otbSailModel.h:172
otb::SailModel
This class implements the SAIL model (see http://teledetection.ipgp.jussieu.fr/prosail/).
Definition: otbSailModel.h:46
otbDataSpecP5B.h
otb::SailModel::m_PSoil
double m_PSoil
Definition: otbSailModel.h:170
otb::SailModel::m_FCoverView
double m_FCoverView
Definition: otbSailModel.h:176
otb::SailModel::m_Angl
double m_Angl
Definition: otbSailModel.h:169
otb::SailModel::VectorType
std::vector< double > VectorType
Definition: otbSailModel.h:56
otb::SimulationStep2Base
Base class for all methods that generate spectrum of an object using its reflectance and transmittanc...
Definition: otbSimulationStep2Base.h:42
otb::SailModel::m_TTS
double m_TTS
Definition: otbSailModel.h:173
otb::SailModel::m_SoilIndex
vcl_size_t m_SoilIndex
Definition: otbSailModel.h:178
otb::SailModel::SpectralResponseType
Superclass::SpectralResponseType SpectralResponseType
Definition: otbSailModel.h:55
otb::SailModel::Superclass
SimulationStep2Base Superclass
Definition: otbSailModel.h:51
otbSpectralResponse.h
otb::SailModel::m_PSI
double m_PSI
Definition: otbSailModel.h:175
otb::SailModel::m_Skyl
double m_Skyl
Definition: otbSailModel.h:171
otb::SailModel::Self
SailModel Self
Definition: otbSailModel.h:50
otb::SpectralResponse
This class represents the spectral response of an object (or a satellite band).
Definition: otbSpectralResponse.h:55
otb::SailModel::m_TTO
double m_TTO
Definition: otbSailModel.h:174
otb::SailModel::DataObjectPointerArraySizeType
itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
Definition: otbSailModel.h:59
otb::SimulationStep2Base::ParametersType
itk::Array< ParametersValueType > ParametersType
Definition: otbSimulationStep2Base.h:54
otbSimulationStep2Base.h