1

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!

1 Answers1

0

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

  • Note: These Ra and Dec coords are focused on the Sagittarius Star cloud – Vikram Chandra Sep 28 '21 at 03:20
  • Hi, thanks so much. However, I do not want a cone search as I don't want contamination from background stars/galaxies that just happen to be nearby spatially. Actually, I've figured out I can resolve the Gaia Dr2 source_id from and Simbad search of the star name, and search that way. This seems to work fine, though it is inefficient. – Random_Astro_Student Sep 28 '21 at 04:49
  • Noooo problem, glad I could help, but now I need your help(lol). So I'm actually doing something very similar and I'm plotting in 3 dimensions.... in python using matplotlib... how would you suggest I plot using parallax ra and dec ? currently this is my distance calculation: ``` d=1.01541148669/(math.tan(((arr2[i]-arr[i])*(1/1000))/2)) ``` – Vikram Chandra Sep 28 '21 at 04:53
  • Also, can't you put the FOV to something like 0.01 to zoom into the star? – Vikram Chandra Sep 28 '21 at 04:55