otbSarImageMetadataInterface.h 5.33 KB
Newer Older
1
/*
2
 * Copyright (C) 2005-2020 Centre National d'Etudes Spatiales (CNES)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
 *
 * This file is part of Orfeo Toolbox
 *
 *     https://www.orfeo-toolbox.org/
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
20

21 22
#ifndef otbSarImageMetadataInterface_h
#define otbSarImageMetadataInterface_h
23

Emmanuel Christophe's avatar
Emmanuel Christophe committed
24
#include <string>
25
#include <vector>
26
#include "OTBMetadataExport.h"
27 28
#include "otbImageMetadataInterfaceBase.h"
#include "itkPointSet.h"
29 30
#include "otbSarCalibrationLookupData.h"
#include "otbStringUtils.h"
31
#include "otbSARMetadata.h"
32 33 34 35 36 37 38

namespace otb
{
/** \class SarImageMetadataInterface
 *
 * \brief Class for SAR captor metadata reading.
 *
39 40
 *
 * \ingroup OTBMetadata
41
 */
42
class OTBMetadata_EXPORT SarImageMetadataInterface : public ImageMetadataInterfaceBase
43 44 45 46 47 48 49 50 51 52
{
public:
  typedef SarImageMetadataInterface     Self;
  typedef ImageMetadataInterfaceBase    Superclass;
  typedef itk::SmartPointer<Self>       Pointer;
  typedef itk::SmartPointer<const Self> ConstPointer;

  /** Run-time type information (and related methods). */
  itkTypeMacro(SarImageMetadataInterface, ImageMetadataInterfaceBase);

53 54 55 56 57 58 59 60 61 62 63 64 65 66
  typedef Superclass::ImageType                ImageType;
  typedef ImageType::IndexType                 IndexType;
  typedef Superclass::MetaDataDictionaryType   MetaDataDictionaryType;
  typedef Superclass::VectorType               VectorType;
  typedef Superclass::VariableLengthVectorType VariableLengthVectorType;
  typedef Superclass::ImageKeywordlistType     ImageKeywordlistType;
  typedef Superclass::UIntVectorType           UIntVectorType;
  typedef Superclass::StringVectorType         StringVectorType;
  typedef itk::PointSet<double, 2> PointSetType;
  typedef PointSetType::Pointer    PointSetPointer;
  typedef double                   RealType;
  typedef PointSetType::PointType  PointType;
  typedef SarCalibrationLookupData LookupDataType;
  typedef LookupDataType::Pointer  LookupDataPointerType;
67 68

  virtual void CreateCalibrationLookupData(const short t);
69

70 71 72 73 74 75 76 77
  const LookupDataPointerType GetCalibrationLookupData(const short type);

  bool HasCalibrationLookupDataFlag() const;

  void SetCalibrationLookupData(LookupDataType* lut)
  {
    m_SarLut = lut;
  }
78

79
  virtual RealType GetRadiometricCalibrationScale() const;
80 81 82 83 84 85

  virtual PointSetPointer GetRadiometricCalibrationAntennaPatternNewGain() const;
  virtual PointSetPointer GetRadiometricCalibrationAntennaPatternOldGain() const;
  virtual PointSetPointer GetRadiometricCalibrationIncidenceAngle() const;
  virtual PointSetPointer GetRadiometricCalibrationRangeSpreadLoss() const;
  virtual PointSetPointer GetRadiometricCalibrationNoise() const;
86

87 88 89 90 91
  virtual IndexType GetRadiometricCalibrationAntennaPatternNewGainPolynomialDegree() const;
  virtual IndexType GetRadiometricCalibrationAntennaPatternOldGainPolynomialDegree() const;
  virtual IndexType GetRadiometricCalibrationIncidenceAnglePolynomialDegree() const;
  virtual IndexType GetRadiometricCalibrationRangeSpreadLossPolynomialDegree() const;
  virtual IndexType GetRadiometricCalibrationNoisePolynomialDegree() const;
92

93 94 95
  virtual double GetPRF() const                  = 0;
  virtual double GetRSF() const                  = 0;
  virtual double GetRadarFrequency() const       = 0;
96
  virtual double GetCenterIncidenceAngle() const = 0;
97

98 99 100 101 102 103 104

  virtual double GetRescalingFactor() const;

  virtual const std::string GetProductType() const;

  virtual const std::string GetAcquisitionMode() const;

105
  /** Get the enhanced band names (No enhanced band name support for SAR) */
106
  StringVectorType GetEnhancedBandNames() const override
107
  {
108
    StringVectorType nothing;
109 110 111
    return nothing;
  }

112 113 114 115
  /** Reads into the MetaDataDictionary to find an OSSIM ImageKeywordlist,
   * then translate it into ImageMetadata. Handles most SAR sensors.
   * Returns true if succeed. */
  bool ConvertImageKeywordlistToImageMetadata() override;
116 117 118

  virtual void ParseGdal(const MetadataSupplierInterface &) =0;

119
  virtual void ParseGeom(const MetadataSupplierInterface &) =0;
Julien Osman's avatar
Julien Osman committed
120
  bool GetSAR(const MetadataSupplierInterface &, SARParam &) const;
121 122 123 124 125
  std::vector<AzimuthFmRate> GetAzimuthFmRateGeom(const MetadataSupplierInterface &) const;
  std::vector<DopplerCentroid> GetDopplerCentroidGeom(const MetadataSupplierInterface &) const;
  std::vector<Orbit> GetOrbitsGeom(const MetadataSupplierInterface &) const;
  std::vector<CalibrationVector> GetCalibrationVectorGeom(const MetadataSupplierInterface &) const;
  std::vector<SARNoise> GetNoiseVectorGeom(const MetadataSupplierInterface &) const;
126

127 128
protected:
  SarImageMetadataInterface();
129 130 131
  ~SarImageMetadataInterface() override
  {
  }
132

133 134 135
  PointSetPointer GetConstantValuePointSet(const RealType& value) const;
  IndexType GetConstantPolynomialDegree() const;

136
  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
137

138 139 140
  LookupDataPointerType m_SarLut;


141
private:
142 143
  SarImageMetadataInterface(const Self&) = delete;
  void operator=(const Self&) = delete;
144 145 146 147 148
};

} // end namespace otb

#endif