cone_search.py first iteration

This commit is contained in:
Никита Тырин 2024-09-18 14:38:39 +03:00
parent ad2495acdf
commit 39035caf13

View File

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