Bug in EquatorialCylindricalShape class
There is a minor bug in the EquatorialCylindricalShape/DemShape/ShapeModel classes. The bug causes a failure to intersect the DTM in high emission angle images (oblique views) using local DTMs created from SOCET and run through demprep. Without the successful intersection of the DTM programs like phocube and qview return NULL values for lat/lon/phase/incidience/emission. The problem is very straightforward. In the EquatorialCylindricalShape::intersectSurface method the first option tried is the DemShape::intersectSurface method. This is fine except that method chooses a starting radius in the iteration for the shape intersection to be the a-axis of the triaxial ellipsoid. Unfortunately this can be well above the local radius of SOCET DTM which causes a failure in first iteration. A better option that actually works is to use the maximum radius written to the cube labels during the demprep program. I have made this change locally at ASU and verified it fixes the problem. It would be wonderful if this change could be put into the ISIS system.
The fix is straightforward. Make the ShapeModel::intersectEllipsoid method virtual and then override in the EquatorialCylindricalShape class. The code is ShapeModel and EquatorialCylindricalShape is nearly identical except ShapeModel uses the triaxial ellipsoid values and EquatorialCylindricalShape uses the values written to the cube labels during demprep. I also made the private variable m_hasEllipsoidIntersection protected so I could use it. It might be better to have a protected method to set this class variable but I didn't take the time to make this fix. Your call.
I have attached three files that have the code changes. The cube files I have for testing are quite big and can not be uploaded in the ticket tracking system. Please contact me when you would like access to the files.
#8 Updated by Cole Neubauer 2 months ago
setisis /work/projects/isis/latest/m05242/isis built on prog24, preemptively it is not ready for testing, needs to be code reviewed first.
The changes in EquatorialCylindricalShape.cpp
lines changed are from 414 to 472
The changes in EquatorialCylindricalShape.h
lines changed are from 50 to 79 and 53 to 71
The changes in ShapeModel.h
lines changed are from 70 to 71 and 181 to 185 and 191