[AstroPy] DS9 color tables in Python

Peter Weilbacher pweilbacher at aip.de
Thu Apr 2 12:11:40 EDT 2015


Thanks, everybody, for the comments in this thread. It would be great to
get these color tables into astropy.

In the short term, the hint that I can get very similar versions of all
these tables from CIAO has given me exactly what I need. I just did

    import numpy
    import matplotlib.colors as colors
    import matplotlib.cm as cm
    import aplpy

    hsv = numpy.loadtxt('hsv.lut')
    ciao_hsv = colors.ListedColormap(hsv, 'ciao_hsv')
    cm.register_cmap(cmap=ciao_hsv)

    halpha = aplpy.FITSFigure('2015_data/halpha.fits', 3)
    halpha.show_colorscale(cmap='ciao_hsv')
    halpha.show_colorbar()
    halpha.save('halpha_hsv_ciao.png')

and got a very nice plot -- exactly what I need!

The tables from CIAO are numerically a bit different from the ones I
managed to export from DS9 as three-column tables (like hsv). But in
practise, I can hardly notice the difference in the plots.

Cheers,
   Peter.
-- 
Dr Peter Weilbacher                 http://www.aip.de/People/PWeilbacher
Phone +49 331 74 99-667                       encryption key ID 7D6B4AA0
------------------------------------------------------------------------
Leibniz-Institut für Astrophysik Potsdam (AIP)
An der Sternwarte 16, D-14482 Potsdam

Vorstand: Prof. Dr. Matthias Steinmetz
Stiftung bürgerlichen Rechts, Stiftungsverz. Brandenburg: 26 742-00/7026



More information about the AstroPy mailing list