I am trying to use poliastro to obtain the positions of the propagated spacecraft and the lighting conditions at each position. The documentation in poliastro page shows an example of the shadow function and the event detectors, but some aspects are undocumented and hard to understand.
From the above link
umbra_event = UmbraEvent(orbit, terminal=True)
events = [umbra_event]
tofs = np.arange(0, 600, 30) << u.s
method = CowellPropagator(events=events)
rr, vv = orbit.to_ephem(EpochsArray(orbit.epoch + tofs, method=method)).rv()
print(
f"The umbral shadow entry time was {umbra_event.last_t} after the orbit's epoch"
)
The umbral shadow entry time was 524.7274279607626 s after the orbit's epoch
Note: Even though the eclipse events UmbraEvent and PenumbraEvent take the Orbit as input, they are not used in propagation but used only to access some helpful attributes of the orbit.
From UmbraEvent page
class poliastro.twobody.events.UmbraEvent(orbit, terminal=False, direction=0)¶
Bases: EclipseEvent
Detect whether a satellite is in umbra or not.
Parameters
orbit (poliastro.twobody.orbit.Orbit) – Orbit of the satellite.
terminal (bool, optional) – Whether to terminate integration when the event occurs, defaults to False.
direction (float, optional) – Handle triggering of event based on whether entry is into or out of umbra, defaults to 0, i.e., event is triggered at both, entry and exit points.
- The detector identifies both entry and exit events by default (direction =0 ). How can I differentiate between an entry and exit event in that context?
- The documentation does not specify the value needed for direction to detect only entry or exit events. Through experimentation I figured it accepts -1 and +1, but which is entry and exit is still unknown.
- The shadow function demonstrated is not explained in regards to the units shown and the output value range. I get both negative and positive values, in the range -9e6 ... 2e6 , but I can find no indication of how I can translate this to a binary light/no light condition.