Bug #5245

Problem with EquatorialCylindricalShape

Added by Jeff Anderson 12 months ago. Updated 8 months ago.

Target version:

ShapeModel factory may be affected

Software Version:
Test Reviewer:



I think I discovered another problem with the EquatorialCylindricalShape class in the intersectSurface method. The main algorithm in intersectSurface is trying to walk along a segment (d0 to dm) of the vector beginning at the spacecraft and in the direction of lookB (the spacecraft pointing direction). It walks by an increment defined by the variable dalpha. There appears to be a unit conversion problem in the dalpha computation. In particular,

double dalpha = MAX(cos(g1lat * DEG2RAD), cmin) / (2.0 * demScale() * DEG2RAD);

and later in the code

dalpha = MAX(cos(g2lat * DEG2RAD), cmin) / (2.0 * demScale() * DEG2RAD);

The problem is that demScale() returns units of pixels per degree and DEG2RAD is in units of radians per degree so demscale() * DEG2RAD results in pixel radians per degree squared.

The correct computation for dalpha should be

dalpha = MAX(cos(g2lat * DEG2RAD), cmin) / (2.0 * demScale() / DEG2RAD);

This will result in the desired units which are pixels per radian.

This error was discovered at LROC using a high resolution SOCET DEM on a high emission angle image (oblique view). In this case the algorithm was failing inside craters or when there was an abrupt change in the radius of the DTM. Programs like phocube, campt, and qview can not compute the lat/lon/phase/ema/inc angles. We made the change to the code as described and it now correctly computes those values. Not sure how it will impact other instruments such as Dawn. Certainly it needs to be tested to make sure it doesn't fail with too many iterations and see how it might improve intersections at the limb. Please contact me for test data if you need it. I can not upload the cubes as they exceed the size limits of 29MB.


#1 Updated by Tammy Becker 12 months ago

  • Category set to API
  • Status changed from New to Acknowledged

#2 Updated by Jean Backer 11 months ago

  • Assignee set to Jean Backer

#3 Updated by Stuart Sides 11 months ago

  • Subject changed from Another problem with EquatorialCylindricalShape to Problem with EquatorialCylindricalShape

#4 Updated by Stuart Sides 11 months ago

  • Target version set to 3.5.2 (2017-01-31 Jan)

#5 Updated by Cole Neubauer 10 months ago

  • Assignee changed from Jean Backer to Cole Neubauer

#6 Updated by Cole Neubauer 10 months ago

  • Status changed from Acknowledged to In Progress

#7 Updated by Cole Neubauer 10 months ago

isis at /work/projects/isis/latest/m05245/isis built on prog24, preemptively it is not ready for testing, needs to be code reviewed first.

The changes are in EquatorialCylindricalShape.cpp

The codes line are at lines 219 and 387

#8 Updated by Cole Neubauer 10 months ago

  • Impact updated (diff)

#9 Updated by Ian Humphrey 8 months ago

  • Status changed from In Progress to Closed

Also available in: Atom PDF