OTB  9.0.0
Orfeo Toolbox
otbSARMetadata.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 otbSARMetadata_h
22 #define otbSARMetadata_h
23 
24 #include "OTBMetadataExport.h"
25 #include "otbMetaDataKey.h"
27 
28 #include <string>
29 #include <vector>
30 #include <sstream>
31 #include <unordered_map>
32 
33 #include "itkPoint.h"
34 
35 #include "itkPointSet.h"
36 #include "otbDateTime.h"
37 
38 namespace otb
39 {
40 
41 class SarCalibrationLookupData;
42 
48 struct OTBMetadata_EXPORT AzimuthFmRate
49 {
50 
53 
55  double t0;
56 
58  std::vector<double> azimuthFmRatePolynomial;
59 
61  void ToKeywordlist(MetaData::Keywordlist & kwl, const std::string & prefix = "") const;
62 
64  static AzimuthFmRate FromKeywordlist(const MetaData::Keywordlist & kwl, const std::string & prefix = "");
65 };
66 
71 struct OTBMetadata_EXPORT DopplerCentroid
72 {
73 
76  /* Two-way slant range time origin for Doppler centroid estimate */
77  double t0;
78  /* Doppler centroid estimated from data */
79  std::vector<double> dopCoef;
80  /* Doppler centroid estimated from orbit */
81  std::vector<double> geoDopCoef;
82 
84  void ToKeywordlist(MetaData::Keywordlist & kwl, const std::string & prefix = "") const;
85 
87  static DopplerCentroid FromKeywordlist(const MetaData::Keywordlist & kwl, const std::string & prefix = "");
88 };
89 
94 struct OTBMetadata_EXPORT Orbit
95 {
96  using PointType = itk::Point<double, 3>;
97 
100 
103 
106 
108  void ToKeywordlist(MetaData::Keywordlist & kwl, const std::string & prefix = "") const;
109 
111  static Orbit FromKeywordlist(const MetaData::Keywordlist & kwl, const std::string & prefix = "");
112 };
113 
118 struct OTBMetadata_EXPORT BurstRecord
119 {
122  unsigned long startLine;
123  unsigned long endLine;
124  unsigned long startSample;
125  unsigned long endSample;
127 
129  void ToKeywordlist(MetaData::Keywordlist & kwl, const std::string & prefix = "") const;
130 
132  static BurstRecord FromKeywordlist(const MetaData::Keywordlist & kwl, const std::string & prefix = "");
133 };
134 
135 
140 struct OTBMetadata_EXPORT GCPTime
141 {
142 
145 
148 
150  void ToKeywordlist(MetaData::Keywordlist & kwl, const std::string & prefix = "") const;
151 };
152 
159 {
161  double rg0;
162  std::vector<double> coeffs;
163 
165  void ToKeywordlist(MetaData::Keywordlist & kwl, const std::string & prefix = "") const;
166 
168  static CoordinateConversionRecord FromKeywordlist(const MetaData::Keywordlist & kwl, const std::string & prefix = "");
169 };
170 
175 {
176 
178  unsigned long referenceRow;
179 
181  unsigned long referenceColumn;
182 
184  double latitude;
185 
187  double longitude;
188 
191 
193  double rangeTime;
194 
197 
199  void ToKeywordlist(MetaData::Keywordlist & kwl, const std::string & prefix = "") const;
200 
202  static InfoSceneCoord FromKeywordlist(const MetaData::Keywordlist & kwl, const std::string & prefix = "");
203 };
204 
211 struct OTBMetadata_EXPORT SARParam
212 {
213 
217  std::vector<AzimuthFmRate> azimuthFmRates;
218 
223 
224  unsigned long numberOfLinesPerBurst;
225  unsigned long numberOfSamplesPerBurst;
226 
227  double azimuthBandwidth = 0.;
228  double rangeBandwidth = 0.;
229  double azimuthSteeringRate = 0.;
230 
231  bool rightLookingFlag = true;
232 
234  std::vector<DopplerCentroid> dopplerCentroids;
235 
237  std::vector<Orbit> orbits;
238 
240  std::vector<BurstRecord> burstRecords;
241 
243  std::unordered_map<std::string, GCPTime> gcpTimes;
244 
246  std::vector<CoordinateConversionRecord> slantRangeToGroundRangeRecords;
247 
249  std::vector<CoordinateConversionRecord> groundRangeToSlantRangeRecords;
250 
257 
259  void ToKeywordlist(MetaData::Keywordlist & kwl, const std::string & prefix) const;
260 
262  void FromKeywordlist(const MetaData::Keywordlist & kwl, const std::string & prefix);
263 
264  // Equality comparison operator (hidden friend idiom)
265  friend bool operator==(const SARParam & lhs, const SARParam & rhs)
266  {
267  MetaData::Keywordlist lhs_kwl;
268  lhs.ToKeywordlist(lhs_kwl, "");
269  MetaData::Keywordlist rhs_kwl;
270  rhs.ToKeywordlist(rhs_kwl, "");
271  return lhs_kwl == rhs_kwl;
272  }
273 };
274 
281 struct OTBMetadata_EXPORT SARCalib
282 {
283  using PointSetType = itk::PointSet<double, 2>;
284  using ArrayType = std::array<int, 2>;
285 
286  bool calibrationLookupFlag = false;
295  PointSetType::Pointer radiometricCalibrationNoise = PointSetType::New();
296  PointSetType::Pointer radiometricCalibrationAntennaPatternNewGain = PointSetType::New();
297  PointSetType::Pointer radiometricCalibrationAntennaPatternOldGain = PointSetType::New();
298  PointSetType::Pointer radiometricCalibrationIncidenceAngle = PointSetType::New();
299  PointSetType::Pointer radiometricCalibrationRangeSpreadLoss = PointSetType::New();
300  std::unordered_map<short, SarCalibrationLookupData::Pointer> calibrationLookupData;
301 
303  void ToKeywordlist(MetaData::Keywordlist & kwl, const std::string & prefix) const;
304 
306  void FromKeywordlist(const MetaData::Keywordlist & kwl, const std::string & prefix);
307 };
308 
309 } // end namespace otb
310 
311 #endif
otb::AzimuthFmRate::t0
double t0
Definition: otbSARMetadata.h:55
otb::SARParam::azimuthFmRates
std::vector< AzimuthFmRate > azimuthFmRates
Definition: otbSARMetadata.h:217
otb::SARCalib::calibrationLookupData
std::unordered_map< short, SarCalibrationLookupData::Pointer > calibrationLookupData
Definition: otbSARMetadata.h:300
otb::Orbit::velocity
PointType velocity
Definition: otbSARMetadata.h:105
otb::BurstRecord::azimuthStartTime
MetaData::TimePoint azimuthStartTime
Definition: otbSARMetadata.h:120
otb::SARCalib::radiometricCalibrationNoisePolynomialDegree
ArrayType radiometricCalibrationNoisePolynomialDegree
Definition: otbSARMetadata.h:290
otb::SARCalib::calibrationStopTime
MetaData::TimePoint calibrationStopTime
Definition: otbSARMetadata.h:289
otb::AzimuthFmRate
This structure is used to manage parameters related to the Azimuth Frequency Modulation rate.
Definition: otbSARMetadata.h:48
otb::SARParam::numberOfSamplesPerBurst
unsigned long numberOfSamplesPerBurst
Definition: otbSARMetadata.h:225
otb::SARParam::rangeSamplingRate
double rangeSamplingRate
Definition: otbSARMetadata.h:221
otbDateTime.h
otb::DopplerCentroid::dopCoef
std::vector< double > dopCoef
Definition: otbSARMetadata.h:79
otb::DopplerCentroid::azimuthTime
MetaData::TimePoint azimuthTime
Definition: otbSARMetadata.h:75
otb::BurstRecord::azimuthAnxTime
double azimuthAnxTime
Definition: otbSARMetadata.h:126
otb::SARParam::ulSceneCoord
InfoSceneCoord ulSceneCoord
Definition: otbSARMetadata.h:253
otb::InfoSceneCoord::FromKeywordlist
static InfoSceneCoord FromKeywordlist(const MetaData::Keywordlist &kwl, const std::string &prefix="")
otb::BurstRecord::endSample
unsigned long endSample
Definition: otbSARMetadata.h:125
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::InfoSceneCoord::ToKeywordlist
void ToKeywordlist(MetaData::Keywordlist &kwl, const std::string &prefix="") const
otb::SARParam::slantRangeToGroundRangeRecords
std::vector< CoordinateConversionRecord > slantRangeToGroundRangeRecords
Definition: otbSARMetadata.h:246
otb::InfoSceneCoord::longitude
double longitude
Definition: otbSARMetadata.h:187
otb::SARParam::operator==
friend bool operator==(const SARParam &lhs, const SARParam &rhs)
Definition: otbSARMetadata.h:265
otb::BurstRecord::startSample
unsigned long startSample
Definition: otbSARMetadata.h:124
otbSarCalibrationLookupData.h
otb::Orbit::PointType
itk::Point< double, 3 > PointType
Definition: otbSARMetadata.h:96
otb::CoordinateConversionRecord::FromKeywordlist
static CoordinateConversionRecord FromKeywordlist(const MetaData::Keywordlist &kwl, const std::string &prefix="")
otb::GCPTime::azimuthTime
MetaData::TimePoint azimuthTime
Definition: otbSARMetadata.h:144
otb::SARCalib::radiometricCalibrationAntennaPatternNewGainPolynomialDegree
ArrayType radiometricCalibrationAntennaPatternNewGainPolynomialDegree
Definition: otbSARMetadata.h:291
otb::SARParam::orbits
std::vector< Orbit > orbits
Definition: otbSARMetadata.h:237
otb::CoordinateConversionRecord
This structure contains coefficients to convert between coordinates types, e.g. from ground range to ...
Definition: otbSARMetadata.h:158
otb::SARCalib::radiometricCalibrationRangeSpreadLossPolynomialDegree
ArrayType radiometricCalibrationRangeSpreadLossPolynomialDegree
Definition: otbSARMetadata.h:294
otb::DopplerCentroid::t0
double t0
Definition: otbSARMetadata.h:77
otb::SARParam
SAR sensors parameters.
Definition: otbSARMetadata.h:211
otb::SARParam::burstRecords
std::vector< BurstRecord > burstRecords
Definition: otbSARMetadata.h:240
otb::SARParam::numberOfLinesPerBurst
unsigned long numberOfLinesPerBurst
Definition: otbSARMetadata.h:224
otb::InfoSceneCoord::referenceRow
unsigned long referenceRow
Definition: otbSARMetadata.h:178
otb::InfoSceneCoord
Represents an InfoSceneCoord.
Definition: otbSARMetadata.h:174
otb::CoordinateConversionRecord::coeffs
std::vector< double > coeffs
Definition: otbSARMetadata.h:162
otb::SARParam::azimuthTimeInterval
MetaData::Duration azimuthTimeInterval
Definition: otbSARMetadata.h:219
otb::SARParam::gcpTimes
std::unordered_map< std::string, GCPTime > gcpTimes
Definition: otbSARMetadata.h:243
otb::AzimuthFmRate::azimuthFmRatePolynomial
std::vector< double > azimuthFmRatePolynomial
Definition: otbSARMetadata.h:58
otb::BurstRecord::startLine
unsigned long startLine
Definition: otbSARMetadata.h:122
otb::InfoSceneCoord::azimuthTime
MetaData::TimePoint azimuthTime
Definition: otbSARMetadata.h:190
otb::SARParam::ToKeywordlist
void ToKeywordlist(MetaData::Keywordlist &kwl, const std::string &prefix) const
otb::CoordinateConversionRecord::ToKeywordlist
void ToKeywordlist(MetaData::Keywordlist &kwl, const std::string &prefix="") const
otb::InfoSceneCoord::incidenceAngle
double incidenceAngle
Definition: otbSARMetadata.h:196
otb::DopplerCentroid::geoDopCoef
std::vector< double > geoDopCoef
Definition: otbSARMetadata.h:81
otb::Orbit::time
MetaData::TimePoint time
Definition: otbSARMetadata.h:99
otb::BurstRecord::azimuthStopTime
MetaData::TimePoint azimuthStopTime
Definition: otbSARMetadata.h:121
otb::CoordinateConversionRecord::rg0
double rg0
Definition: otbSARMetadata.h:161
otb::SARParam::centerSceneCoord
InfoSceneCoord centerSceneCoord
Definition: otbSARMetadata.h:252
otb::SARCalib::radiometricCalibrationAntennaPatternOldGainPolynomialDegree
ArrayType radiometricCalibrationAntennaPatternOldGainPolynomialDegree
Definition: otbSARMetadata.h:292
otbMetaDataKey.h
otb::SARParam::urSceneCoord
InfoSceneCoord urSceneCoord
Definition: otbSARMetadata.h:254
otb::BurstRecord
This structure is used to handle burst records.
Definition: otbSARMetadata.h:118
otb::SARParam::rangeResolution
double rangeResolution
Definition: otbSARMetadata.h:222
otb::CoordinateConversionRecord::azimuthTime
MetaData::TimePoint azimuthTime
Definition: otbSARMetadata.h:160
otb::DopplerCentroid
This structure is used to handle Doppler centroid estimates.
Definition: otbSARMetadata.h:71
otb::SARCalib::ArrayType
std::array< int, 2 > ArrayType
Definition: otbSARMetadata.h:284
otb::SARParam::nearRangeTime
double nearRangeTime
Definition: otbSARMetadata.h:220
otb::SARParam::dopplerCentroids
std::vector< DopplerCentroid > dopplerCentroids
Definition: otbSARMetadata.h:234
otb::MetaData::Keywordlist
std::unordered_map< std::string, std::string > Keywordlist
Definition: otbMetaDataKey.h:233
otb::InfoSceneCoord::referenceColumn
unsigned long referenceColumn
Definition: otbSARMetadata.h:181
otb::SARCalib::rescalingFactor
double rescalingFactor
Definition: otbSARMetadata.h:287
otb::SARParam::lrSceneCoord
InfoSceneCoord lrSceneCoord
Definition: otbSARMetadata.h:255
otb::SARCalib::PointSetType
itk::PointSet< double, 2 > PointSetType
Definition: otbSARMetadata.h:283
otb::BurstRecord::endLine
unsigned long endLine
Definition: otbSARMetadata.h:123
otb::AzimuthFmRate::azimuthTime
MetaData::TimePoint azimuthTime
Definition: otbSARMetadata.h:52
otb::MetaData::TimePoint
Represents a point in Time.
Definition: otbDateTime.h:94
otb::SARCalib
SAR calibration LUTs.
Definition: otbSARMetadata.h:281
otb::InfoSceneCoord::latitude
double latitude
Definition: otbSARMetadata.h:184
otb::GCPTime::slantRangeTime
double slantRangeTime
Definition: otbSARMetadata.h:147
otb::GCPTime
This structure contains the azimuth and range times associated with a gcp.
Definition: otbSARMetadata.h:140
otb::SARParam::groundRangeToSlantRangeRecords
std::vector< CoordinateConversionRecord > groundRangeToSlantRangeRecords
Definition: otbSARMetadata.h:249
otb::SARCalib::calibrationStartTime
MetaData::TimePoint calibrationStartTime
Definition: otbSARMetadata.h:288
otb::InfoSceneCoord::rangeTime
double rangeTime
Definition: otbSARMetadata.h:193
otb::Orbit::position
PointType position
Definition: otbSARMetadata.h:102
otb::MetaData::Duration
Represents a duration.
Definition: otbDateTime.h:162
otb::Orbit
This structure is used to handle orbit information.
Definition: otbSARMetadata.h:94
otb::SARParam::llSceneCoord
InfoSceneCoord llSceneCoord
Definition: otbSARMetadata.h:256
otb::SARCalib::radiometricCalibrationIncidenceAnglePolynomialDegree
ArrayType radiometricCalibrationIncidenceAnglePolynomialDegree
Definition: otbSARMetadata.h:293