[AstroPy] Getting Started with Python and FITS

Cohen-Tanugi Johann cohen@lpta.in2p3...
Wed Apr 1 07:55:39 CDT 2009


nice! I just installed it. Just got a few warnings:
running build_ext
building 'xpa' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall 
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
--param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic 
-fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fPIC 
-I/data1/sources/heasoft-6.5/i686-pc-linux-gnu-libc2.7/include/ 
-I/usr/include/python2.5 -c xpa.c -o build/temp.linux-i686-2.5/xpa.o
xpa.c: In function ‘__pyx_f_3xpa_nslookup’:
xpa.c:158: warning: label ‘__pyx_L3’ defined but not used
xpa.c:156: warning: label ‘__pyx_L2’ defined but not used
xpa.c:100: warning: unused variable ‘__pyx_v_iter’
xpa.c: In function ‘__pyx_f_3xpa__get’:
xpa.c:204: warning: unused variable ‘__pyx_v_i’
xpa.c: In function ‘__pyx_f_3xpa_3xpa___del__’:
xpa.c:530: warning: label ‘__pyx_L1’ defined but not used
xpa.c: In function ‘__pyx_tp_new_3xpa_xpa’:
xpa.c:626: warning: unused variable ‘p’
xpa.c: In function ‘__pyx_tp_dealloc_3xpa_xpa’:
xpa.c:631: warning: unused variable ‘p’
xpa.c: In function ‘__pyx_tp_traverse_3xpa_xpa’:
xpa.c:637: warning: unused variable ‘p’
xpa.c:636: warning: unused variable ‘e’
xpa.c: In function ‘__pyx_tp_clear_3xpa_xpa’:
xpa.c:642: warning: unused variable ‘p’
xpa.c: At top level:
xpa.c:15: warning: ‘__Pyx_UnpackItem’ declared ‘static’ but never defined
xpa.c:16: warning: ‘__Pyx_EndUnpack’ declared ‘static’ but never defined
xpa.c:17: warning: ‘__Pyx_PrintItem’ declared ‘static’ but never defined
xpa.c:18: warning: ‘__Pyx_PrintNewline’ declared ‘static’ but never defined
xpa.c:20: warning: ‘__Pyx_ReRaise’ declared ‘static’ but never defined
xpa.c:21: warning: ‘__Pyx_Import’ declared ‘static’ but never defined
xpa.c:22: warning: ‘__Pyx_GetExcValue’ declared ‘static’ but never defined
xpa.c:23: warning: ‘__Pyx_ArgTypeTest’ declared ‘static’ but never defined
xpa.c:24: warning: ‘__Pyx_TypeTest’ declared ‘static’ but never defined
xpa.c:25: warning: ‘__Pyx_GetStarArgs’ declared ‘static’ but never defined
xpa.c:26: warning: ‘__Pyx_WriteUnraisable’ declared ‘static’ but never 
defined
xpa.c:28: warning: ‘__Pyx_ImportType’ declared ‘static’ but never defined
xpa.c:29: warning: ‘__Pyx_SetVtable’ declared ‘static’ but never defined
xpa.c:30: warning: ‘__Pyx_GetVtable’ declared ‘static’ but never defined
xpa.c:31: warning: ‘__Pyx_CreateClass’ declared ‘static’ but never defined
xpa.c:34: warning: ‘__Pyx_GetName’ declared ‘static’ but never defined
gcc -pthread -shared build/temp.linux-i686-2.5/xpa.o 
-L/data1/sources/heasoft-6.5/i686-pc-linux-gnu-libc2.7/lib -L/usr/lib 
-lxpa -lpython2.5 -o build/lib.linux-i686-2.5/xpa.so


Stefan Schwarzburg wrote:
>
>
>
> On Wed, Apr 1, 2009 at 14:38, Maximilian Fabricius <mxhf@gmx.net 
> <mailto: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
>     <mailto: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 <mailto: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 <mailto:mxhf@mpe.mpg.de>
>     Phone: +49 89 30000 3694
>     FAX: +49 89 30000 3495
>     --------------------------------------------------------------------
>     _______________________________________________
>     AstroPy mailing list
>     AstroPy@scipy.org <mailto:AstroPy@scipy.org>
>     http://mail.scipy.org/mailman/listinfo/astropy
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> AstroPy mailing list
> AstroPy@scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy
>   


More information about the AstroPy mailing list