From 39035caf1384cfd31ad30c38448821a92734dd13 Mon Sep 17 00:00:00 2001 From: tyrin Date: Wed, 18 Sep 2024 14:38:39 +0300 Subject: [PATCH] cone_search.py first iteration --- gaiaapiclient/cone_search.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) 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