nyx-space / anise

ANISE provides a toolkit and files for Attitude, Navigation, Instrument, Spacecraft, and Ephemeris data. It's a modern replacement of the NAIF SPICE toolkit.
Mozilla Public License 2.0
68 stars 14 forks source link

Eclipsing and line of sight computations #297

Closed ChristopherRabotin closed 2 months ago

ChristopherRabotin commented 3 months ago

High level description

Nyx can compute the eclipsing (with penumbra) and the line-of-sight visibility. This algorithm is derived in the MathSpec and its implementation is verified in the "GEO orbit raising" example.

ANISE needs to add this capability and verify that it (roughly) matches SPICE. The algorithm is probably different than that of SPICE, so one should expect to see small differences.

Requirements

Test plans

Design

The design should be identical to that in Nyx.

Algorithm demonstration

MathSpec

ChristopherRabotin commented 2 months ago

Relevant SPICE code:

At first glance, it seems that the eclipse algo I rederived is broadly correct, but it does not account for the tri-axial ellipsoid in the same (correct) way as SPICE does because my derivation only looks at the mean radius instead of building a 3x3 matrix of the radii. To implement these matrices, look for bsmaxs and fsmaxs, e.g. https://github.com/arturania/cspice/blob/53bce326267dd2d6d567de92b15869c9ed7d0629/src/zzgfocu.c#L1855.

ChristopherRabotin commented 2 months ago

Nyx uses ANISE version 2.0.0-beta and later. Nyx has its own set of scenario validations, notably verifying the computations against GMAT. By using the eclipsing as implemented in ANISE, the solar radiation pressure validation tests in Nyx have improved by up to two orders of magnitude. Specifically, in the Low Earth Orbiter SRP validation scenario, Nyx used to accumulate almost 300 meters of RSS error with GMAT. Now, Nyx accumulates only 5.9 meters.