21 lines
479 B
Python
21 lines
479 B
Python
# gaiaapiclient/cone_search.py
|
|
# send an api request with the coordinates and search radius in decimal degrees
|
|
# to the GaiaDBInterface server to fetch the GAIA sources
|
|
|
|
|
|
import requests
|
|
|
|
|
|
def query(ra, dec, radius):
|
|
url = "http://localhost:8000/gaiadb/cone_search"
|
|
params = {
|
|
'ra' : ra,
|
|
'dec' : dec,
|
|
'radius' : radius
|
|
}
|
|
response = requests.get(url, params=params)
|
|
response.raise_for_status
|
|
data = response.json()
|
|
return data
|
|
|