1
1
2
2
from poliastro .czml .extract_czml import CZMLExtractor
3
3
from poliastro .twobody import Orbit
4
- from app .repository import ObservationId , Repository , Observation , Satellite
4
+ from app .repository import ObservationId , Repository , Observation , Satellite , Station
5
5
from tletools import TLE
6
6
from astropy .time import Time
7
7
from astropy import units as u
8
8
from pprint import pprint
9
+ from app .utils import coords
9
10
10
11
def get_obs_czml (id ):
11
12
"""Generates CZML file that describe the observation, specified by id. ID must be an integer.
@@ -57,7 +58,7 @@ def get_obs_czml(id):
57
58
if station is not None :
58
59
extractor .add_ground_station ([ station ['lat' ] * u .degree , station ['lon' ] * u .degree ],
59
60
label_text = station ['name' ],
60
- id_description = station [ 'descr' ] )
61
+ id_description = get_station_descr ( station ) )
61
62
62
63
# I'm sure there's much easier way to do the conversion, but all the examples
63
64
# for czml3 only show how to convert a single packet. For pass visualization, we will
@@ -102,4 +103,13 @@ def get_obs_descr(start_epoch: Time, end_epoch: Time, orb: Orbit, obs: Observati
102
103
descr = descr + "Period = <b>{period:.1f}</b><br/>" .format (period = orb .period )
103
104
descr = descr + "Epoch = %s<br/></p>" % str (orb .epoch )[:16 ]
104
105
106
+ return descr
107
+
108
+ def get_station_descr (station : Station ) -> str :
109
+ """Generates a description of the ground station"""
110
+ descr = "<p><b>Description:</b><br/>" + station ['descr' ] + "</p>\n "
111
+
112
+ descr += "<p><b>Coordinates</b>: " + coords (station ['lon' ], station ['lat' ]) + "</p>\n "
113
+ descr += "<p><b>Configuration</b>:<br/>" + station ['config' ] + "</p>"
114
+
105
115
return descr
0 commit comments