satellogic / orbit-predictor

Python library to propagate satellite orbits.
MIT License
140 stars 43 forks source link

Predictors can give eclipses #91

Closed eguaio closed 4 years ago

eguaio commented 4 years ago

Add a generator of eclipses dates to the predictors. The shadow function in utils is artificially adapted to get a continuous function (get_satellite_minus_penumbra_verticals) that is positive in illumination phase and negative in eclipses (umbra and penumbra). The function has a local minimum in the eclipse, but can also have local minimum in the illuminated phase. That function is later used in eclipses_since method of predictors to quickly search the eclipses times. This is done in two steps:

  1. Using a sliding window of a third of an orbit (to ensure that the positive local minimum and the negative local minimum are not considered at the same time), find the negative minimum.
  2. With a small window centered in the minimum, search the zeros.
coveralls commented 4 years ago

Coverage Status

Coverage decreased (-1.2%) to 92.062% when pulling 3f1beb4236beadeac37ce7116deb467905d139f6 on eguaio:predictors-eclipses into 4c7d1961f86896ecc112f1c79b2d41303d915548 on satellogic:master.

astrojuanlu commented 4 years ago

One test failed only in Python 3.8 for reasons unrelated to this PR.

astrojuanlu commented 4 years ago

Unfortunately there's no wheel for numba on Python 3.4. Therefore, we'll have to:

astrojuanlu commented 4 years ago

Oh, you already did the latter! Merging :shipit: