Skip to content
Snippets Groups Projects
Commit 60bef9e7 authored by Gaëlle USSEGLIO's avatar Gaëlle USSEGLIO
Browse files

UPDATE : Changing TopographicPhase Filter with the new OTB function : LineToSatPositionAndVelocity

parent cc7a9fca
No related branches found
No related tags found
No related merge requests found
......@@ -538,7 +538,7 @@ namespace otb
///////////// For Mena Per Line all image requested /////////////
ImageInPointer masterPerLinePtr = const_cast< ImageInType * >(this->GetMasterCartesianMeanPerLineInput());
/*ImageInPointer masterPerLinePtr = const_cast< ImageInType * >(this->GetMasterCartesianMeanPerLineInput());
ImageInRegionType masterPerLineRequestedRegion = outputRequestedRegion;
ImageInIndexType indexMasterPerLine;
indexMasterPerLine[0] = 0;
......@@ -555,7 +555,23 @@ namespace otb
ImageInPointer slavePerLinePtr = const_cast< ImageInType * >( this->GetSlaveCartesianMeanPerLineInput() );
ImageInRegionType inputSlaveCartMeanPerLineRequestedRegion =
OutputRegionToSlavePerLineInputRegion(outputRequestedRegion);
slavePerLinePtr->SetRequestedRegion(inputSlaveCartMeanPerLineRequestedRegion);
slavePerLinePtr->SetRequestedRegion(inputSlaveCartMeanPerLineRequestedRegion);*/
ImageInRegionType perLineRequestedRegion = outputRequestedRegion;
ImageInIndexType indexPerLine;
indexPerLine[0] = 0;
indexPerLine[1] = 0;
ImageInSizeType sizePerLine;
sizePerLine[0] = 1;
sizePerLine[1] = 1;
perLineRequestedRegion.SetIndex(indexPerLine);
perLineRequestedRegion.SetSize(sizePerLine);
ImageInPointer masterPerLinePtr = const_cast< ImageInType * >(this->GetMasterCartesianMeanPerLineInput());
ImageInPointer slavePerLinePtr = const_cast< ImageInType * >( this->GetSlaveCartesianMeanPerLineInput() );
masterPerLinePtr->SetRequestedRegion(perLineRequestedRegion);
slavePerLinePtr->SetRequestedRegion(perLineRequestedRegion);
///////////// Find the region into Shift Grid ////////////
GridRegionType gridRequestedRegion = OutputRegionToInputGridRegion(outputRequestedRegion);
......@@ -626,7 +642,7 @@ namespace otb
indexMasterPerLine[0] = 0; // Always 0 since Master/Slave Cartesain Per Line are vectors
indexMasterPerLine[1] = ind_Line;
ImageInPixelType masterCartMeanPerLine = this->GetMasterCartesianMeanPerLineInput()->GetPixel(indexMasterPerLine);
//ImageInPixelType masterCartMeanPerLine = this->GetMasterCartesianMeanPerLineInput()->GetPixel(indexMasterPerLine);
// Get the index of current tile into grid to retrive the shifts (the closest (round) grid point
// at the center of current tile). Output Geo = Master Cart Mean Geo = (Grid geo / GridStep)
......@@ -648,43 +664,19 @@ namespace otb
ImageInIndexType indexSlavePerLine;
indexSlavePerLine[0] = 0; // Always 0 since Master/Slave Cartesain Per Line are vectors
indexSlavePerLine[1] = Le;
//ImageInPixelType slaveCartMean = this->GetSlaveCartesianMeanInput()->GetPixel(indexSlave);
ImageInPixelType slaveCartMeanPerLine = this->GetSlaveCartesianMeanPerLineInput()->GetPixel(indexSlavePerLine);
////////// Estimate satellite positions for the current line //////////
// Slave
ossimEcefPoint SlaveEcef;
SlaveEcef.x() = slaveCartMeanPerLine[0];
SlaveEcef.y() = slaveCartMeanPerLine[1];
SlaveEcef.z() = slaveCartMeanPerLine[2];
ossimGpt SlaveGpt(SlaveEcef);
worldSlave[0] = SlaveGpt.lon;
worldSlave[1] = SlaveGpt.lat;
worldSlave[2] = SlaveGpt.hgt;
m_SarSensorModelAdapterForSlave->WorldToSatPositionAndVelocity(worldSlave,
satPosSlave, satVelSlave);
// Master
ossimEcefPoint MasterEcef;
MasterEcef.x() = masterCartMeanPerLine[0];
MasterEcef.y() = masterCartMeanPerLine[1];
MasterEcef.z() = masterCartMeanPerLine[2];
ossimGpt MasterGpt(MasterEcef);
worldMaster[0] = MasterGpt.lon;
worldMaster[1] = MasterGpt.lat;
worldMaster[2] = MasterGpt.hgt;
m_SarSensorModelAdapterForMaster->WorldToSatPositionAndVelocity(worldMaster,
satPosMaster, satVelMaster);
bool checkSlave = m_SarSensorModelAdapterForSlave->LineToSatPositionAndVelocity(static_cast<double>(Le), satPosSlave,
satVelSlave);
bool checkMaster = m_SarSensorModelAdapterForMaster->LineToSatPositionAndVelocity(static_cast<double>(ind_Line),
satPosMaster, satVelMaster);
// For each colunm
while (!OutIt.IsAtEndOfLine() && !InMasterCartMeanIt.IsAtEndOfLine())
{
// Check slave Index
if (Le >= 0 &&
Le < static_cast<int>(this->GetSlaveCartesianMeanPerLineInput()->GetLargestPossibleRegion().GetSize()[1]))
if (checkSlave)
{
// Check if Value into Master and Slave Cartesian Mean with IsData Mask
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment