1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
Visualizing Astronomical Dendrograms
====================================
You can use Glue to visualize dendrograms created by the
`astrodendro <https://dendrograms.readthedocs.io/>`_ package.
Enabling the viewer
-------------------
The dendrogram viewer will be automatically available if the `astrodendro`_
package is installed. To install it, simply use::
pip install astrodendro
Building a dendrogram
---------------------
The details of constructing dendrograms for astronomical images
is beyond the scope of this document -- see `<https://dendrograms.readthedocs.io/>`_
for more information. The following snippet builds a dendrogram
from the W5 image used in the :ref:`tutorial <getting_started>`::
from astropy.io import fits
from astrodendro import Dendrogram
data = fits.getdata('W5.fits')
dg = Dendrogram.compute(data, min_value=500, min_npix=50)
dg.save_to('w5_dendro.fits')
Next, load this file into Glue, choosing "Dendrogram" as a file type.
You can now visualize the W5 dendrogram alongside its image:
.. figure:: images/dendro.png
:align: center
:width: 400px
Linking to Catalog Properties
-----------------------------
If you have used astrodendro to compute a catalog of structure properties,
you can visualize that in Glue as well. The best way to do this is to
save the catalog as a table, load it into Glue, and
:ref:`merge it <merging>` with the dendrogram dataset. This will
supplement the dendrogram with the additional catalog-derived properties.
|