Commit 1973b2db authored by Julien Osman's avatar Julien Osman
Browse files

BUG: Correctly set the Radarsat2 calibration test

parent 86261af7
......@@ -14,13 +14,11 @@
<radarParameters>
<acquisitionType>Fine Quad Polarization</acquisitionType>
<beams>Q9</beams>
<polarizations>HH VV HV VH</polarizations>
<polarizations>HV VH</polarizations>
<pulses>30short</pulses>
<rank beam="Q9">16</rank>
<settableGain beam="Q9" pole="HH" wing="Combined" units="dB">-1.349999992092401e+01</settableGain>
<settableGain beam="Q9" pole="HV" wing="Combined" units="dB">-1.349999992092401e+01</settableGain>
<settableGain beam="Q9" pole="VH" wing="Combined" units="dB">-1.349999992092401e+01</settableGain>
<settableGain beam="Q9" pole="VV" wing="Combined" units="dB">-1.349999992092401e+01</settableGain>
<radarCenterFrequency units="Hz">5.404999242769673e+09</radarCenterFrequency>
<pulseRepetitionFrequency beam="Q9" units="Hz">2.756302978515625e+03</pulseRepetitionFrequency>
<pulseLength pulse="30short" units="s">2.080838775634766e-05</pulseLength>
......@@ -53,20 +51,8 @@
<rawDataAttributes>
<numberOfInputDataGaps>0</numberOfInputDataGaps>
<gapSize>100</gapSize>
<numberOfMissingLines pole="HH">0</numberOfMissingLines>
<numberOfMissingLines pole="HV">0</numberOfMissingLines>
<numberOfMissingLines pole="VH">0</numberOfMissingLines>
<numberOfMissingLines pole="VV">0</numberOfMissingLines>
<rawDataAnalysis pole="HH" wing="Combined" pulse="30short">
<bias dataStream="Real">-4.12333608e-01</bias>
<bias dataStream="Imaginary">-1.27562153e+00</bias>
<standardDeviation dataStream="Real">2.30635643e+01</standardDeviation>
<standardDeviation dataStream="Imaginary">2.45960903e+01</standardDeviation>
<gainImbalance>8.792668205684464e-01</gainImbalance>
<phaseOrthogonality units="deg">-2.41488552e+00</phaseOrthogonality>
<rawDataHistogram dataStream="Real">0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2503 0 0 0 0 0 0 0 0 0 0 34133 0 0 0 0 0 0 0 0 0 40918 0 0 0 6934 0 0 0 20180 0 0 76351 0 0 11019 0 0 77962 0 0 438 0 56031 0 0 0 0 178502 0 1686 0 164814 0 7202 88309 500 40349 538 0 3613 21557 216585 1084 219409 114576 63893 1834 7896 35360 652 909 774 433 24366 5613 1731 62681 113021 215049 812 216365 21733 3523 0 546 39472 427 86060 6391 0 160817 0 1450 0 173450 0 0 0 0 53556 0 367 0 0 74609 0 0 10246 0 0 73230 0 0 18181 0 0 0 6613 0 0 0 37001 0 0 0 0 0 0 0 0 0 30872 0 0 0 0 0 0 0 0 0 0 2270 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0</rawDataHistogram>
<rawDataHistogram dataStream="Imaginary">0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3919 0 0 0 0 0 0 0 0 0 0 49134 0 0 0 0 0 0 0 0 0 56982 0 0 0 7972 0 0 0 28838 0 0 85985 0 0 15708 0 0 87193 0 0 500 0 61478 0 0 0 0 181249 0 1807 0 165372 0 8126 89786 522 41097 579 0 3579 20361 204726 1388 208407 107841 60210 1875 8463 37674 806 721 493 245 19751 4656 1657 58049 104363 198927 788 199739 19817 3297 0 509 37597 474 81095 6494 0 153745 0 1509 0 166745 0 0 0 0 53843 0 426 0 0 76592 0 0 11742 0 0 75944 0 0 22215 0 0 0 7043 0 0 0 45104 0 0 0 0 0 0 0 0 0 39286 0 0 0 0 0 0 0 0 0 0 2953 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0</rawDataHistogram>
</rawDataAnalysis>
<rawDataAnalysis pole="HV" wing="Combined" pulse="30short">
<bias dataStream="Real">-5.78479528e-01</bias>
<bias dataStream="Imaginary">-1.05201924e+00</bias>
......@@ -87,16 +73,6 @@
<rawDataHistogram dataStream="Real">0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2418 0 11114 0 0 68494 4765 37208 58643 105779 12706 38142 88500 366685 123156 85035 516751 48663 16769 490201 79837 108821 326847 75530 31878 11220 87864 45038 27577 4192 53228 0 0 8511 0 1824 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0</rawDataHistogram>
<rawDataHistogram dataStream="Imaginary">0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4267 0 18953 0 0 114956 6209 63444 92562 133101 14005 48368 105478 390509 131897 84762 505702 36969 7537 426917 70502 90358 279681 64196 27470 10030 77240 39902 25608 3738 52350 0 0 8644 0 2041 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0</rawDataHistogram>
</rawDataAnalysis>
<rawDataAnalysis pole="VV" wing="Combined" pulse="30short">
<bias dataStream="Real">-6.39854252e-01</bias>
<bias dataStream="Imaginary">-1.07624507e+00</bias>
<standardDeviation dataStream="Real">2.37677288e+01</standardDeviation>
<standardDeviation dataStream="Imaginary">2.54618244e+01</standardDeviation>
<gainImbalance>8.713573587425003e-01</gainImbalance>
<phaseOrthogonality units="deg">-3.46600151e+00</phaseOrthogonality>
<rawDataHistogram dataStream="Real">0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 18 0 0 0 0 0 0 0 0 0 0 0 0 0 6258 0 0 0 0 0 0 0 0 0 0 39012 0 0 0 0 43 0 0 0 0 36699 0 0 0 16471 0 0 0 19368 0 0 85366 0 0 8433 0 0 70778 0 0 166 0 73214 0 0 98 0 187734 0 3085 0 149262 0 4880 83585 124 29326 951 0 1504 49881 238941 4735 199776 107668 45590 626 17071 28004 693 883 662 377 16975 10741 604 44430 105591 193275 1791 236680 49566 1279 0 814 27621 106 79956 4238 0 143398 0 2721 0 180294 0 97 0 0 69709 0 121 0 0 65543 0 0 7155 0 0 79914 0 0 16792 0 0 0 14954 0 0 0 32064 0 0 0 0 63 0 0 0 0 34245 0 0 0 0 0 0 0 0 0 0 5367 0 0 0 0 0 0 0 0 0 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0</rawDataHistogram>
<rawDataHistogram dataStream="Imaginary">0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 25 0 0 0 0 0 0 0 0 0 0 0 0 0 9034 0 0 0 0 0 0 0 0 0 0 54531 0 0 0 0 70 0 0 0 0 50600 0 0 0 18204 0 0 0 26994 0 0 94169 0 0 11596 0 0 77946 0 0 172 0 77442 0 0 126 0 186799 0 3337 0 146845 0 5221 83087 119 28974 914 0 1484 46369 223076 5429 189068 100590 42547 771 16309 26908 678 783 531 282 16155 10233 537 41401 97981 179220 1988 219232 45820 1259 0 778 26803 130 76563 4500 0 137757 0 2872 0 175533 0 88 0 0 69820 0 132 0 0 69586 0 0 9129 0 0 85342 0 0 21947 0 0 0 16998 0 0 0 41269 0 0 0 0 64 0 0 0 0 45647 0 0 0 0 0 0 0 0 0 0 7562 0 0 0 0 0 0 0 0 0 0 0 0 0 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0</rawDataHistogram>
</rawDataAnalysis>
</rawDataAttributes>
<orbitAndAttitude>
<orbitInformation>
......@@ -208,8 +184,6 @@
<radiometricSmoothingPerformed>false</radiometricSmoothingPerformed>
<zeroDopplerTimeFirstLine>2008-04-05T12:49:01.091411Z</zeroDopplerTimeFirstLine>
<zeroDopplerTimeLastLine>2008-04-05T12:49:10.489507Z</zeroDopplerTimeLastLine>
<numberOfLinesProcessed pole="HH">13546</numberOfLinesProcessed>
<numberOfLinesProcessed pole="VV">13546</numberOfLinesProcessed>
<numberOfLinesProcessed pole="HV">13546</numberOfLinesProcessed>
<numberOfLinesProcessed pole="VH">13546</numberOfLinesProcessed>
<samplingWindowStartTimeFirstRawLine beam="Q9" units="s">1.386804810360777e-04</samplingWindowStartTimeFirstRawLine>
......@@ -4203,18 +4177,6 @@
<geodeticTerrainHeight units="m">4.532005615234375e+02</geodeticTerrainHeight>
</referenceEllipsoidParameters>
</geographicInformation>
<radiometricInformation pole="HH">
<mean dataStream="Real">3.196448160700000e+00</mean>
<mean dataStream="Imaginary">-4.389804585800000e+00</mean>
<standardDeviation dataStream="Real">1.090735445406200e+03</standardDeviation>
<standardDeviation dataStream="Imaginary">1.090560532417000e+03</standardDeviation>
</radiometricInformation>
<radiometricInformation pole="VV">
<mean dataStream="Real">-5.928972753100000e+00</mean>
<mean dataStream="Imaginary">-2.222375495900000e+00</mean>
<standardDeviation dataStream="Real">1.090629526857900e+03</standardDeviation>
<standardDeviation dataStream="Imaginary">1.090603975596300e+03</standardDeviation>
</radiometricInformation>
<radiometricInformation pole="HV">
<mean dataStream="Real">-4.119978844300000e+00</mean>
<mean dataStream="Imaginary">3.350372237800000e+00</mean>
......@@ -4230,8 +4192,6 @@
<lookupTable incidenceAngleCorrection="Beta Nought">lutBeta.xml</lookupTable>
<lookupTable incidenceAngleCorrection="Sigma Nought">lutSigma.xml</lookupTable>
<lookupTable incidenceAngleCorrection="Gamma">lutGamma.xml</lookupTable>
<fullResolutionImageData pole="HH">imagery_HH.tif</fullResolutionImageData>
<fullResolutionImageData pole="VV">imagery_VV.tif</fullResolutionImageData>
<fullResolutionImageData pole="HV">imagery_HV.tif</fullResolutionImageData>
<fullResolutionImageData pole="VH">imagery_VH.tif</fullResolutionImageData>
</imageAttributes>
......
......@@ -40,7 +40,7 @@ endif()
otb_test_application(NAME apTvRaSARCalibration_RADARSAT2
APP SARCalibration
OPTIONS -in ${INPUTDATA}/RADARSAT2_ALTONA_300_300_VV.tif?&geom=${INPUTDATA}/RADARSAT2_ALTONA_300_300_VV.geom
OPTIONS -in ${INPUTDATA}/radarsat2/RADARSAT2_ALTONA_300_300_VV.tif?&geom=${INPUTDATA}/radarsat2/RADARSAT2_ALTONA_300_300_VV.geom
-out ${TEMP}/apTvRaSarRadiometricCalibration_RADARSAT2.tif
VALID --compare-image ${EPSILON_5}
${BASELINE}/raTvSarRadiometricCalibration_RADARSAT2.tif
......
......@@ -96,7 +96,7 @@ public:
double GetCenterIncidenceAngle(const MetadataSupplierInterface&) const override;
/*get lookup data for calculating backscatter */
bool HasCalibrationLookupDataFlag() const override;
bool HasCalibrationLookupDataFlag(const MetadataSupplierInterface&) const override;
bool CreateCalibrationLookupData(SARCalib&, const ImageMetadata&, const MetadataSupplierInterface&, const bool) const override;
void ParseGdal(ImageMetadata &) override;
......
......@@ -68,8 +68,7 @@ public:
virtual bool CreateCalibrationLookupData(SARCalib&, const ImageMetadata&, const MetadataSupplierInterface&, const bool) const;
virtual bool HasCalibrationLookupDataFlag() const;
bool HasCalibrationLookupDataFlagGeom() const;
virtual bool HasCalibrationLookupDataFlag(const MetadataSupplierInterface&) const;
virtual RealType GetRadiometricCalibrationScale() const;
......
......@@ -97,7 +97,7 @@ public:
double GetCenterIncidenceAngle(const MetadataSupplierInterface&) const override;
/*get lookup data for calculating backscatter */
bool HasCalibrationLookupDataFlag() const override;
bool HasCalibrationLookupDataFlag(const MetadataSupplierInterface&) const override;
bool CreateCalibrationLookupData(SARCalib&, const ImageMetadata&, const MetadataSupplierInterface&, const bool) const override;
void ParseGdal(ImageMetadata &) override;
......
......@@ -51,9 +51,9 @@ bool Radarsat2ImageMetadataInterface::CanRead() const
return false;
}
bool Radarsat2ImageMetadataInterface::HasCalibrationLookupDataFlag() const
bool Radarsat2ImageMetadataInterface::HasCalibrationLookupDataFlag(const MetadataSupplierInterface &mds) const
{
return true; // TODO
return mds.GetAs<bool>(true, "support_data.calibration_lookup_flag");
}
bool Radarsat2ImageMetadataInterface::CreateCalibrationLookupData(SARCalib& sarCalib,
......@@ -309,7 +309,6 @@ void Radarsat2ImageMetadataInterface::ParseGdal(ImageMetadata & imd)
void Radarsat2ImageMetadataInterface::ParseGeom(ImageMetadata & imd)
{
// Metadata read by GDAL
Fetch(MDTime::AcquisitionStartTime, imd, "support_data.image_date");
Fetch(MDNum::LineSpacing, imd, "meters_per_pixel_y");
Fetch(MDNum::PixelSpacing, imd, "meters_per_pixel_x");
......@@ -317,35 +316,39 @@ void Radarsat2ImageMetadataInterface::ParseGeom(ImageMetadata & imd)
imd.Add(MDStr::SensorID, "SAR");
// Product file
auto ProductFilePath = boost::filesystem::path(m_MetadataSupplierInterface->GetResourceFile());
auto ProductFilePath = boost::filesystem::path(m_MetadataSupplierInterface->GetResourceFile()); // TODO C++ 2017 use std::filesystem
if (!ProductFilePath.empty())
{
XMLMetadataSupplier ProductMS((ProductFilePath.remove_filename() /= "product.xml").string());
imd.Add(MDStr::Mission, ProductMS.GetAs<std::string>("product.sourceAttributes.satellite"));
imd.Add(MDNum::NumberOfLines, ProductMS.GetAs<int>("product.imageAttributes.rasterAttributes.numberOfLines"));
imd.Add(MDNum::NumberOfColumns, ProductMS.GetAs<int>("product.imageAttributes.rasterAttributes.numberOfSamplesPerLine"));
imd.Add(MDTime::ProductionDate,
ProductMS.GetFirstAs<MetaData::Time>("product.imageGenerationParameters.generalProcessingInformation.processingTime"));
imd.Add(MDNum::AverageSceneHeight,
ProductMS.GetAs<double>("product.imageAttributes.geographicInformation.referenceEllipsoidParameters.geodeticTerrainHeight"));
imd.Add(MDNum::RadarFrequency, this->GetRadarFrequency());
imd.Add(MDNum::PRF, this->GetPRF());
imd.Add(MDNum::RSF, this->GetRSF());
imd.Add(MDNum::CenterIncidenceAngle, this->GetCenterIncidenceAngle(ProductMS));
imd.Add(MDStr::BeamMode, ProductMS.GetAs<std::string>("product.sourceAttributes.beamModeMnemonic"));
imd.Add("FACILITY_IDENTIFIER", ProductMS.GetAs<std::string>("product.sourceAttributes.inputDatasetFacilityId"));
imd.Add(MDStr::OrbitDirection, ProductMS.GetAs<std::string>("product.sourceAttributes.orbitAndAttitude.orbitInformation.passDirection"));
imd.Add(MDStr::ProductType, ProductMS.GetAs<std::string>("product.imageGenerationParameters.generalProcessingInformation.productType"));
auto polarizations = ProductMS.GetAsVector<std::string>("product.sourceAttributes.radarParameters.polarizations");
assert(polarizations.size() == imd.Bands.size());
SARParam sarParam;
for (int bandId = 0 ; bandId < polarizations.size() ; ++bandId)
ProductFilePath = ProductFilePath.remove_filename() /= "product.xml";
if(boost::filesystem::exists(ProductFilePath))
{
imd.Bands[bandId].Add(MDStr::Polarization, polarizations[bandId]);
imd.Bands[bandId].Add(MDGeom::SAR, sarParam);
XMLMetadataSupplier ProductMS((ProductFilePath.remove_filename() /= "product.xml").string());
imd.Add(MDStr::Mission, ProductMS.GetAs<std::string>("product.sourceAttributes.satellite"));
imd.Add(MDNum::NumberOfLines, ProductMS.GetAs<int>("product.imageAttributes.rasterAttributes.numberOfLines"));
imd.Add(MDNum::NumberOfColumns, ProductMS.GetAs<int>("product.imageAttributes.rasterAttributes.numberOfSamplesPerLine"));
imd.Add(MDTime::ProductionDate,
ProductMS.GetFirstAs<MetaData::Time>("product.imageGenerationParameters.generalProcessingInformation.processingTime"));
imd.Add(MDNum::AverageSceneHeight,
ProductMS.GetAs<double>("product.imageAttributes.geographicInformation.referenceEllipsoidParameters.geodeticTerrainHeight"));
imd.Add(MDNum::RadarFrequency, this->GetRadarFrequency());
imd.Add(MDNum::PRF, this->GetPRF());
imd.Add(MDNum::RSF, this->GetRSF());
imd.Add(MDNum::CenterIncidenceAngle, this->GetCenterIncidenceAngle(ProductMS));
imd.Add(MDStr::BeamMode, ProductMS.GetAs<std::string>("product.sourceAttributes.beamModeMnemonic"));
imd.Add("FACILITY_IDENTIFIER", ProductMS.GetAs<std::string>("product.sourceAttributes.inputDatasetFacilityId"));
imd.Add(MDStr::OrbitDirection, ProductMS.GetAs<std::string>("product.sourceAttributes.orbitAndAttitude.orbitInformation.passDirection"));
imd.Add(MDStr::ProductType, ProductMS.GetAs<std::string>("product.imageGenerationParameters.generalProcessingInformation.productType"));
auto polarizations = ProductMS.GetAsVector<std::string>("product.sourceAttributes.radarParameters.polarizations");
assert(polarizations.size() == imd.Bands.size());
SARParam sarParam;
for (int bandId = 0 ; bandId < polarizations.size() ; ++bandId)
{
imd.Bands[bandId].Add(MDStr::Polarization, polarizations[bandId]);
imd.Bands[bandId].Add(MDGeom::SAR, sarParam);
}
}
}
}
SARCalib sarCalib;
LoadRadiometricCalibrationData(sarCalib, *m_MetadataSupplierInterface, imd);
CreateCalibrationLookupData(sarCalib, imd, *m_MetadataSupplierInterface, true);
......
......@@ -79,9 +79,10 @@ const std::string SarImageMetadataInterface::GetAcquisitionMode() const
return "";
}
bool SarImageMetadataInterface::CreateCalibrationLookupData(SARCalib& sarCalib, const ImageMetadata&, const MetadataSupplierInterface &, const bool) const
bool SarImageMetadataInterface::CreateCalibrationLookupData(SARCalib& sarCalib, const ImageMetadata&, const MetadataSupplierInterface &mds, const bool) const
{
if (!HasCalibrationLookupDataFlag())
sarCalib.calibrationLookupFlag = HasCalibrationLookupDataFlag(mds);
if (!sarCalib.calibrationLookupFlag)
{
sarCalib.calibrationLookupData[SarCalibrationLookupData::SIGMA] = SarCalibrationLookupData::New();
sarCalib.calibrationLookupData[SarCalibrationLookupData::BETA] = SarCalibrationLookupData::New();
......@@ -92,17 +93,11 @@ bool SarImageMetadataInterface::CreateCalibrationLookupData(SARCalib& sarCalib,
return false;
}
bool SarImageMetadataInterface::HasCalibrationLookupDataFlag() const
bool SarImageMetadataInterface::HasCalibrationLookupDataFlag(const MetadataSupplierInterface&) const
{
return false;
}
bool SarImageMetadataInterface::HasCalibrationLookupDataFlagGeom() const
{
/* checking if the key exist is more than enough */
return m_MetadataSupplierInterface->GetAs<bool>(false, "support_data.calibration_lookup_flag");
}
SarImageMetadataInterface::RealType SarImageMetadataInterface::GetRadiometricCalibrationScale() const
{
return static_cast<SarImageMetadataInterface::RealType>(1.0);
......
......@@ -54,9 +54,9 @@ bool Sentinel1ImageMetadataInterface::CanRead() const
return sensorID.find("SENTINEL-1") != std::string::npos;
}
bool Sentinel1ImageMetadataInterface::HasCalibrationLookupDataFlag() const
bool Sentinel1ImageMetadataInterface::HasCalibrationLookupDataFlag(const MetadataSupplierInterface &mds) const
{
return true;
return mds.GetAs<bool>(true, "support_data.calibration_lookup_flag");
}
bool Sentinel1ImageMetadataInterface::CreateCalibrationLookupData(SARCalib& sarCalib,
......@@ -633,7 +633,6 @@ void Sentinel1ImageMetadataInterface::ParseGdal(ImageMetadata & imd)
SARCalib sarCalib;
std::istringstream(CalibrationMS.GetAs<std::string>("calibration.adsHeader.startTime")) >> sarCalib.calibrationStartTime;
std::istringstream(CalibrationMS.GetAs<std::string>("calibration.adsHeader.stopTime")) >> sarCalib.calibrationStopTime;
sarCalib.calibrationLookupFlag = HasCalibrationLookupDataFlag();
LoadRadiometricCalibrationData(sarCalib, *m_MetadataSupplierInterface, imd);
CreateCalibrationLookupData(sarCalib, imd, CalibrationMS, false);
imd.Add(MDGeom::SARCalib, sarCalib);
......@@ -679,7 +678,6 @@ void Sentinel1ImageMetadataInterface::ParseGeom(ImageMetadata & imd)
SARCalib sarCalib;
std::istringstream(m_MetadataSupplierInterface->GetAs<std::string>("calibration.startTime")) >> sarCalib.calibrationStartTime;
std::istringstream(m_MetadataSupplierInterface->GetAs<std::string>("calibration.stopTime")) >> sarCalib.calibrationStopTime;
sarCalib.calibrationLookupFlag = HasCalibrationLookupDataFlagGeom();
LoadRadiometricCalibrationData(sarCalib, *m_MetadataSupplierInterface, imd);
CreateCalibrationLookupData(sarCalib, imd, *m_MetadataSupplierInterface, true);
imd.Add(MDGeom::SARCalib, sarCalib);
......
......@@ -363,7 +363,7 @@ otb_add_test(NAME ioTvSarCalibrationLookupDataTest_RADARSAT2 COMMAND otbMetadata
--compare-ascii ${NOTOL} ${BASELINE_FILES}/ioTvSarCalibrationLookupDataTest_RADARSAT2.txt
${TEMP}/ioTvSarCalibrationLookupDataTest_RADARSAT2.txt
otbSarCalibrationLookupDataTest
${INPUTDATA}/RADARSAT2_ALTONA_300_300_VV.tif?&geom=${INPUTDATA}/RADARSAT2_ALTONA_300_300_VV.geom
${INPUTDATA}/radarsat2/RADARSAT2_ALTONA_300_300_VV.tif?&geom=${INPUTDATA}/radarsat2/RADARSAT2_ALTONA_300_300_VV.geom
${TEMP}/ioTvSarCalibrationLookupDataTest_RADARSAT2.txt
)
......
......@@ -68,7 +68,7 @@ int otbSarCalibrationLookupDataTest(int argc, char* argv[])
RealType lutVal = static_cast<RealType>(lookupDataObj->GetValue(10, 19));
outfile << imageMetadataInterface->HasCalibrationLookupDataFlag() << std::endl;
//outfile << imageMetadataInterface->HasCalibrationLookupDataFlag() << std::endl; TODO
outfile << lutVal << std::endl;
return EXIT_SUCCESS;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment