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

ENH : New function into SarSensorModelAdapter

parent a39cb76d
No related branches found
No related tags found
No related merge requests found
......@@ -95,6 +95,10 @@ public:
/** Transform world point (lat,lon,hgt) to satellite position (x,y,z) and satellite velocity */
bool WorldToSatPositionAndVelocity(const Point3DType & inGeoPoint, Point3DType & satellitePosition,
Point3DType & satelliteVelocity) const;
/** Transform line index to satellite position (x,y,z) and satellite velocity */
bool LineToSatPositionAndVelocity(const double & line, Point3DType & satellitePosition,
Point3DType & satelliteVelocity) const;
/** Transform world point (lat,lon,hgt) to cartesian point (x,y,z) */
static bool WorldToCartesian(const Point3DType & inGeoPoint, Point3DType & outCartesianPoint);
......@@ -104,6 +108,7 @@ public:
static void DeburstLineToImageLine(const std::vector<std::pair<unsigned long,unsigned long> >& lines, unsigned long deburstLine, unsigned long & imageLine);
protected:
SarSensorModelAdapter();
virtual ~SarSensorModelAdapter() override;
......
......@@ -216,5 +216,34 @@ bool SarSensorModelAdapter::WorldToSatPositionAndVelocity(const Point3DType & in
return true;
}
bool SarSensorModelAdapter::LineToSatPositionAndVelocity(const double & line, Point3DType & satellitePosition,
Point3DType & satelliteVelocity) const
{
if(m_SensorModel.get() == nullptr)
{
return false;
}
ossimplugins::ossimSarSensorModel::TimeType azimuthTime;
ossimEcefPoint sensorPos;
ossimEcefVector sensorVel;
m_SensorModel->lineToAzimuthTime(line, azimuthTime);
m_SensorModel->interpolateSensorPosVel(azimuthTime, sensorPos, sensorVel);
if(sensorPos.isNan() || sensorVel.isNan())
return false;
satellitePosition[0] = sensorPos.x();
satellitePosition[1] = sensorPos.y();
satellitePosition[2] = sensorPos.z();
satelliteVelocity[0] = sensorVel.x();
satelliteVelocity[1] = sensorVel.y();
satelliteVelocity[2] = sensorVel.z();
return true;
}
} // namespace otb
......@@ -62,7 +62,7 @@ int otbSarSensorModelAdapterTest(int itkNotUsed(argc), char* argv[])
otb::SarSensorModelAdapter::Point2DType out1,out2;
otb::SarSensorModelAdapter::Point3DType in, out3, out4, out5;
otb::SarSensorModelAdapter::Point3DType in, out3, out4, out5, out6, out7;
// GCP 99 from input geom file
//support_data.geom.gcp[99].world_pt.hgt: 2.238244926818182e+02
......@@ -78,7 +78,9 @@ int otbSarSensorModelAdapterTest(int itkNotUsed(argc), char* argv[])
sensorModel->WorldToCartesian(in, out5);
sensorModel->WorldToSatPositionAndVelocity(in,out3, out4);
unsigned int ind_Line = 2;
sensorModel->LineToSatPositionAndVelocity(ind_Line, out6, out7);
return EXIT_SUCCESS;
}
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