Note
Go to the end to download the full example code.
Working with Light Curves#
Performing a Light Curve Query#
Light curves can be fetched in the same way as in previous tutorials. For this tutorial, an ASAS-SN query will be performed:
from ATK import query
asassn_query = query("lightcurve", targets=6050296829033196032, survey="asassn", path="example_lightcurve.fits.gz")
asassn_query.show(show_types=True)
<Lightcurve DataSet>
.kind (str): Lightcurve
.targets (list): 6050296829033196032 | 245.447° -22.886° (icrs, 2016-01-01T00:00:00.000, 3.0″)
.exception (bool): False
.data (list):
<asassn v-band Lightcurve>
survey (str): asassn
band (str): v
correction (str): full
search_pos (astropy.SkyCoord): 245.447° -22.886° (icrs, 2015-01-01T00:00:00.000)
separation (astropy.Quantity): 0.026″
mjd (astropy.Quantity): [56783.46, 56785.411, ..., 58382.027, 58384.005] d
mag (astropy.Quantity): [15.352, 14.668, ..., 14.913, 15.388] mag
mag_err (astropy.Quantity): [0.022, 0.023, ..., 0.03, 0.038] mag
ra (astropy.Quantity): [245.447, 245.447, ..., 245.447, 245.447] °
dec (astropy.Quantity): [-22.886, -22.886, ..., -22.886, -22.886] °
<asassn g-band Lightcurve>
survey (str): asassn
band (str): g
correction (str): full
search_pos (astropy.SkyCoord): 245.447° -22.886° (icrs, 2015-01-01T00:00:00.000)
separation (astropy.Quantity): 0.026″
mjd (astropy.Quantity): [58143.538, 58145.531, ..., 60841.348, 60844.164] d
mag (astropy.Quantity): [15.537, 15.752, ..., 15.134, 14.93] mag
mag_err (astropy.Quantity): [0.066, 0.046, ..., 0.071, 0.016] mag
ra (astropy.Quantity): [245.447, 245.447, ..., 245.447, 245.447] °
dec (astropy.Quantity): [-22.886, -22.886, ..., -22.886, -22.886] °
Available Methods: .add(), .apply(), .from_target(), .merge(), .open(), .plot(), .save(), .show(), .split(), .store()
The returned DataSet’s data attribute is a list of Lightcurve objects (one per photometric band per target, subject to data availability).
Note
ATK supports queries to the following lightcurve surveys and bands:
ZTF -
ztf(g,r,i)Gaia -
gaia(g,bp,rp)ATLAS -
atlas(c,o)ASAS-SN -
asassn(g,v)TESS -
tess(Tmag)CRTS -
crts(v)
For a refresher on query() fundamentals, see previous tutorials.
If the desired survey is not listed above, see here for a tutorial on utilising external data.
Plotting the Returned Data#
To plot a Lightcurve and open it in the default browser:
asassn_query.open()
Note
For a refresher on plotting fundamentals, see previous tutorials.
Splitting by Survey ID#
By default, light curves are returned as forced-photometry (i.e. all photometric detections in the requested radius are returned as a single Lightcurve per band). However, in some cases - e.g. in crowded regions or when using a large search radius - this assumption breaks down:
<Lightcurve DataSet>
.kind (str): Lightcurve
.targets (list): 587316166180416640 | 141.185° 8.031° (icrs, 2016-01-01T00:00:00.000, 60.0″)
.exception (bool): False
.data (list):
<asassn v-band Lightcurve>
survey (str): asassn
band (str): v
correction (str): full
search_pos (astropy.SkyCoord): 141.185° 8.031° (icrs, 2015-01-01T00:00:00.000)
separation (astropy.Quantity): 36.096″
mjd (astropy.Quantity): [55946.483, 55954.478, ..., 58431.588, 58441.629] d
mag (astropy.Quantity): [17.58, 17.911, ..., 17.287, 17.574] mag
mag_err (astropy.Quantity): [0.152, 0.177, ..., 0.153, 0.164] mag
ra (astropy.Quantity): [141.185, 141.185, ..., 141.201, 141.201] °
dec (astropy.Quantity): [8.031, 8.031, ..., 8.026, 8.026] °
<asassn g-band Lightcurve>
survey (str): asassn
band (str): g
correction (str): full
search_pos (astropy.SkyCoord): 141.185° 8.031° (icrs, 2015-01-01T00:00:00.000)
separation (astropy.Quantity): 35.333″
mjd (astropy.Quantity): [58056.48, 58080.455, ..., 60704.982, 60706.938] d
mag (astropy.Quantity): [17.774, 18.085, ..., 18.242, 18.153] mag
mag_err (astropy.Quantity): [0.181, 0.204, ..., 0.19, 0.191] mag
ra (astropy.Quantity): [141.185, 141.185, ..., 141.201, 141.201] °
dec (astropy.Quantity): [8.031, 8.031, ..., 8.026, 8.026] °
Available Methods: .add(), .apply(), .from_target(), .merge(), .open(), .plot(), .save(), .show(), .split(), .store()
It is clear that the returned Lightcurve objects contain photometry of at least two stars. In this case, it may be helpful to split the returned photometry by a per-survey observation/object ID. This can be done by passing split=True to query():
<Lightcurve DataSet>
.kind: Lightcurve
.targets: 587316166180416640 | 141.185° 8.031° (icrs, 2016-01-01T00:00:00.000, 60.0″)
.exception: False
.data:
<asassn v-band Lightcurve>
survey: asassn
band: v
correction: full
search_pos: 141.185° 8.031° (icrs, 2015-01-01T00:00:00.000)
separation: 36.55″
obj_id: 103080678062
mjd: [55946.483, 55950.478, ..., 58446.596, 58447.606] d
mag: [14.405, 14.491, ..., 14.446, 14.509] mag
mag_err: [0.008, 0.011, ..., 0.048, 0.025] mag
ra: [141.195, 141.195, ..., 141.195, 141.195] °
dec: [8.034, 8.034, ..., 8.034, 8.034] °
<asassn g-band Lightcurve>
survey: asassn
band: g
correction: full
search_pos: 141.185° 8.031° (icrs, 2015-01-01T00:00:00.000)
separation: 36.55″
obj_id: 103080678062
mjd: [58054.5, 58055.488, ..., 60837.983, 60837.987] d
mag: [14.596, 14.673, ..., 14.77, 14.678] mag
mag_err: [0.028, 0.008, ..., 0.049, 0.03] mag
ra: [141.195, 141.195, ..., 141.195, 141.195] °
dec: [8.034, 8.034, ..., 8.034, 8.034] °
<asassn v-band Lightcurve>
survey: asassn
band: v
correction: full
search_pos: 141.185° 8.031° (icrs, 2015-01-01T00:00:00.000)
separation: 0.243″
obj_id: 661428731552
mjd: [55946.483, 55954.478, ..., 58407.619, 58431.588] d
mag: [17.58, 17.911, ..., 17.3, 17.53] mag
mag_err: [0.152, 0.177, ..., 0.179, 0.202] mag
ra: [141.185, 141.185, ..., 141.185, 141.185] °
dec: [8.031, 8.031, ..., 8.031, 8.031] °
<asassn g-band Lightcurve>
survey: asassn
band: g
correction: full
search_pos: 141.185° 8.031° (icrs, 2015-01-01T00:00:00.000)
separation: 0.243″
obj_id: 661428731552
mjd: [58056.48, 58080.455, ..., 60674.38, 60704.982] d
mag: [17.774, 18.085, ..., 17.467, 18.217] mag
mag_err: [0.181, 0.204, ..., 0.097, 0.188] mag
ra: [141.185, 141.185, ..., 141.185, 141.185] °
dec: [8.031, 8.031, ..., 8.031, 8.031] °
<asassn v-band Lightcurve>
survey: asassn
band: v
correction: full
search_pos: 141.185° 8.031° (icrs, 2015-01-01T00:00:00.000)
separation: 58.99″
obj_id: 661436975834
mjd: [55946.483, 55954.478, ..., 58431.588, 58441.629] d
mag: [17.702, 17.777, ..., 17.287, 17.574] mag
mag_err: [0.143, 0.161, ..., 0.153, 0.164] mag
ra: [141.201, 141.201, ..., 141.201, 141.201] °
dec: [8.026, 8.026, ..., 8.026, 8.026] °
<asassn g-band Lightcurve>
survey: asassn
band: g
correction: full
search_pos: 141.185° 8.031° (icrs, 2015-01-01T00:00:00.000)
separation: 58.99″
obj_id: 661436975834
mjd: [58056.48, 58059.471, ..., 60704.982, 60706.938] d
mag: [17.605, 18.065, ..., 18.242, 18.153] mag
mag_err: [0.158, 0.185, ..., 0.19, 0.191] mag
ra: [141.201, 141.201, ..., 141.201, 141.201] °
dec: [8.026, 8.026, ..., 8.026, 8.026] °
Available Methods: .add(), .apply(), .from_target(), .merge(), .open(), .plot(), .save(), .show(), .split(), .store()
Note
By default, show() truncates printing of the data attribute if it contains a large number of containers. This can be disabled by passing show_all=True to show().
The split light curves can then be plotted in the same way as before - now producing a grid with three figures (one per unique source):
asassn_query.open()
Warning
As split utilises a per-survey object ID to separate detections, its efficacy depends heavily on the specific implementation provided by each survey.
Data Quality Filtering#
By default, basic quality filtering is enabled for the following surveys:
ATLAS: Filtering is performed as advised here.
TESS:
Flux significance > 3,quality flag = 0.
To disable all unrequired filtering, pass filter=False to query() when retrieving data from one the above surveys.
Download this Tutorial
Total running time of the script: (0 minutes 1.839 seconds)