Commit efac1e8b authored by Julien Osman's avatar Julien Osman

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
// To be completed by ImageIO
oss << std::string("<SARParam>");
}
else if (kv.first == MDGeom::SARCalib)
{
// To be completed by ImageIO
oss << std::string("<SARCalib>");
}
// TODO : MDGeom::Adjustment
else
{
......@@ -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()"));
}
// TODO : MDGeom::SAR
// TODO : MDGeom::Adjustment
else if (geomKey->second == MDGeom::ProjectionWKT ||geomKey->second == MDGeom:: ProjectionProj)
{
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;
}
// Converting the StringKeys
......
......@@ -189,7 +189,7 @@ std::vector<AzimuthFmRate> SarImageMetadataInterface::GetAzimuthFmRateGeom(const
{
std::vector<AzimuthFmRate> azimuthFmRateVector;
// 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
std::ostringstream oss;
for (int listId = 1 ; listId <= listCount ; ++listId)
......
......@@ -97,7 +97,10 @@ void SarRadiometricCalibrationToImageFilter<TInputImage, TOutputImage>::BeforeTh
function->SetApplyRescalingFactor(!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 */
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