Quickstart#

With GaiaAlertsPy installed, you can easily extract each detection from the Gaia alerts.

[4]:
from GaiaAlertsPy import alert as gaap
from matplotlib import rcParams

# fancy plotting
import matplotlib.pyplot as plt
%matplotlib inline
%config InlineBackend.figure_format = "retina"
from matplotlib import rcParams
rcParams['savefig.dpi'] = 550
rcParams['font.size'] = 20
plt.rc('font', family='serif')

For example, let’s download and display the light curve for a specific alert, identified as Gaia20dvt. First, start Python and use the GaiaAlert class to obtain the light curve data for the alert from the data archive:

[11]:
target_id = "Gaia20dvt"
alert_lc = gaap.GaiaAlert(target_id).query_lightcurve_alert()

We can inspect the alert_lc table that returns all the detections:

[14]:
alert_lc[0:5]
[14]:
Table length=5
JDmag_Gmag_G_error
float64float64float64
2457078.010347222417.640.018908738194109986
2457078.08435185217.630.018855080650021172
2457105.32166666717.550.01843832729193906
2457105.497800925717.60.018696221071923702
2457128.99217592617.480.01809111962074983

Plot the light curve:

[12]:
fig, ax = plt.subplots(nrows=1, ncols=1, figsize=(10,5))
ax.errorbar(alert_lc['JD']-2.45e6, alert_lc['mag_G'], alert_lc['mag_G_error'], fmt='o', capsize=1, color='seagreen',
label='Gaia-G')
ax.legend()
ax.set_ylim(ax.set_ylim()[::-1])
ax.set_xlabel("Julian Date - 2.45e6 [days]")
ax.set_ylabel("Magnitude")
plt.minorticks_on()
../_images/source_quick-start_8_0.png