Backend mostly done
parent
79054d0ece
commit
662689e014
|
@ -136,6 +136,9 @@ def map_view():
|
|||
|
||||
@app.route('/api/activestations')
|
||||
def api_active_stations():
|
||||
sations = []
|
||||
for x in Stations:
|
||||
sations.append([x["name"],x["lat"],x["lng"]])
|
||||
return json.dumps(Stations)
|
||||
|
||||
@app.route('/api/occuringobservations')
|
||||
|
@ -148,12 +151,14 @@ def api_occuring_observations():
|
|||
@app.route('/api/occuringsats')
|
||||
def api_occuring_sats():
|
||||
obs = {}
|
||||
tle = {}
|
||||
for x in Passes:
|
||||
if x.satellite['norad_cat_id'] not in TLEs.keys():
|
||||
q = fetch_tle_of_observation(x.id)
|
||||
TLEs[ x.norad ] = [str(x.satellite["name"]),str(q[0]),str(q[1])]
|
||||
obs[x.id] = {"ground_station":x.ground_station,"start":x.start.isoformat(),"end":x.end.isoformat()}
|
||||
return json.dumps([obs,TLEs])
|
||||
tle[x.norad] = TLEs[x.norad]
|
||||
obs[x.id] = {"ground_station":x.ground_station,"start":x.start.isoformat(),"end":x.end.isoformat(),"sat":x.norad}
|
||||
return json.dumps([obs,tle])
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue