Commit d6a58f06 authored by Julien Osman's avatar Julien Osman

WIP: Add dates and manifest in Sentinel1MetadataInterface

parent 7ad68ea5
......@@ -13,6 +13,9 @@ DataType 11
OrbitNumber 6447
LineSpacing 4.08568
PixelSpacing 3.19483
ProductionDate 2015-06-20T01:51:06.838854Z
AcquisitionStartTime 2015-06-19T19:50:43.223221Z
AcquisitionStopTime 2015-06-19T19:51:01.921994Z
GCP <GCPParam>
Extra.FACILITY_IDENTIFIER UPA_
Polarization VV
......@@ -943,4 +946,4 @@ SAR <SARParam>
{"GCP_Id": "922", "GCP_Info": "", "GCP_Row": "31105", "GCP_Col": "15912", "GCP_X": "-24.0138", "GCP_Y": "15.7509", "GCP_Z": "0", },
{"GCP_Id": "923", "GCP_Info": "", "GCP_Row": "31105", "GCP_Col": "16796", "GCP_X": "-23.9781", "GCP_Y": "15.7574", "GCP_Z": "0", },
{"GCP_Id": "924", "GCP_Info": "", "GCP_Row": "31105", "GCP_Col": "17662", "GCP_X": "-23.9432", "GCP_Y": "15.7638", "GCP_Z": "0", },
]}
]}
\ No newline at end of file
......@@ -405,8 +405,8 @@ void Sentinel1ImageMetadataInterface::Parse(const MetadataSupplierInterface *mds
assert(mds);
assert(mds->GetNbBands() == this->m_Imd.Bands.size());
// Metadata read by GDAL
//Fetch(MDTime::AcquisitionStartTime, mds, "ACQUISITION_START_TIME");
//Fetch(MDTime::AcquisitionStopTime, mds, "ACQUISITION_STOP_TIME");
Fetch(MDTime::AcquisitionStartTime, mds, "ACQUISITION_START_TIME");
Fetch(MDTime::AcquisitionStopTime, mds, "ACQUISITION_STOP_TIME");
Fetch(MDStr::BeamMode, mds, "BEAM_MODE");
Fetch(MDStr::BeamSwath, mds, "BEAM_SWATH");
Fetch("FACILITY_IDENTIFIER", mds, "FACILITY_IDENTIFIER");
......@@ -421,6 +421,16 @@ void Sentinel1ImageMetadataInterface::Parse(const MetadataSupplierInterface *mds
Fetch(MDStr::SensorID, mds, "SENSOR_IDENTIFIER");
Fetch(MDStr::Swath, mds, "SWATH");
// Manifest file
std::string ManifestFilePath = mds->GetResourceFile(std::string("manifest\\.safe"));
if (!ManifestFilePath.empty())
{
XMLMetadataSupplier ManifestMS = XMLMetadataSupplier(ManifestFilePath);
m_Imd.Add(MDTime::ProductionDate,
ManifestMS.GetFirstAs<MetaData::Time>(
"xfdu:XFDU.metadataSection.metadataObject_#.metadataWrap.xmlData.safe:processing.start"));
}
// Band metadata
for (int bandId = 0 ; bandId < mds->GetNbBands() ; ++bandId)
{
......@@ -434,19 +444,19 @@ void Sentinel1ImageMetadataInterface::Parse(const MetadataSupplierInterface *mds
+ std::string("-.*\\.xml"));
if (!AnnotationFilePath.empty())
{
XMLMetadataSupplier xmlMS = XMLMetadataSupplier(AnnotationFilePath);
XMLMetadataSupplier AnnotationMS = XMLMetadataSupplier(AnnotationFilePath);
sarParam.azimuthFmRate = this->GetAzimuthFmRate(xmlMS);
sarParam.azimuthFmRate = this->GetAzimuthFmRate(AnnotationMS);
// Calibration file
std::string CalibrationFilePath = itksys::SystemTools::GetFilenamePath(AnnotationFilePath)
+ "/calibration/calibration-"
+ itksys::SystemTools::GetFilenameName(AnnotationFilePath);
xmlMS = XMLMetadataSupplier(CalibrationFilePath);
sarParam.absoluteCalibrationConstant = xmlMS.GetAs<double>("calibration.calibrationInformation.absoluteCalibrationConstant");
sarParam.calibrationVectors = this->GetCalibrationVector(xmlMS);
std::istringstream(xmlMS.GetAs<std::string>("calibration.adsHeader.startTime")) >> sarParam.startTime;
std::istringstream(xmlMS.GetAs<std::string>("calibration.adsHeader.stopTime")) >> sarParam.stopTime;
XMLMetadataSupplier CalibrationMS = XMLMetadataSupplier(CalibrationFilePath);
sarParam.absoluteCalibrationConstant = CalibrationMS.GetAs<double>("calibration.calibrationInformation.absoluteCalibrationConstant");
sarParam.calibrationVectors = this->GetCalibrationVector(CalibrationMS);
std::istringstream(CalibrationMS.GetAs<std::string>("calibration.adsHeader.startTime")) >> sarParam.startTime;
std::istringstream(CalibrationMS.GetAs<std::string>("calibration.adsHeader.stopTime")) >> sarParam.stopTime;
}
m_Imd.Bands[bandId].Add(MDGeom::SAR, sarParam);
}
......
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