diff options
| author | Yuval Adam <_@yuv.al> | 2020-09-24 22:39:05 +0300 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2020-09-24 22:39:05 +0300 |
| commit | ff8aeca0330b5d90a36c37eb62ece2d8b020f307 (patch) | |
| tree | ff1c61996b5686d2e252bf29213d2d4289bbb7dc /iss/predictions.py | |
| parent | 78099db917289a3100ea0ee7558da5627582fc6f (diff) | |
Continue predictions split
Diffstat (limited to 'iss/predictions.py')
| -rw-r--r-- | iss/predictions.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/iss/predictions.py b/iss/predictions.py index eb02ef9..894191a 100644 --- a/iss/predictions.py +++ b/iss/predictions.py @@ -45,6 +45,9 @@ class Predictions(object): by_name = {sat.name: sat for sat in satellites} return by_name[self.satellite] + def get_prediction_details(self, rise, culminate, zet): + return {"rise": rise, "culminate": culminate, "set": zet} + def get_prediction_events(self): satellite = self.get_satellite() t0, t1 = self.get_next_days() @@ -59,5 +62,8 @@ class Predictions(object): # docs mention the possibilibity of several culminations # https://rhodesmill.org/skyfield/earth-satellites.html#finding-when-a-satellite-rises-and-sets # but this doesn't seem to happen in our case - preds = chunks(ts, 3) - return [[t.utc_iso() for t in p] for p in preds] + return list(chunks(ts, 3)) + + def get_predictions(self): + preds = self.get_prediction_events() + return [self.get_prediction_details(*p) for p in preds] |
