1
0
Fork 0

Backend mostly done

merge-requests/1/head
wgaylord 2018-12-18 12:49:23 -06:00
parent 79054d0ece
commit 662689e014
1 changed files with 7 additions and 2 deletions

View File

@ -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])