Putting Everything Together#

Putting multi-target operations, split(), merge(), and datapage generation together allows for sophisticated workflows.

The following example shows a set of 2-target light curve queries to ASAS-SN and TESS:

from ATK import query, grid

import astropy.units as u

targets = [5346631922949364864, 587316166180416640]

asassn_data = query("lightcurve", targets=targets, survey="asassn", path="assasn_data.fits.gz")
tess_data = query("lightcurve", targets=targets, survey="tess", path="tess_data.fits.gz")

The returned DataSet objects can then be merged:

all_lcs = asassn_data.merge(tess_data)
all_lcs.show()
<Lightcurve DataSet>

.kind:      Lightcurve
.targets:   5346631922949364864 | 170.1° -54.7° (icrs, 2016-01-01T00:00:00.000, 3.0″), 587316166180416640 | 141.185° 8.031° (icrs, 2016-01-01T00:00:00.000, 3.0″)
.exception: False
.data:
      <asassn v-band Lightcurve>
            survey:     asassn
            band:       v
            correction: full
            search_pos: 170.1° -54.7° (icrs, 2015-01-01T00:00:00.000)
            separation: 0.019″
            mjd:        [57422.291, 57425.327, ..., 58327.981, 58333.972] d
            mag:        [11.922, 11.987, ..., 11.963, 12.079] mag
            mag_err:    [0.002, 0.001, ..., 0.001, 0.003] mag
            ra:         [170.1, 170.1, ..., 170.1, 170.1] °
            dec:        [-54.7, -54.7, ..., -54.7, -54.7] °

      <asassn g-band Lightcurve>
            survey:     asassn
            band:       g
            correction: full
            search_pos: 170.1° -54.7° (icrs, 2015-01-01T00:00:00.000)
            separation: 0.019″
            mjd:        [58282.109, 58282.753, ..., 60835.954, 60838.126] d
            mag:        [12.097, 12.213, ..., 12.196, 12.198] mag
            mag_err:    [0.001, 0.002, ..., 0.003, 0.003] mag
            ra:         [170.1, 170.1, ..., 170.1, 170.1] °
            dec:        [-54.7, -54.7, ..., -54.7, -54.7] °

      <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″
            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″
            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] °
+2 more ...

Available Methods: .add(), .apply(), .from_target(), .merge(), .open(), .plot(), .save(), .show(), .split(), .store()

Power spectra can be generated across the merged data set:

all_pspec = all_lcs.apply("pspec", fmin=0, fmax=10, samples=50000, inplace=False)
all_pspec.show()
<Lightcurve DataSet>

.kind:      Lightcurve
.targets:   5346631922949364864 | 170.1° -54.7° (icrs, 2016-01-01T00:00:00.000, 3.0″), 587316166180416640 | 141.185° 8.031° (icrs, 2016-01-01T00:00:00.000, 3.0″)
.exception: False
.data:
      <asassn v, g-band Powspec>
            survey:    asassn
            band:      v, g
            frequency: [0.0, 0.0, ..., 10.0, 10.0] d⁻¹
            power:     [0.0, 0.066, ..., 0.006, 0.022]
            fopt:      0.002 d⁻¹
            popt:      416.658 d

      <asassn v, g-band Powspec>
            survey:    asassn
            band:      v, g
            frequency: [0.0, 0.0, ..., 10.0, 10.0] d⁻¹
            power:     [0.0, 0.006, ..., 0.0, 0.001]
            fopt:      5.547 d⁻¹
            popt:      0.18 d

      <tess Tmag-band Powspec>
            survey:    tess
            band:      Tmag
            frequency: [0.0, 0.0, ..., 10.0, 10.0] d⁻¹
            power:     [0.0, 0.036, ..., 0.001, 0.001]
            fopt:      0.076 d⁻¹
            popt:      13.227 d

      <tess Tmag-band Powspec>
            survey:    tess
            band:      Tmag
            frequency: [0.0, 0.0, ..., 10.0, 10.0] d⁻¹
            power:     [0.0, 0.003, ..., 0.0, 0.0]
            fopt:      5.546 d⁻¹
            popt:      0.18 d


Available Methods: .add(), .apply(), .from_target(), .merge(), .open(), .plot(), .save(), .show(), .split(), .store()

The light curves in the merged DataSet can also be phase-folded and binned:

all_fold = all_lcs.apply("fold", fmin=0, fmax=10, samples=50000, inplace=False)
all_fold.apply("bin", bins=200)
all_fold.show()
<Lightcurve DataSet>

.kind:      Lightcurve
.targets:   5346631922949364864 | 170.1° -54.7° (icrs, 2016-01-01T00:00:00.000, 3.0″), 587316166180416640 | 141.185° 8.031° (icrs, 2016-01-01T00:00:00.000, 3.0″)
.exception: False
.data:
      <asassn v-band Lightcurve>
            survey:     asassn
            band:       v
            mag:        [17.3, 17.53, ..., 16.739, 16.903] mag
            mag_err:    [0.179, 0.202, ..., 0.201, 0.055] mag
            phase:      [0.048, 0.062, ..., 0.925, 0.981]
            fopt:       0.001 d⁻¹
            popt:       1666.633 d

      <asassn g-band Lightcurve>
            survey:     asassn
            band:       g
            mag:        [17.896, 18.104, ..., 16.87, 18.232] mag
            mag_err:    [0.129, 0.103, ..., 0.057, 0.132] mag
            phase:      [0.015, 0.02, ..., 0.964, 0.979]
            fopt:       0.001 d⁻¹
            popt:       1666.633 d

      <asassn v-band Lightcurve>
            survey:     asassn
            band:       v
            mag:        [12.052, 12.079, ..., 12.081, 12.066] mag
            mag_err:    [0.001, 0.003, ..., 0.002, 0.002] mag
            phase:      [0.003, 0.007, ..., 0.99, 0.995]
            fopt:       2.773 d⁻¹
            popt:       0.361 d

      <asassn g-band Lightcurve>
            survey:     asassn
            band:       g
            mag:        [12.23, 12.23, ..., 12.166, 12.209] mag
            mag_err:    [0.002, 0.001, ..., 0.001, 0.001] mag
            phase:      [0.003, 0.008, ..., 0.992, 0.997]
            fopt:       2.773 d⁻¹
            popt:       0.361 d
+2 more ...

Available Methods: .add(), .apply(), .from_target(), .merge(), .open(), .plot(), .save(), .show(), .split(), .store()

Finally, the acquired DataSet objects can be combined into datapages:

layout = [[all_lcs,   all_lcs,   all_lcs,  all_lcs,  all_lcs],
         [all_lcs,   all_lcs,   all_lcs,  all_lcs,  all_lcs],
         [all_pspec, all_pspec, all_fold, all_fold, all_fold],
         [all_pspec, all_pspec, all_fold, all_fold, all_fold]]

datapages = grid(layout)

datapages.open(targets[0])
Bokeh Figure





Download this Tutorial

Total running time of the script: (3 minutes 4.671 seconds)

Gallery generated by Sphinx-Gallery