diff options
| author | Yuval Adam <_@yuv.al> | 2020-09-28 14:46:34 +0300 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2020-09-28 14:46:34 +0300 |
| commit | 4efa661b96d682cad76356ef1355482211c5efc5 (patch) | |
| tree | dcc6dafd3ef7b2a835936ffb254a0dc056b7772e /iss/predictions.py | |
| parent | d3caed4241328258dee6190463bae8b4b5f3800d (diff) | |
Show directions and widen table
Diffstat (limited to 'iss/predictions.py')
| -rw-r--r-- | iss/predictions.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/iss/predictions.py b/iss/predictions.py index df6326a..b62465d 100644 --- a/iss/predictions.py +++ b/iss/predictions.py @@ -1,7 +1,7 @@ from collections import defaultdict from skyfield.api import Topos, load -from .utils import chunks +from .utils import chunks, deg_to_cardinal ISS = "ISS (ZARYA)" @@ -52,10 +52,12 @@ class Predictions(object): difference = self.satellite - self.location topocentric = difference.at(t) alt, az, distance = topocentric.altaz() + azimuth = int(az.degrees) return { "time": t.utc_iso(), "degrees": int(alt.degrees), - "azimuth": int(az.degrees), + "azimuth": azimuth, + "direction": deg_to_cardinal(azimuth), "distance": int(distance.km), } @@ -94,7 +96,7 @@ class Predictions(object): def truncate_prediction_dates(self, pred): for t in ["rise", "culminate", "set"]: - pred[t]["time"] = pred[t]["time"][11:] + pred[t]["time"] = pred[t]["time"][11:][:-1] return pred def get_grouped_predictions(self): |
