Commit efac1e8b authored by Julien Osman's avatar Julien Osman
Browse files

BUG: Deal with CalScale in different bands. Add SARCalib in ToJSON

parent 52fac90e
Pipeline #7330 failed with stages
in 87 minutes and 55 seconds
...@@ -299,6 +299,11 @@ void ImageMetadataBase::ToKeywordlist(Keywordlist& kwl) const ...@@ -299,6 +299,11 @@ void ImageMetadataBase::ToKeywordlist(Keywordlist& kwl) const
// To be completed by ImageIO // To be completed by ImageIO
oss << std::string("<SARParam>"); oss << std::string("<SARParam>");
} }
else if (kv.first == MDGeom::SARCalib)
{
// To be completed by ImageIO
oss << std::string("<SARCalib>");
}
// TODO : MDGeom::Adjustment // TODO : MDGeom::Adjustment
else else
{ {
...@@ -381,13 +386,12 @@ bool ImageMetadataBase::FromKeywordlist(const Keywordlist& kwl) ...@@ -381,13 +386,12 @@ bool ImageMetadataBase::FromKeywordlist(const Keywordlist& kwl)
{ {
this->Add(geomKey->second, Utils::LexicalCast<int>(kv.second.c_str(), "Keywordlist.second.c_str()")); this->Add(geomKey->second, Utils::LexicalCast<int>(kv.second.c_str(), "Keywordlist.second.c_str()"));
} }
// TODO : MDGeom::SAR
// TODO : MDGeom::Adjustment // TODO : MDGeom::Adjustment
else if (geomKey->second == MDGeom::ProjectionWKT ||geomKey->second == MDGeom:: ProjectionProj) else if (geomKey->second == MDGeom::ProjectionWKT ||geomKey->second == MDGeom:: ProjectionProj)
{ {
this->Add(geomKey->second, kv.second); this->Add(geomKey->second, kv.second);
} }
// skip MDGeom::SensorGeometry, MDGeom::RPC and MDGeom::GCP // skip MDGeom::SensorGeometry, MDGeom::RPC, MDGeom::GCP, MDGeom::SAR and MDGeom::SARCalib
continue; continue;
} }
// Converting the StringKeys // Converting the StringKeys
......
...@@ -189,7 +189,7 @@ std::vector<AzimuthFmRate> SarImageMetadataInterface::GetAzimuthFmRateGeom(const ...@@ -189,7 +189,7 @@ std::vector<AzimuthFmRate> SarImageMetadataInterface::GetAzimuthFmRateGeom(const
{ {
std::vector<AzimuthFmRate> azimuthFmRateVector; std::vector<AzimuthFmRate> azimuthFmRateVector;
// Number of entries in the vector // Number of entries in the vector
int listCount = mds.GetAs<int>("azimuthFmRate.azi_fm_rate_coef_nb_list"); int listCount = mds.GetAs<int>(0, "azimuthFmRate.azi_fm_rate_coef_nb_list");
// This streams wild hold the iteration number // This streams wild hold the iteration number
std::ostringstream oss; std::ostringstream oss;
for (int listId = 1 ; listId <= listCount ; ++listId) for (int listId = 1 ; listId <= listCount ; ++listId)
......
...@@ -97,7 +97,10 @@ void SarRadiometricCalibrationToImageFilter<TInputImage, TOutputImage>::BeforeTh ...@@ -97,7 +97,10 @@ void SarRadiometricCalibrationToImageFilter<TInputImage, TOutputImage>::BeforeTh
function->SetApplyRescalingFactor(!apply); function->SetApplyRescalingFactor(!apply);
function->SetApplyLookupDataCorrection(apply); function->SetApplyLookupDataCorrection(apply);
function->SetScale(imd[MDNum::CalScale]); if (imd.Has(MDNum::CalScale))
function->SetScale(imd[MDNum::CalScale]);
else if ((imd.Bands.size() > 0) && (imd.Bands[0].Has(MDNum::CalScale)))
function->SetScale(imd.Bands[0][MDNum::CalScale]);
/* Compute noise if enabled */ /* Compute noise if enabled */
if (function->GetEnableNoise()) if (function->GetEnableNoise())
......
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