[AstroPy] Getting Started with Python and FITS

Stefan Schwarzburg stefan.schwarzburg@googlemail....
Wed Apr 1 07:48:42 CDT 2009


On Wed, Apr 1, 2009 at 14:38, Maximilian Fabricius <mxhf@gmx.net> wrote:

> No, pyfits is only for the IO. No graphics.
>
> I am sure that you will be able to read a bmp file into
> some array and then to store it using pyfits (BTW 24Bits!?).
> I have never done that, though.
>
> Neat, can Numdisplay also access the xpa interface?
>

Just a few remarks:
there is also pysao with a simpler to use interface:
http://code.google.com/p/python-sao/
Quote:

>>> import pysao

# run new instance of ds9
>>> ds9 = pysao.ds9()

>>> import numpy
>>> im = numpy.reshape(numpy.arange(100), (10, 10))
# display 2-d array
>>> ds9.view(im)



>>> import pyfits
>>> f = pyfits.open('test.fits')
# display first extension of fits file
>>> ds9.view(f[0])

# access with XPA method.
>>> ds9.set('file test.fits')
>>> ds9.get('file')

# list available xpa commands
>>> ds9.xpa_help()

# help on the specific xpa command
>>> ds9.xpa_help("tile")



But if you prefer matplotlib, you should take a look at the kapteyn package:
http://www.astro.rug.nl/software/kapteyn/
it's the only matplotlib package i know of, that can display correct wcs
information.

Cheers,
Stefan





>
>
> 2009/4/1 Wayne Watson <sierra_mtnview@sbcglobal.net>:
> > Ultimately, I must display it in Python. If numdisplay is it, then
> that'll
> > likely do. I would have thought pyfits would have a display method.
> >
> > At some point, I will want to convert a raw image, 640x480, of some bit
> > depth (8, 16, 24) to a fits format. I might need to convert jpb images to
> > fits too. Comments?
> >
> > Christopher Hanley wrote:
> >
> > Another easy way to display a data section from a FITS file is to use
> > numdisplay and DS9.
> >
> > http://stsdas.stsci.edu/numdisplay/
> >
> > Numdisplay will work with and ndarray from numpy.  It is a one line
> command
> > after the import
> >
> >> import numdisplay
> >> numdisplay.display(yourArrayObject)
> >
> > Cheers,
> > Chris
> >
> >
> >
> > --
> >
> >            Wayne Watson (Watson Adventures, Prop., Nevada City, CA)
> >
> >              (121.01 Deg. W, 39.26 Deg. N) GMT-8 hr std. time)
> >
> >
> >           The Obama Administration plans to double the production
> >           in solar energy from 1% to 2% of the total energy
> >           supply in the next few years. One nuclear reaction
> >           would do the same. Heard on Bill Wattenburg, KGO-AM
> >
> >           "Less than all cannot satisfy Man." -- William Blake
> >
> >
> > _______________________________________________
> > AstroPy mailing list
> > AstroPy@scipy.org
> > http://mail.scipy.org/mailman/listinfo/astropy
> >
> >
>
>
>
> --
> --------------------------------------------------------------------
>  Maximilian Fabricius
>  * Max Planck Institute for Extraterrestrial Physics (MPE)
>     Giessenbachstrasse, D-85748 Garching, Germany
>  * University Observatory Munich /   Wendelstein Observatory
>     Scheinerstr. 1, D-81679 München, Germany
>  eMail:  mxhf@mpe.mpg.de
>  Phone:  +49 89 30000 3694
>  FAX:    +49 89 30000 3495
>  --------------------------------------------------------------------
> _______________________________________________
> AstroPy mailing list
> AstroPy@scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/astropy/attachments/20090401/10d8e501/attachment.html 


More information about the AstroPy mailing list