Commit 75b20682 authored by Gaëlle USSEGLIO's avatar Gaëlle USSEGLIO

ENH : Add tests into SarSensorModelAdapter for the new overlap function

parent 781356c2
......@@ -480,3 +480,8 @@ otb_add_test(NAME uaTvSarSensorModelAdapter COMMAND otbOSSIMAdaptersTestDriver
otbSarSensorModelAdapterTest
${INPUTDATA}/s1a-iw1-slc-vh-amp_xt.geom
)
otb_add_test(NAME uaTvSarSensorModelAdapter2 COMMAND otbOSSIMAdaptersTestDriver
otbSarSensorModelAdapterTest
${INPUTDATA}/s1a-iw1-slc-vv-20170111_Burst01_amp.geom
)
......@@ -83,5 +83,25 @@ int otbSarSensorModelAdapterTest(int itkNotUsed(argc), char* argv[])
unsigned int ind_Line = 2;
sensorModel->LineToSatPositionAndVelocity(ind_Line, out6, out7);
// Test overlap function (for burst index = 0)
// If version of geom file >= 3
kwl = otb::ReadGeometryFromGEOMFile(infname);
sensorModel->LoadState(kwl);
if (std::stoi(kwl.GetMetadataByKey("header.version")) >= 3)
{
std::pair<unsigned long,unsigned long> linesUp;
std::pair<unsigned long,unsigned long> linesLow;
std::pair<unsigned long,unsigned long> samplesUp;
std::pair<unsigned long,unsigned long> samplesLow;
success = sensorModel->Overlap(linesUp, linesLow, samplesUp, samplesLow, 0);
if (!success)
{
return EXIT_FAILURE;
}
}
return EXIT_SUCCESS;
}
......@@ -2011,6 +2011,8 @@ bool ossimSarSensorModel::overlap(std::pair<unsigned long,unsigned long> & lines
linesUp = std::make_pair(lastValidBurstUp - overlapLength, lastValidBurstUp);
linesLow = std::make_pair(firstValidBurstLow, firstValidBurstLow + overlapLength);
return true;
}
......
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