OTB  10.0.0
Orfeo Toolbox
otbRadarsat2ImageMetadataInterface.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 otbRadarsat2ImageMetadataInterface_h
22 #define otbRadarsat2ImageMetadataInterface_h
23 
25 
26 namespace otb
27 {
37 {
38 public:
41  typedef itk::SmartPointer<Self> Pointer;
42  typedef itk::SmartPointer<const Self> ConstPointer;
43 
45  itkNewMacro(Self);
46 
49 
50  typedef Superclass::ImageType ImageType;
51  typedef Superclass::MetaDataDictionaryType MetaDataDictionaryType;
54  typedef Superclass::LookupDataPointerType LookupDataPointerType;
55  // typedef Radarsat2CalibrationLookupData::Pointer LookupDataPointerType;
56 
57  double GetCenterIncidenceAngle(const MetadataSupplierInterface&) const override;
58 
59  /*get lookup data for calculating backscatter */
61  bool CreateCalibrationLookupData(SARCalib&, const ImageMetadata&, const MetadataSupplierInterface&, const bool) const override;
62 
63  void ParseGdal(ImageMetadata &) override;
64 
65  void ParseGeom(ImageMetadata &) override;
66 
67  void Parse(ImageMetadata &) override;
68 
69 
70 protected:
71  /* class constructor */
73 
74  /* class destructor */
75  ~Radarsat2ImageMetadataInterface() override = default;
76 
77 private:
79  void operator=(const Self&) = delete;
80 };
81 
82 
84 {
85 
86 public:
90  typedef itk::SmartPointer<Self> Pointer;
91  typedef itk::SmartPointer<const Self> ConstPointer;
92 
94  itkNewMacro(Self);
95 
98 
99  typedef itk::IndexValueType IndexValueType;
100 
101  typedef std::vector<float> GainListType;
102 
103 
105  {
106  }
107 
109  {
110  }
111 
112  void InitParameters(short type, int offset, GainListType gains)
113  {
114  this->SetType(type);
115  m_Offset = offset;
116  m_Gains = gains;
117  }
118 
119  double GetValue(const IndexValueType x, const IndexValueType itkNotUsed(y)) const override
120  {
121  double lutVal = 1.0;
122 
123  const size_t pos = x + m_Offset;
124  if (pos < m_Gains.size())
125  {
126  lutVal = m_Gains[pos];
127  }
128  else
129  {
130  // itkExceptionMacro( << "error: (pos < list.size() )" << pos << " < " << list.size())
131  }
132  return lutVal;
133  }
134 
135  void PrintSelf(std::ostream& os, itk::Indent indent) const override
136  {
137  os << indent << " offset:'" << m_Offset << "'" << std::endl;
138  os << " referenceNoiseLevel.gain: " << std::endl;
139  std::vector<float>::const_iterator it = m_Gains.begin();
140  while (it != m_Gains.end())
141  {
142  os << (*it) << " ";
143  ++it;
144  }
145  os << std::endl;
146 
147  Superclass::PrintSelf(os, indent);
148  }
149 
150 private:
152  void operator=(const Self&) = delete;
153 
155  int m_Offset;
156 };
157 
158 } // end namespace otb
159 
160 #endif
Base class for captor metadata reading.
Generic class containing image metadata used in OTB.
Base class to access metadata information in files/images.
void PrintSelf(std::ostream &os, itk::Indent indent) const override
void operator=(const Self &)=delete
Radarsat2CalibrationLookupData(const Self &)=delete
double GetValue(const IndexValueType x, const IndexValueType) const override
void InitParameters(short type, int offset, GainListType gains)
Creation of an "otb" Radarsat2ImageMetadataInterface that gets metadata.
Radarsat2ImageMetadataInterface(const Self &)=delete
bool HasCalibrationLookupDataFlag(const MetadataSupplierInterface &) const override
double GetCenterIncidenceAngle(const MetadataSupplierInterface &) const override
Superclass::MetaDataDictionaryType MetaDataDictionaryType
~Radarsat2ImageMetadataInterface() override=default
void Parse(ImageMetadata &) override
bool CreateCalibrationLookupData(SARCalib &, const ImageMetadata &, const MetadataSupplierInterface &, const bool) const override
void operator=(const Self &)=delete
void ParseGeom(ImageMetadata &) override
Superclass::VariableLengthVectorType VariableLengthVectorType
void ParseGdal(ImageMetadata &) override
Superclass::LookupDataPointerType LookupDataPointerType
void PrintSelf(std::ostream &os, itk::Indent indent) const override
Class for SAR captor metadata reading.
std::vector< double > VectorType
itk::VariableLengthVector< double > VariableLengthVectorType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
SAR calibration LUTs.