OTB  9.0.0
Orfeo Toolbox
otbRadarsat2ImageMetadataInterface.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 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 */
60  bool HasCalibrationLookupDataFlag(const MetadataSupplierInterface&) const override;
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:
78  Radarsat2ImageMetadataInterface(const Self&) = delete;
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:
151  Radarsat2CalibrationLookupData(const Self&) = delete;
152  void operator=(const Self&) = delete;
153 
155  int m_Offset;
156 };
157 
158 } // end namespace otb
159 
160 #endif
otb::Radarsat2ImageMetadataInterface
Creation of an "otb" Radarsat2ImageMetadataInterface that gets metadata.
Definition: otbRadarsat2ImageMetadataInterface.h:36
otb::SarCalibrationLookupData::PrintSelf
void PrintSelf(std::ostream &os, itk::Indent indent) const override
Definition: otbSarCalibrationLookupData.h:83
otb::Radarsat2CalibrationLookupData::Superclass
SarCalibrationLookupData Superclass
Definition: otbRadarsat2ImageMetadataInterface.h:89
otb::Radarsat2CalibrationLookupData::GetValue
double GetValue(const IndexValueType x, const IndexValueType) const override
Definition: otbRadarsat2ImageMetadataInterface.h:119
otb::Radarsat2ImageMetadataInterface::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbRadarsat2ImageMetadataInterface.h:41
otb::Radarsat2ImageMetadataInterface::Self
Radarsat2ImageMetadataInterface Self
Definition: otbRadarsat2ImageMetadataInterface.h:39
otb::Radarsat2CalibrationLookupData::PrintSelf
void PrintSelf(std::ostream &os, itk::Indent indent) const override
Definition: otbRadarsat2ImageMetadataInterface.h:135
otb::Radarsat2ImageMetadataInterface::Superclass
SarImageMetadataInterface Superclass
Definition: otbRadarsat2ImageMetadataInterface.h:40
otb::Radarsat2CalibrationLookupData::InitParameters
void InitParameters(short type, int offset, GainListType gains)
Definition: otbRadarsat2ImageMetadataInterface.h:112
otb::SarCalibrationLookupData
Definition: otbSarCalibrationLookupData.h:38
otb::Radarsat2CalibrationLookupData
Definition: otbRadarsat2ImageMetadataInterface.h:83
otb::Radarsat2CalibrationLookupData::GainListType
std::vector< float > GainListType
Definition: otbRadarsat2ImageMetadataInterface.h:101
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::Radarsat2CalibrationLookupData::m_Offset
int m_Offset
Definition: otbRadarsat2ImageMetadataInterface.h:155
otb::Radarsat2CalibrationLookupData::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbRadarsat2ImageMetadataInterface.h:90
otb::MetaDataKey::VectorType
std::vector< double > VectorType
Definition: otbMetaDataKey.h:119
otb::MetaDataKey::VariableLengthVectorType
itk::VariableLengthVector< double > VariableLengthVectorType
Definition: otbMetaDataKey.h:121
otb::Radarsat2ImageMetadataInterface::LookupDataPointerType
Superclass::LookupDataPointerType LookupDataPointerType
Definition: otbRadarsat2ImageMetadataInterface.h:54
otb::Radarsat2ImageMetadataInterface::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbRadarsat2ImageMetadataInterface.h:42
otb::Radarsat2CalibrationLookupData::Radarsat2CalibrationLookupData
Radarsat2CalibrationLookupData()
Definition: otbRadarsat2ImageMetadataInterface.h:104
otb::MetadataSupplierInterface
Base class to access metadata information in files/images.
Definition: otbMetadataSupplierInterface.h:40
otb::Radarsat2CalibrationLookupData::IndexValueType
itk::IndexValueType IndexValueType
Definition: otbRadarsat2ImageMetadataInterface.h:97
otb::Radarsat2CalibrationLookupData::operator=
void operator=(const Self &)=delete
otb::Radarsat2CalibrationLookupData::~Radarsat2CalibrationLookupData
~Radarsat2CalibrationLookupData() override
Definition: otbRadarsat2ImageMetadataInterface.h:108
otb::Radarsat2ImageMetadataInterface::ImageType
Superclass::ImageType ImageType
Definition: otbRadarsat2ImageMetadataInterface.h:48
otb::ImageMetadataInterfaceBase
Base class for captor metadata reading.
Definition: otbImageMetadataInterfaceBase.h:44
otb::Radarsat2CalibrationLookupData::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbRadarsat2ImageMetadataInterface.h:91
otb::Radarsat2CalibrationLookupData::Self
Radarsat2CalibrationLookupData Self
Definition: otbRadarsat2ImageMetadataInterface.h:88
otb::Radarsat2ImageMetadataInterface::VariableLengthVectorType
Superclass::VariableLengthVectorType VariableLengthVectorType
Definition: otbRadarsat2ImageMetadataInterface.h:53
otb::ImageMetadata
Generic class containing image metadata used in OTB.
Definition: otbImageMetadata.h:270
otb::SARCalib
SAR calibration LUTs.
Definition: otbSARMetadata.h:281
otb::Radarsat2ImageMetadataInterface::MetaDataDictionaryType
Superclass::MetaDataDictionaryType MetaDataDictionaryType
Definition: otbRadarsat2ImageMetadataInterface.h:51
otb::SarImageMetadataInterface
Class for SAR captor metadata reading.
Definition: otbSarImageMetadataInterface.h:42
otb::Radarsat2CalibrationLookupData::m_Gains
GainListType m_Gains
Definition: otbRadarsat2ImageMetadataInterface.h:154
otbSarImageMetadataInterface.h
otb::SarCalibrationLookupData::SetType
void SetType(short t)
Definition: otbSarCalibrationLookupData.h:76
otb::Radarsat2ImageMetadataInterface::VectorType
Superclass::VectorType VectorType
Definition: otbRadarsat2ImageMetadataInterface.h:52