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