🌎🕯🗺 Gaia Positions and Photometry¶
Often you need to know the magnitude of a star. Fortunately, the space-based Gaia survey has observed the entire sky with incredible precision; basically any star you can see with a moderate ground-based telescope has already been observed by Gaia. Common reasons you might need to download stars from Gaia would be to locate where to put apertures in an image or to use a star you observed as a flux calibrator; this page demonstrates two little tools that might be helpful for those purposes!
Downloading Gaia Data 💾¶
To get a table of positions and photometry, we can use the get_gaia
function. This is a wrapper to astroquery
and the fabulous Gaia archive, designed to be quick and easy to use.
from astropy.coordinates import SkyCoord
import astropy.units as u
from thefriendlystars import get_gaia
/Users/zach/Dropbox/zach/code/thefriendlystars/thefriendlystars/gaia.py:373: SyntaxWarning: invalid escape sequence '\l' save_address = save_address + "\lightcurve_data"
--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) Cell In[1], line 3 1 from astropy.coordinates import SkyCoord 2 import astropy.units as u ----> 3 from thefriendlystars import get_gaia File ~/Dropbox/zach/code/thefriendlystars/thefriendlystars/__init__.py:2 1 from .version import * ----> 2 from .gaia import * File ~/Dropbox/zach/code/thefriendlystars/thefriendlystars/gaia.py:6 4 from astropy.table import QTable 5 from astropy.visualization import quantity_support ----> 6 from gaiaxpy import calibrate 7 from matplotlib.colors import Normalize 8 from matplotlib.cm import get_cmap ModuleNotFoundError: No module named 'gaiaxpy'
To download some stars, specify a center and a radius, and let the function download data within that radius of that location. This will both download the star magnitudes directly measured with Gaia (G_gaia
, BP_gaia
, RP_gaia
) and use color transformations to estimate the magnitudes in other common filters (g_sloan
, r_sloan
, i_sloan
, V_johnsoncousins
, R_johnsoncousins
, I_johnsoncousins
). With the results, you should have a decent estimate of the brightness of any star you want!
random_center = SkyCoord(ra=123.45*u.deg, dec=67.89*u.deg)
random_radius = 10*u.arcmin
random_stars = get_gaia(random_center, radius=random_radius)
--------------------------------------------------------------------------- NameError Traceback (most recent call last) Cell In[2], line 3 1 random_center = SkyCoord(ra=123.45*u.deg, dec=67.89*u.deg) 2 random_radius = 10*u.arcmin ----> 3 random_stars = get_gaia(random_center, radius=random_radius) NameError: name 'get_gaia' is not defined
random_stars
--------------------------------------------------------------------------- NameError Traceback (most recent call last) Cell In[3], line 1 ----> 1 random_stars NameError: name 'random_stars' is not defined
Columns from this table can be extracted via their names.
random_stars['ra']
--------------------------------------------------------------------------- NameError Traceback (most recent call last) Cell In[4], line 1 ----> 1 random_stars['ra'] NameError: name 'random_stars' is not defined
We can also specify the center by using a star or object's common catalog name.
some_stars = get_gaia('GJ 1214')
--------------------------------------------------------------------------- NameError Traceback (most recent call last) Cell In[5], line 1 ----> 1 some_stars = get_gaia('GJ 1214') NameError: name 'get_gaia' is not defined
some_stars
--------------------------------------------------------------------------- NameError Traceback (most recent call last) Cell In[6], line 1 ----> 1 some_stars NameError: name 'some_stars' is not defined
Visualizing Gaia Data 🎨¶
It'd be nice to be able to see this information in a way that's not just a giant table of data. Let's use the plot_gaia
tool to plot one of the tables we've already downloaded.
from thefriendlystars import plot_gaia
--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) Cell In[7], line 1 ----> 1 from thefriendlystars import plot_gaia File ~/Dropbox/zach/code/thefriendlystars/thefriendlystars/__init__.py:2 1 from .version import * ----> 2 from .gaia import * File ~/Dropbox/zach/code/thefriendlystars/thefriendlystars/gaia.py:6 4 from astropy.table import QTable 5 from astropy.visualization import quantity_support ----> 6 from gaiaxpy import calibrate 7 from matplotlib.colors import Normalize 8 from matplotlib.cm import get_cmap ModuleNotFoundError: No module named 'gaiaxpy'
plot_gaia(some_stars)
--------------------------------------------------------------------------- NameError Traceback (most recent call last) Cell In[8], line 1 ----> 1 plot_gaia(some_stars) NameError: name 'plot_gaia' is not defined
table = some_stars
--------------------------------------------------------------------------- NameError Traceback (most recent call last) Cell In[9], line 1 ----> 1 table = some_stars NameError: name 'some_stars' is not defined
We can change options to modify the appearance of this finder chart, including changing which filter is used to set the relative sizes of the points.
plot_gaia(some_stars,
filter='i_sloan',
faintest_magnitude_to_show=17,
faintest_magnitude_to_label=13,
size_of_zero_magnitude=200,
unit=u.arcsec)
--------------------------------------------------------------------------- NameError Traceback (most recent call last) Cell In[10], line 1 ----> 1 plot_gaia(some_stars, 2 filter='i_sloan', 3 faintest_magnitude_to_show=17, 4 faintest_magnitude_to_label=13, 5 size_of_zero_magnitude=200, 6 unit=u.arcsec) NameError: name 'plot_gaia' is not defined
With these tools, you can access a table of data and a quick visualization for any patch of the sky you care about!
cluster_center = SkyCoord.from_name("NGC 457")
cluster_stars = get_gaia(cluster_center)
plot_gaia(cluster_stars, faintest_magnitude_to_label=10)
--------------------------------------------------------------------------- NameError Traceback (most recent call last) Cell In[11], line 2 1 cluster_center = SkyCoord.from_name("NGC 457") ----> 2 cluster_stars = get_gaia(cluster_center) 3 plot_gaia(cluster_stars, faintest_magnitude_to_label=10) NameError: name 'get_gaia' is not defined