Skip to content

Commit 6223845

Browse files
committed
Merge pull request #6 from ngageoint/fix_sidd_tlp
timeCOAPoly is in units of meters from the ORP, not pixels from upper…
2 parents a0cf22e + 80a648f commit 6223845

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

modules/c++/six.sidd/source/Utilities.cpp

+10-12
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,22 @@
2424

2525
namespace
2626
{
27-
double getCenterTime(const six::sidd::DerivedData* derived)
27+
double getCenterTime(const six::sidd::DerivedData& derived)
2828
{
2929
double centerTime;
30-
if (derived->measurement->projection->isMeasurable())
30+
if (derived.measurement->projection->isMeasurable())
3131
{
3232
const six::sidd::MeasurableProjection* const projection =
3333
reinterpret_cast<const six::sidd::MeasurableProjection*>(
34-
derived->measurement->projection.get());
34+
derived.measurement->projection.get());
3535

36-
centerTime = projection->timeCOAPoly(
37-
projection->referencePoint.rowCol.row,
38-
projection->referencePoint.rowCol.col);
36+
centerTime = projection->timeCOAPoly(0, 0);
3937
}
4038
else
4139
{
4240
// we estimate...
43-
centerTime
44-
= derived->exploitationFeatures->collections[0]->information->collectionDuration
41+
centerTime =
42+
derived.exploitationFeatures->collections[0]->information->collectionDuration
4543
/ 2;
4644
}
4745

@@ -77,7 +75,7 @@ namespace sidd
7775
scene::SideOfTrack
7876
Utilities::getSideOfTrack(const DerivedData* derived)
7977
{
80-
const double centerTime = getCenterTime(derived);
78+
const double centerTime = getCenterTime(*derived);
8179

8280
// compute arpPos and arpVel
8381
const six::Vector3 arpPos = derived->measurement->arpPoly(centerTime);
@@ -92,7 +90,7 @@ Utilities::getSideOfTrack(const DerivedData* derived)
9290
std::auto_ptr<scene::SceneGeometry>
9391
Utilities::getSceneGeometry(const DerivedData* derived)
9492
{
95-
const double centerTime = getCenterTime(derived);
93+
const double centerTime = getCenterTime(*derived);
9694

9795
// compute arpPos and arpVel
9896
six::Vector3 arpPos = derived->measurement->arpPoly(centerTime);
@@ -298,7 +296,7 @@ void Utilities::setProductValues(Poly2D timeCOAPoly,
298296
PolyXYZ arpPoly, ReferencePoint ref, const Vector3* row,
299297
const Vector3* col, types::RgAz<double>res, Product* product)
300298
{
301-
double scpTime = timeCOAPoly(ref.rowCol.row, ref.rowCol.col);
299+
const double scpTime = timeCOAPoly(0, 0);
302300

303301
Vector3 arpPos = arpPoly(scpTime);
304302
PolyXYZ arpVelPoly = arpPoly.derivative();
@@ -330,7 +328,7 @@ void Utilities::setCollectionValues(Poly2D timeCOAPoly,
330328
PolyXYZ arpPoly, ReferencePoint ref, const Vector3* row,
331329
const Vector3* col, Collection* collection)
332330
{
333-
double scpTime = timeCOAPoly(ref.rowCol.row, ref.rowCol.col);
331+
const double scpTime = timeCOAPoly(0, 0);
334332

335333
Vector3 arpPos = arpPoly(scpTime);
336334
PolyXYZ arpVelPoly = arpPoly.derivative();

0 commit comments

Comments
 (0)