fix: bug in HAE RRDot surface projection #64
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change fixes a bug in the HAERRDotSurfaceProjection code that would sometimes cause a SICD sensor model to fail to geolocate image points using an external DEM model. The code was accidentally using the earth centered fixed (ECF) version of the scene center point (SCP) when computing the ground reference point and adjusting the elevation (z) coordinate like it was a geodetic coordinate. That threw off calculations of the min/max elevation limits for the DEMRRDotSurfaceProjection which eventually led to an exception thrown because the calculations could not be completed ("No solution exists. Distance between ARP and the plane is greater than range.").
This change updates the calculation to use the geodetic (Lon, Lat, Elevation) version of the SCP. You can see that this change makes the calculation consistent with the code on line 765 which already used the geodetic version of the coordinate.
The automated unit tests exercise this code but didn't catch this issue. I was able to recreate the bug using real data from UMBRA available through the AWS Open Data program and then verified that this change fixes the issue.
Checklist
Before you submit a pull request, please make sure you have the following:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.