| 1 |
.. _howto-avm: |
| 2 |
|
| 3 |
AVM tagging |
| 4 |
=========== |
| 5 |
|
| 6 |
The latest developer version of APLpy has support for reading/writing AVM tags |
| 7 |
from/to RGB images (via `PyAVM <http://astrofrog.github.io/pyavm/>`_). To make |
| 8 |
a plot with an AVM-tagged RGB image, say 'example.jpg', you can use:: |
| 9 |
|
| 10 |
import aplpy |
| 11 |
f = aplpy.FITSFigure('example.jpg') |
| 12 |
f.show_rgb() |
| 13 |
|
| 14 |
Note that no filename is required for :meth:`~aplpy.FITSFigure.show_rgb` |
| 15 |
in this case. |
| 16 |
|
| 17 |
If PyAVM is installed, :func:`~aplpy.make_rgb_image` can embed AVM |
| 18 |
meta-data into RGB images it creates, although only JPEG and PNG files support |
| 19 |
this:: |
| 20 |
|
| 21 |
import aplpy |
| 22 |
aplpy.make_rgb_image('2mass_cube.fits', '2mass_rgb.jpg') |
| 23 |
|
| 24 |
If PyAVM 0.9.1 or later is installed, the above file ``2mass_rgb.jpg`` will |
| 25 |
include AVM meta-data and can then be plotted with:: |
| 26 |
|
| 27 |
import aplpy |
| 28 |
f = aplpy.FITSFigure('2mass_rgb.jpg') |
| 29 |
f.show_rgb() |
| 30 |
|
| 31 |
In other words, this means that when creating an RGB image with APLpy, it is |
| 32 |
no longer necessary to initialize :class:`~aplpy.FITSFigure` with a FITS |
| 33 |
file and then use :meth:`~aplpy.FITSFigure.show_rgb` with the RGB image |
| 34 |
filename - instead, :class:`~aplpy.FITSFigure` can be directly |
| 35 |
initialized with the AVM-tagged image. |
| 36 |
|
| 37 |
To disable the embedding of AVM tags, you can use the ``embed_avm_tags=False`` |
| 38 |
option for :func:`~aplpy.make_rgb_image`. |
| 39 |
|
| 40 |
These features require `PyAVM 0.9.1 <http://astrofrog.github.io/pyavm/>`_ |
| 41 |
or later. Please report any issues you encounter `here |
| 42 |
<https://github.com/aplpy/aplpy/issues>`_. |