compute_eclipse#

namespace saltro
namespace orbits

Functions

bool compute_eclipse(const Eigen::Matrix<double, 3, saltro::limits::MAX_LENGTH_TRAJ> &R, const Eigen::Matrix<double, 1, saltro::limits::MAX_LENGTH_TRAJ> &jtime, const int jtime_length, const int eclipse_model, Eigen::Matrix<double, 3, saltro::limits::MAX_LENGTH_TRAJ> &S)#

Compute Earth eclipse shadow along a trajectory using a selected model.

Dispatches eclipse computation to one of the available eclipse shadow models based on the integer selector eclipse_model. When a satellite is in Earth’s shadow (eclipse), the Sun vector is zeroed out.

For each trajectory sample \(k\), the eclipse state is evaluated and the Sun vector is set to zero if eclipsed:

\[\begin{split} \mathbf{S}_k = \begin{cases} \mathbf{0} & \text{if satellite is in eclipse} \\ \mathbf{S}_k & \text{otherwise} \end{cases} \end{split}\]

Supported models:

  • \(0\) → Cylindrical shadow model

  • \(1\) → Analytical penumbra/umbra shadow cone model

Parameters:
  • R – Spacecraft position vectors (meters). Each column corresponds to one trajectory sample.

  • jtime – Julian time values (unused for current models, included for future expansion).

  • jtime_length – Number of valid trajectory samples.

  • eclipse_model – Integer identifier selecting the eclipse model: 0 = cylindrical shadow. 1 = analytical penumbra/umbra shadow cone.

  • S – Spacecraft-to-Sun vectors (meters), column-wise. Modified in-place; set to zero where spacecraft is in eclipse.

Returns:

True if the selected model computation succeeds for all samples, false if the model identifier is invalid or a computation fails.