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

REFAC: adapt the SarCalibrationLookupDataTest to use ImageMetadata instead of keywordlist

parent d4f74271
Pipeline #8424 failed with stages
in 78 minutes and 23 seconds
......@@ -90,28 +90,36 @@ int otbSarCalibrationLookupDataTest(int argc, char* argv[])
return EXIT_FAILURE;
}
outfile << imd[otb::MDStr::Instrument] << std::endl;
outfile << imd[otb::MDStr::SensorID] << std::endl;
//TODO adapt this part
/*
const std::string sensorId = imageMetadataInterface->GetSensorID();
outfile << sensorId << std::endl;
LookupDataType::Pointer lookupDataObj = imageMetadataInterface->GetCalibrationLookupData(0);
/** Fetch the SARCalib */
std::unique_ptr<otb::SARCalib> sarCalibPtr;
if (imd.Has(otb::MDGeom::SARCalib))
{
sarCalibPtr = std::make_unique<otb::SARCalib>(boost::any_cast<otb::SARCalib>(imd[otb::MDGeom::SARCalib]));
}
else
{
std::cerr << "Unable to fetch the SARCalib metadata from the input product.";
}
bool hasLut = sarCalibPtr->calibrationLookupData.find(otb::SarCalibrationLookupData::SIGMA)
!= sarCalibPtr->calibrationLookupData.end();
outfile << hasLut << std::endl;
if (!lookupDataObj.IsNotNull())
if (hasLut)
{
auto lut = sarCalibPtr->calibrationLookupData[otb::SarCalibrationLookupData::SIGMA];
auto lutVal = static_cast<RealType>(lut->GetValue(10,19));
outfile << lutVal << std::endl;
}
else
{
std::cerr << "lookupDataObj is Null" << std::endl;
std::cerr << "No Sigma lut found in the metadata" << std::endl;
return EXIT_FAILURE;
}
RealType lutVal = static_cast<RealType>(lookupDataObj->GetValue(10,19));
outfile << imageMetadataInterface->HasCalibrationLookupDataFlag() << std::endl;
outfile << lutVal << std::endl;
*/
outfile.close();
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