.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_tutorials/merging/merging_datasets.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_tutorials_merging_merging_datasets.py: ############################# Working with Multiple Surveys ############################# Combining Data Sets =================== The :meth:`~ATK.Models.DataSet.merge` method of a :class:`~ATK.Models.DataSet` can be used to combine it with another, **as long as they store data of the same type** (for a tutorial on plotting multiple types of data together, see :doc:`here <../datapages/datapage_plotting>`). Along with serving as the reversal of :meth:`~ATK.Models.DataSet.split`, :meth:`~ATK.Models.DataSet.merge` also allows for data from more than one survey to be utilised simultaneously: .. GENERATED FROM PYTHON SOURCE LINES 9-21 .. code-block:: Python from ATK import query target = 587316166180416640 asassn_data = query("lightcurve", targets=target, survey="asassn", path="asassn_lightcurve.fits.gz") gaia_data = query("lightcurve", targets=target, survey="gaia", path="gaia_lightcurve.fits.gz") merged_data = asassn_data.merge(gaia_data) merged_data.show() merged_data.open() .. rst-class:: sphx-glr-script-out .. code-block:: none .kind: Lightcurve .targets: 587316166180416640 | 141.185° 8.031° (icrs, 2016-01-01T00:00:00.000, 3.0″) .exception: False .data: 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] ° 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] ° survey: gaia band: g correction: full search_pos: 141.185° 8.031° (icrs, 2016-01-01T00:00:00.000) separation: 0.0″ mjd: [56956.46, 57138.227, ..., 57854.228, 57889.954] d mag: [18.023, 18.806, ..., 18.548, 18.503] mag mag_err: [0.051, 0.021, ..., 0.011, 0.014] mag ra: [141.185, 141.185, ..., 141.185, 141.185] ° dec: [8.031, 8.031, ..., 8.031, 8.031] ° survey: gaia band: bp correction: full search_pos: 141.185° 8.031° (icrs, 2016-01-01T00:00:00.000) separation: 0.0″ mjd: [56956.461, 57138.227, ..., 57854.229, 57889.954] d mag: [18.201, 19.645, ..., 18.954, 18.673] mag mag_err: [0.041, 0.091, ..., 0.047, 0.056] mag ra: [141.185, 141.185, ..., 141.185, 141.185] ° dec: [8.031, 8.031, ..., 8.031, 8.031] ° +1 more ... Available Methods: .add(), .apply(), .from_target(), .merge(), .open(), .plot(), .save(), .show(), .split(), .store() .. raw:: html
Bokeh Figure


.. GENERATED FROM PYTHON SOURCE LINES 37-42 | | | .. rubric:: Download this Tutorial .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.723 seconds) .. _sphx_glr_download_auto_tutorials_merging_merging_datasets.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: merging_datasets.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: merging_datasets.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: merging_datasets.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_