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

ENH: add a test for Sentinel1 SLC geom product

parent fb6e996b
Pipeline #7542 failed with stages
in 88 minutes and 25 seconds
......@@ -115,6 +115,7 @@ public:
std::vector<AzimuthFmRate> GetAzimuthFmRateGeom() const;
std::vector<DopplerCentroid> GetDopplerCentroidGeom() const;
std::vector<Orbit> GetOrbitsGeom() const;
std::vector<BurstRecord> GetBurstRecordsGeom() const;
std::vector<SARNoise> GetNoiseVectorGeom() const;
/**
......
......@@ -236,8 +236,13 @@ std::vector<Orbit> SarImageMetadataInterface::GetOrbitsGeom() const
std::vector<Orbit> orbitVector;
// Number of entries in the vector
int listCount = m_MetadataSupplierInterface->GetAs<int>("orbitList.nb_orbits");
// This streams wild hold the iteration number
// This streams will hold the iteration number
std::ostringstream oss;
std::stringstream ss;
auto facet = new boost::posix_time::time_input_facet("%Y-%m-%dT%H:%M:%S%F");
ss.imbue(std::locale(std::locale(), facet));
for (int listId = 0 ; listId <= listCount - 1 ; ++listId)
{
oss.str("");
......@@ -245,18 +250,56 @@ std::vector<Orbit> SarImageMetadataInterface::GetOrbitsGeom() const
// Base path to the data, that depends on the iteration number
std::string path_root = "orbitList.orbit[" + oss.str() + "]";
Orbit orbit;
std::istringstream(m_MetadataSupplierInterface->GetAs<std::string>(path_root + ".time")) >> orbit.time;
orbit.position = m_MetadataSupplierInterface->GetAs<double>(path_root + ".x_pos");
orbit.position = m_MetadataSupplierInterface->GetAs<double>(path_root + ".y_pos");
orbit.position = m_MetadataSupplierInterface->GetAs<double>(path_root + ".z_pos");
orbit.velocity = m_MetadataSupplierInterface->GetAs<double>(path_root + ".x_vel");
orbit.velocity = m_MetadataSupplierInterface->GetAs<double>(path_root + ".y_vel");
orbit.velocity = m_MetadataSupplierInterface->GetAs<double>(path_root + ".z_vel");
ss << m_MetadataSupplierInterface->GetAs<std::string>(path_root + ".time");
ss >> orbit.time;
orbit.position[0] = m_MetadataSupplierInterface->GetAs<double>(path_root + ".x_pos");
orbit.position[1] = m_MetadataSupplierInterface->GetAs<double>(path_root + ".y_pos");
orbit.position[2] = m_MetadataSupplierInterface->GetAs<double>(path_root + ".z_pos");
orbit.velocity[0] = m_MetadataSupplierInterface->GetAs<double>(path_root + ".x_vel");
orbit.velocity[1] = m_MetadataSupplierInterface->GetAs<double>(path_root + ".y_vel");
orbit.velocity[2] = m_MetadataSupplierInterface->GetAs<double>(path_root + ".z_vel");
orbitVector.push_back(std::move(orbit));
}
return orbitVector;
}
std::vector<BurstRecord> SarImageMetadataInterface::GetBurstRecordsGeom() const
{
const std::string prefix = "support_data.";
std::vector<BurstRecord> burstRecords;
int listCount = m_MetadataSupplierInterface->GetAs<int>(prefix + "geom.bursts.number");
std::stringstream ss;
auto facet = new boost::posix_time::time_input_facet("%Y-%m-%dT%H:%M:%S%F");
ss.imbue(std::locale(std::locale(), facet));
for (int listId = 0 ; listId <= listCount - 1 ; ++listId)
{
const std::string burstName = prefix + "geom.bursts.burst[" + std::to_string(listId) + "].";
BurstRecord record;
ss << m_MetadataSupplierInterface->GetAs<std::string>(burstName + "azimuth_start_time");
ss >> record.azimuthStartTime;
ss << m_MetadataSupplierInterface->GetAs<std::string>(burstName + "azimuth_stop_time");
ss >> record.azimuthStopTime;
record.azimuthAnxTime = m_MetadataSupplierInterface->GetAs<double>(burstName + "azimuth_anx_time");
record.startLine = m_MetadataSupplierInterface->GetAs<int>(burstName + "start_line");
record.endLine = m_MetadataSupplierInterface->GetAs<int>(burstName + "end_line");
record.startSample = m_MetadataSupplierInterface->GetAs<int>(burstName + "start_sample");
record.endSample = m_MetadataSupplierInterface->GetAs<int>(burstName + "end_sample");
burstRecords.push_back(std::move(record));
}
return burstRecords;
}
std::vector<SARNoise> SarImageMetadataInterface::GetNoiseVectorGeom() const
{
std::vector<SARNoise> noiseVector;
......@@ -294,6 +337,21 @@ bool SarImageMetadataInterface::GetSAR(SARParam & sarParam) const
sarParam.dopplerCentroids = this->GetDopplerCentroidGeom();
sarParam.orbits = this->GetOrbitsGeom();
sarParam.noiseVector = this->GetNoiseVectorGeom();
sarParam.burstRecords = this->GetBurstRecordsGeom();
const std::string supportDataPrefix = "support_data.";
sarParam.rangeSamplingRate = m_MetadataSupplierInterface->GetAs<double>(
supportDataPrefix + "range_sampling_rate");
sarParam.nearRangeTime = m_MetadataSupplierInterface->GetAs<double>(
supportDataPrefix + "slant_range_to_first_pixel");
sarParam.rangeResolution = m_MetadataSupplierInterface->GetAs<double>(
supportDataPrefix + "range_spacing");
sarParam.azimuthTimeInterval = boost::posix_time::precise_duration(m_MetadataSupplierInterface->GetAs<double>(
supportDataPrefix + "line_time_interval") * 1e6);
return true;
}
......
......@@ -226,13 +226,19 @@ if (Boost_UNIT_TEST_FRAMEWORK_FOUND)
${OTBTransform-Test_LIBRARIES}
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} )
otb_add_test(NAME prTvSarSensorModelSentinel1
otb_add_test(NAME prTvSarSensorModelSentinel1_SLC
COMMAND otbSarSensorModelTest --
#LARGEINPUT{SENTINEL1/S1A_S6_SLC__1SSV_20150619T195043/measurement/s1a-s6-slc-vv-20150619t195043-20150619t195101-006447-00887d-001.tiff}
LARGEINPUT{SENTINEL1/S1A_S6_SLC__1SSV_20150619T195043/manifest.safe}
-23.9431732671333
15.7637929806278
0)
otb_add_test(NAME prTvSarSensorModelSentinel1_geom
COMMAND otbSarSensorModelTest --
LARGEINPUT{SENTINEL1/S1A_S6_SLC__1SSV_20150619T195043/measurement/s1a-s6-slc-vv-20150619t195043-20150619t195101-006447-00887d-001.tiff}?&geom=${INPUTDATA}/sentinel1/sentinel1-2.geom
-23.9431732671333
15.7637929806278
0)
otb_add_test(NAME prTvSarSensorModelCosmoSkyMed
COMMAND otbSarSensorModelTest --
......@@ -241,11 +247,11 @@ if (Boost_UNIT_TEST_FRAMEWORK_FOUND)
43.5726757080402
0)
otb_add_test(NAME prTvSarSensorModelTerraSarX
COMMAND otbSarSensorModelTest --
LARGEINPUT{TERRASARX/2008-03-10_GrandCanyon_SSC/TSX1_SAR__SSC______SM_S_SRA_20080310T133220_20080310T133228}
-111.664738184032
36.2692959995967
0)
# otb_add_test(NAME prTvSarSensorModelTerraSarX
# COMMAND otbSarSensorModelTest --
# LARGEINPUT{TERRASARX/2008-03-10_GrandCanyon_SSC/TSX1_SAR__SSC______SM_S_SRA_20080310T133220_20080310T133228}
# -111.664738184032
# 36.2692959995967
# 0)
endif()
\ No newline at end of file
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