From 80a648fb63f198b3e22f9033f009c96eba1dee98 Mon Sep 17 00:00:00 2001 From: Adam Sylvester Date: Thu, 6 Aug 2015 17:25:20 -0400 Subject: [PATCH] timeCOAPoly is in units of meters from the ORP, not pixels from upper left, so when trying to get the center time we should be using (0, 0) rather than the ref pt --- modules/c++/six.sidd/source/Utilities.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/modules/c++/six.sidd/source/Utilities.cpp b/modules/c++/six.sidd/source/Utilities.cpp index c250160e9..3a28b5f72 100644 --- a/modules/c++/six.sidd/source/Utilities.cpp +++ b/modules/c++/six.sidd/source/Utilities.cpp @@ -24,24 +24,22 @@ namespace { -double getCenterTime(const six::sidd::DerivedData* derived) +double getCenterTime(const six::sidd::DerivedData& derived) { double centerTime; - if (derived->measurement->projection->isMeasurable()) + if (derived.measurement->projection->isMeasurable()) { const six::sidd::MeasurableProjection* const projection = reinterpret_cast( - derived->measurement->projection.get()); + derived.measurement->projection.get()); - centerTime = projection->timeCOAPoly( - projection->referencePoint.rowCol.row, - projection->referencePoint.rowCol.col); + centerTime = projection->timeCOAPoly(0, 0); } else { // we estimate... - centerTime - = derived->exploitationFeatures->collections[0]->information->collectionDuration + centerTime = + derived.exploitationFeatures->collections[0]->information->collectionDuration / 2; } @@ -77,7 +75,7 @@ namespace sidd scene::SideOfTrack Utilities::getSideOfTrack(const DerivedData* derived) { - const double centerTime = getCenterTime(derived); + const double centerTime = getCenterTime(*derived); // compute arpPos and arpVel const six::Vector3 arpPos = derived->measurement->arpPoly(centerTime); @@ -92,7 +90,7 @@ Utilities::getSideOfTrack(const DerivedData* derived) std::auto_ptr Utilities::getSceneGeometry(const DerivedData* derived) { - const double centerTime = getCenterTime(derived); + const double centerTime = getCenterTime(*derived); // compute arpPos and arpVel six::Vector3 arpPos = derived->measurement->arpPoly(centerTime); @@ -298,7 +296,7 @@ void Utilities::setProductValues(Poly2D timeCOAPoly, PolyXYZ arpPoly, ReferencePoint ref, const Vector3* row, const Vector3* col, types::RgAzres, Product* product) { - double scpTime = timeCOAPoly(ref.rowCol.row, ref.rowCol.col); + const double scpTime = timeCOAPoly(0, 0); Vector3 arpPos = arpPoly(scpTime); PolyXYZ arpVelPoly = arpPoly.derivative(); @@ -330,7 +328,7 @@ void Utilities::setCollectionValues(Poly2D timeCOAPoly, PolyXYZ arpPoly, ReferencePoint ref, const Vector3* row, const Vector3* col, Collection* collection) { - double scpTime = timeCOAPoly(ref.rowCol.row, ref.rowCol.col); + const double scpTime = timeCOAPoly(0, 0); Vector3 arpPos = arpPoly(scpTime); PolyXYZ arpVelPoly = arpPoly.derivative();