Commit db8815d8 authored by Cédric Traizet's avatar Cédric Traizet
Browse files

BUG: handle cases where there is only one DopplerCentroid, AzimuthFMRate or...

BUG: handle cases where there is only one DopplerCentroid, AzimuthFMRate or Orbit available (happens on WV products)
parent c08c9e65
Pipeline #9051 passed with stages
in 104 minutes and 34 seconds
......@@ -354,7 +354,9 @@ std::vector<AzimuthFmRate> Sentinel1ImageMetadataInterface::GetAzimuthFmRate(con
oss.str("");
oss << listId;
// Base path to the data, that depends on the iteration number
std::string path_root = "product.generalAnnotation.azimuthFmRateList.azimuthFmRate_" + oss.str();
const std::string path_root = listCount == 1 ? "product.generalAnnotation.azimuthFmRateList.azimuthFmRate"
: "product.generalAnnotation.azimuthFmRateList.azimuthFmRate_" + oss.str();
AzimuthFmRate afr;
std::istringstream(xmlMS.GetAs<std::string>(path_root + ".azimuthTime")) >> afr.azimuthTime;
afr.t0 = xmlMS.GetAs<double>(path_root + ".t0");
......@@ -377,7 +379,9 @@ std::vector<DopplerCentroid> Sentinel1ImageMetadataInterface::GetDopplerCentroid
oss.str("");
oss << listId;
// Base path to the data, that depends on the iteration number
std::string path_root = "product.dopplerCentroid.dcEstimateList.dcEstimate_" + oss.str();
const std::string path_root = listCount == 1 ? "product.dopplerCentroid.dcEstimateList.dcEstimate"
: "product.dopplerCentroid.dcEstimateList.dcEstimate_" + oss.str();
DopplerCentroid dopplerCent;
std::istringstream(xmlMS.GetAs<std::string>(path_root + ".azimuthTime")) >> dopplerCent.azimuthTime;
dopplerCent.t0 = xmlMS.GetAs<double>(path_root + ".t0");
......@@ -402,7 +406,9 @@ std::vector<Orbit> Sentinel1ImageMetadataInterface::GetOrbits(const XMLMetadataS
oss.str("");
oss << listId;
// Base path to the data, that depends on the iteration number
std::string path_root = "product.generalAnnotation.orbitList.orbit_" + oss.str();
const std::string path_root = listCount == 1 ? "product.generalAnnotation.orbitList.orbit"
: "product.generalAnnotation.orbitList.orbit_" + oss.str();
Orbit orbit;
orbit.time = MetaData::ReadFormattedDate(xmlMS.GetAs<std::string>(path_root + ".time"));
......
Supports Markdown
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