Random_Astro_Student
Random_Astro_Student

Reputation: 13

Query Gaia by star name

I am attempting to query Gaia programmatically in python to get the parallax, distance and kmag of specific stars. I can write a query which obtains the parallax, but only for all stars, not a set of stars or one specific star. Ideally I would just be able to pass the query function a star name but I can't figure out from the documentation how to do this (or even how to make the star name, rather than just the Gaia source_id, a column in the returned table). My current script is as follows:

query = """SELECT source_id, ra, dec, parallax FROM gaiadr2.gaia_source """
job = Gaia.launch_job(query)
results = job.get_results()

Any pointers are much appreciated!

Upvotes: 1

Views: 629

Answers (1)

Vikram Chandra
Vikram Chandra

Reputation: 31

so what you want is a cone search, so I would go into Stellarium and get the RA and dec coords, then convert it using this website: https://www.swift.psu.edu/secure/toop/convert.htm, input the data, and the last digit is your FOV. (in Stellarium) then submit SQL query BUT go back and edit it, so from here you can add all your code like so:

SELECT parallax, distance, kmag, ra
FROM gaiadr2.gaia_source
WHERE 1 = CONTAINS(POINT('ICRS', ra, dec),
                   CIRCLE('ICRS', 274.2667(RA), -18.5975(DEC), 1.87(FOV)))

enter image description here

Upvotes: 0

Related Questions