.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_tutorials/images/image_plotting.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_images_image_plotting.py: ################### Image Customisation ################### Similarly to :func:`~ATK.Tools.query`, the :meth:`~ATK.Models.DataSet.plot` method of a :class:`~ATK.Models.DataSet` accepts various additional arguments depending on the kind of data that is being plotted. When plotting an :class:`~ATK.Models.Image`, two such arguments can be utilised: ``cmap`` and ``relative_axes``. | .. note:: Calling :meth:`~ATK.Models.DataSet.open` automatically calls :meth:`~ATK.Models.DataSet.plot` if a figure has not already been generated. In this case, :meth:`~ATK.Models.DataSet.open` passes any additional keyword arguments to :meth:`~ATK.Models.DataSet.plot`. A new plot will also be generated if the keyword arguments passed to :meth:`~ATK.Models.DataSet.open` do not match those of the stored figure. | Changing the Colour Map ======================= The ``cmap`` parameter sets the colour map of the plotted image: 1. ``viridis`` (default): .. GENERATED FROM PYTHON SOURCE LINES 24-31 .. code-block:: Python from ATK import query ps_query = query("image", targets=2552928187080872832, survey="panstarrs", band="g", size=120, path="example_image_1.fits.gz") ps_query.open(cmap="viridis") .. raw:: html
Bokeh Figure


.. GENERATED FROM PYTHON SOURCE LINES 47-50 | 2. ``grey``: .. GENERATED FROM PYTHON SOURCE LINES 51-54 .. code-block:: Python ps_query.open(cmap="grey") .. raw:: html
Bokeh Figure


.. GENERATED FROM PYTHON SOURCE LINES 64-67 | 3. ``false_colour``, which maps the wavelength of the image filter into a single RGB colour: .. GENERATED FROM PYTHON SOURCE LINES 68-71 .. code-block:: Python ps_query.open(cmap="false_colour") .. raw:: html
Bokeh Figure


.. GENERATED FROM PYTHON SOURCE LINES 81-87 | | Configuring Axes Coordinates ============================ So far, all images have had coordinate axes that are defined relative to the image centre, i.e. ``relative_axes = True`` (default). To instead use absolute coordinates on the sky, `pass ``relative_axes = False``: .. GENERATED FROM PYTHON SOURCE LINES 88-91 .. code-block:: Python ps_query.open(relative_axes=False) .. raw:: html
Bokeh Figure


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