Project

General

Profile

Bug #1028

The Sensor class methods for computing phase, incidence, and emission angle are all incorrect except for spheres.

Added by Debbie Cook over 5 years ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
Impact:

Any cube for which the ShapeModel of the target is an EllipsoidShape will report different values for the emission and incidence angles because these values depend upon the normal vector (which is now being calculated differently). The difference will be more noticeable in highly elliptical shapes than in more spherical shapes.

Software Version:
Test Reviewer:
Story points:
2

Description

The methods for computing phase, incidence, and emission angle in the Sensor class are incorrectly using the vector from the center of the body to the surface point as the normal vector. This vector is only normal if the target body is a sphere. See the Naif routine, surfnm.c, to see how to calculate the normal for an ellipsoid.

Note:: At the time of this posting the code for computing these angles is in the Sensor class. A new class, EllipsoidShape, is under construction, and it will eventually contain these methods.

The shape classes have been completed. See ShapeModel::calculateEllipsoidalSurfaceNormal() for the incorrect code.

DoD:

  • SPIKE: Research provided for how to correctly do this calculation.
  • If a simple fix (and still have SP), fix it and test it; otherwise, create a ticket.
    • Truth file will be added

Note: Truth will be hand calculated.

History

#2 Updated by Anonymous over 4 years ago

  • Target version deleted (150)

#6 Updated by Kristin Berry over 2 years ago

Stuart has the algorithm.

#7 Updated by Kristin Berry over 2 years ago

  • Target version set to 3.4.11 (FY16 R1 2015-10-28 Oct)

#8 Updated by Jean Backer over 1 year ago

The EllipsoidShape class now exists and has methods calculateDefaultNormal(), calculateSurfaceNormal() and calculateLocalNormal().

The first two call calculateEllipsoidalSurfaceNormal() from the parent class (ShapeModel). This method calculates the ellipsoid normal by subtracting spacecraft position from the surface point position. This is only the surface normal if the shape is spherical.

The third method in EllipsoidShape (calculateLocalNormal) calculates the norm using NAIF's surfnm routine. This routine takes the triaxial radii values and the surface point position to find the correct normal for an ellipsoid.

It appears as though there should be a single method for the ellipsoid that uses the surfnm routine.

Note: When using an ellipsoidal shape model, the emission angle and local emission angle should be identical. However, calculateDefaultNormal() is used to get the emission angle and calculateLocalNormal() is used to get the local emission angle and these values do not match if the body is not spherical. You can use Enceladus test data to see the difference. (See Tammy Becker)

#9 Updated by Tammy Becker over 1 year ago

A test image of Cassini ISS-Wide Angle (Enceladus):

/work/projects/isis/latest/data/m01028/W1487302209_2.cub

#10 Updated by Stuart Sides about 1 year ago

This is a serious incorrect output.

#11 Updated by Stuart Sides about 1 year ago

  • Description updated (diff)

#12 Updated by Tammy Becker 9 months ago

  • Target version changed from 3.4.11 (FY16 R1 2015-10-28 Oct) to 3.5.1 (Sprint 1)

#13 Updated by Ian Humphrey 7 months ago

  • Story points set to 2
  • Description updated (diff)

#14 Updated by Tyler Wilson 7 months ago

  • Assignee set to Tyler Wilson

#15 Updated by Ian Humphrey 7 months ago

  • Status changed from Acknowledged to Assigned

#16 Updated by Tyler Wilson 7 months ago

  • Status changed from Assigned to In Progress

#17 Updated by Tyler Wilson 7 months ago

  • Status changed from In Progress to Resolved
  • Impact updated (diff)

#18 Updated by Marjorie Hahn 7 months ago

  • Status changed from Resolved to Code Review

#19 Updated by Marjorie Hahn 7 months ago

  • Status changed from Code Review to Feedback

Code Review Comments:

  • Check the spacing in DemShape's calculateDefaultNormal() and EllipsoidShape's calculateLocalNormal(), they do not seem to be indented correctly.
  • It appears that calculateEllipsoidalSurfaceNormal() is still being called in ShapeModel's unit test, make sure to remove that.
  • I think there are some leftover debugging lines commented out in EllipsoidShape's calculateLocalNormal()? Otherwise it is not clear why those are in there.

#20 Updated by Ian Humphrey 6 months ago

  • Status changed from Feedback to Resolved

#21 Updated by Tyler Wilson 6 months ago

Marjorie's review suggests have been applied.

The script I used to verify the components for the normal vector can be find here:

/work/projects/latest/m01028/testing/normal.py

The /work/projects/latest/m01028/testing/output.txt file displays surface point intersection (the pB values), the three radii of the target body, and the normal vector calculated by the EllipsoidShape class using these parameters after the bug fix was applied. The Python script takes a couple of these points from this file, and verifies that the solution matches what ISIS is outputting.

#22 Updated by Makayla Shepherd 6 months ago

  • Test Reviewer set to Tammy Becker

#23 Updated by Tammy Becker 6 months ago

  • Status changed from Resolved to Closed

I've tested this on a few varying target body images (sphere, triaxial). I ran phocube to produce emission and incidence angle cubes and displayed these with qview and compared with what the tracking tool reports for emission and incidence. Everything matches as expected. The local emission and local incidence angles with a shape model involved were not impacted by this fix.

#24 Updated by Stuart Sides 4 months ago

  • Target version changed from 3.5.1 (Sprint 1) to 3.5.1 (2017-08-08 Aug)

Also available in: Atom PDF