.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_tutorials/datatables/datatables.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_datatables_datatables.py: ###################### Generating Data Tables ###################### :class:`~ATK.Models.DataTable` objects are a means of tabulating `Vizier `_ data, and are particularly useful in the generation of :class:`~ATK.Models.DataPages` (see the :doc:`next tutorial <../datapages/datapage_plotting>`). A :class:`~ATK.Models.DataTable` can be generated by specifying a ``dict`` of `Vizier `_ catalogues and corresponding column names inside a ``"datatable"`` :func:`~ATK.Tools.query`. This tutorial will generate a table of photometric data from Gaia and GALEX: .. GENERATED FROM PYTHON SOURCE LINES 9-17 .. code-block:: Python from ATK import query target = 587316166180416640 table = query("datatable", targets=target, columns={"gaia": ["Gmag", "BPmag", "RPmag"], "galex": ["NUVmag", "FUVmag"]}, path="example_table.fits.gz") table.show(show_types=True) .. rst-class:: sphx-glr-script-out .. code-block:: none .kind (str): DataTable .targets (list): 587316166180416640 | 141.185° 8.031° (icrs, 2016-01-01T00:00:00.000, 3.0″) .exception (bool): False .data (list): table: (astropy.Table) survey: [gaia, gaia, ..., galex, galex] catalogue: [I/355/gaiadr3, I/355/gaiadr3, ..., II/335/galex_ais, II/335/galex_ais] correction: [full, full, ..., full, full] parameter: [Gmag, BPmag, ..., NUVmag, FUVmag] value: [18.8, 19.1, ..., 19.6, 19.7] unit: [ mag, mag, ..., mag, mag] separation (arcsec): [nan, nan, ..., 1.087, 1.087] Available Methods: .add(), .apply(), .from_target(), .merge(), .open(), .plot(), .save(), .show(), .split(), .store() .. GENERATED FROM PYTHON SOURCE LINES 23-26 The returned :class:`~ATK.Models.DataSet`'s :attr:`~ATK.Models.DataSet.data` attribute is a list containing a single :class:`~ATK.Models.DataTable` object.pass The :class:`~ATK.Models.DataTable` can be plotted like any other plottable container, by calling the :class:`~ATK.Models.DataSet`'s :meth:`~ATK.Models.DataSet.plot` or :meth:`~ATK.Models.DataSet.open` methods: .. GENERATED FROM PYTHON SOURCE LINES 26-29 .. code-block:: Python table.open() .. raw:: html
Bokeh Figure


.. GENERATED FROM PYTHON SOURCE LINES 38-43 .. note:: In this example, keys in ``rows`` are given as `Vizier `_ catalogue aliases. If a key is not found in the ATK Surveys file, it is instead interpreted as a `Vizier `_ catalogue ID. For more information, see :doc:`here <../extension/vizier>`. .. GENERATED FROM PYTHON SOURCE LINES 45-50 | | | .. rubric:: Download this Tutorial .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.151 seconds) .. _sphx_glr_download_auto_tutorials_datatables_datatables.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: datatables.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: datatables.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: datatables.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_