OTB  10.0.0
Orfeo Toolbox
otbSailModel.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 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;
71 
72  void SetTransmittance(const SpectralResponseType* object) override;
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 
132 
134  void SetInput(const ParametersType&);
135  using Superclass::SetInput;
136 
137 
138 protected:
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
This class implements the SAIL model (see http://teledetection.ipgp.jussieu.fr/prosail/).
Definition: otbSailModel.h:47
virtual SpectralResponseType * GetHemisphericalAbsorptance()
void SetInput(const ParametersType &)
void Campbell(const double ala, VectorType &freq) const
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType) override
virtual SpectralResponseType * GetHemisphericalReflectance()
double Jfunc3(const double k, const double l, const double t) const
SpectralResponseType * GetTransmittance()
~SailModel() override
virtual SpectralResponseType * GetViewingAbsorptance()
itk::SmartPointer< Self > Pointer
Definition: otbSailModel.h:52
double Jfunc2(const double k, const double l, const double t) const
Superclass::SpectralResponseType SpectralResponseType
Definition: otbSailModel.h:55
void PrintSelf(std::ostream &os, itk::Indent indent) const override
const ParametersType GetInput()
void Calc_LIDF(const double a, VectorType &lidf) const
SpectralResponseType * GetReflectance()
itk::SmartPointer< const Self > ConstPointer
Definition: otbSailModel.h:53
void operator=(const Self &)=delete
SimulationStep2Base Superclass
Definition: otbSailModel.h:51
void UseExternalSoilDB(std::shared_ptr< SoilDataBase > SoilDB, vcl_size_t SoilIndex)
double Jfunc1(const double k, const double l, const double t) const
SailModel(const Self &)=delete
void SetReflectance(const SpectralResponseType *object) override
SailModel Self
Definition: otbSailModel.h:50
itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
Definition: otbSailModel.h:59
std::shared_ptr< SoilDataBase > m_SoilDataBase
Definition: otbSailModel.h:179
void SetTransmittance(const SpectralResponseType *object) override
virtual SpectralResponseType * GetViewingReflectance()
Superclass::ParametersType ParametersType
Definition: otbSailModel.h:57
void GenerateData() override
std::vector< double > VectorType
Definition: otbSailModel.h:56
double m_FCoverView
Definition: otbSailModel.h:176
vcl_size_t m_SoilIndex
Definition: otbSailModel.h:178
void Volscatt(const double tts, const double tto, const double psi, const double ttl, VectorType &result) const
Base class for all methods that generate spectrum of an object using its reflectance and transmittanc...
itk::Array< ParametersValueType > ParametersType
This class represents the spectral response of an object (or a satellite band).
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.