diff --git a/gaiaapiclient/cone_search.py b/gaiaapiclient/cone_search.py index cdeb2a8..7d75304 100644 --- a/gaiaapiclient/cone_search.py +++ b/gaiaapiclient/cone_search.py @@ -1,3 +1,20 @@ -# cone_search.py -# send an api request with the coordinates and search radius to the GaiaDBInterface server to fetch the GAIA sources +# 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