[AstroPy] pywcs problem on Linux

Michael Droettboom mdroe at stsci.edu
Wed May 6 10:29:05 EDT 2009


Hmmm... I'm not seeing this problem here with your linked fits file and 
test.py.

Occasionally the distutils build script that pywcs uses doesn't rebuild 
enough.  Try deleting the build directory and then rebuilding and 
installing.

If that still doesn't work, can you send the following:

- Your version of gcc
- The output of the build
- A gdb backtrace

This last can be obtained by running "gdb python" and the command 
prompt.  Then "run test.py ." (assuming test.py and the fits file are in 
the current directory).  When it crashes, type "bt" to get a backtrace.

Cheers,
Mike

OKUMURA, Akira wrote:
> Hello again,
>
> ver 1.4-4.3 runs properly with the sample FITS and the modified script  
> on my Mac (10.5). So the problem seems to happen only with Linux.
>
>
> On 2009/05/06, at 23:07, OKUMURA, Akira wrote:
>
>   
>> Hello Mike and Thomas,
>>
>> I modified test.py to use the second or third argument, but still I
>> get a seg fault after calling wcs_pix2sky. And wcs.wcs.fix() always
>> cause a seg fault. I have uploaded my sample FITS and modified  
>> test.py.
>>
>> http://www-utheal.phys.s.u-tokyo.ac.jp/~oxon/model_total_ICHII_bin00.fits
>> http://www-utheal.phys.s.u-tokyo.ac.jp/~oxon/test.py
>>
>> Could you investigate it?
>>
>> Regards,
>>
>> OKUMURA, Akira oxon at ceres.phys.s.u-tokyo.ac.jp
>> Department of Physics, The University of Tokyo
>> 7-3-1 Hongo, Bunkyo-ku, Tokyo 113-0033
>> TEL/FAX +81 3-5841-4173/4059
>> Skype : okumura.akira
>>
>> On 2009/05/06, at 22:30, Michael Droettboom wrote:
>>
>>     
>>> It looks as if your new traceback is related to an API change -- all
>>> of the transformation functions now require an "offset" argument,
>>> which should be 0 for C/Numpy indexing or 1 for Fortran/FITS  
>>> indexing.
>>>
>>> If that change doesn't work for you, can you send me a FITS file and
>>> script to reproduce this off list?  I'll see if I can reproduce what
>>> you're seeing here.
>>>
>>> Mike
>>>
>>>
>>>
>>> OKUMURA, Akira wrote:
>>>       
>>>> Hello Nadia,
>>>>
>>>> Thank you for your reply. I didn't know that new version has been
>>>> released recently. I installed pywcs-1.4-4.3.tar.gz and tried
>>>> test.py  in the package. But I got errors again.
>>>>
>>>> 1)
>>>> $ ./test.py .
>>>> = = =
>>>> =
>>>> =
>>>> =
>>>> = 
>>>> ====================================================================
>>>> ./cmap.fits
>>>> zsh: segmentation fault  ./test.py .
>>>>
>>>> the line wcs.wcs.fix() causes the seg fault.
>>>>
>>>> 2) comment out wcs.wcs.fix()
>>>> $ ./test.py .
>>>> = = =
>>>> =
>>>> =
>>>> =
>>>> = 
>>>> ====================================================================
>>>> ./cmap.fits
>>>> Traceback (most recent call last):
>>>>  File "./test.py", line 82, in <module>
>>>>    run_directory(directory)
>>>>  File "./test.py", line 74, in run_directory
>>>>    test_file(filepath)
>>>>  File "./test.py", line 38, in test_file
>>>>    world = wcs.wcs_pix2sky(data3)
>>>>  File "/usr/local/lib/python2.5/site-packages/pywcs/pywcs.py",
>>>> line  419, in wcs_pix2sky
>>>>    *args, **kwargs)
>>>>  File "/usr/local/lib/python2.5/site-packages/pywcs/pywcs.py",
>>>> line  378, in _array_converter
>>>>    raise TypeError("Expected 2 or 3 arguments, %d given" %
>>>> len(args))
>>>> TypeError: Expected 2 or 3 arguments, 1 given
>>>>
>>>> I tried several FITS files but I got the same errors. Do you have
>>>> any  idea?
>>>>
>>>> Regards,
>>>>
>>>> OKUMURA, Akira oxon at ceres.phys.s.u-tokyo.ac.jp
>>>> Department of Physics, The University of Tokyo
>>>> 7-3-1 Hongo, Bunkyo-ku, Tokyo 113-0033
>>>> TEL/FAX +81 3-5841-4173/4059
>>>> Skype : okumura.akira
>>>>
>>>> On 2009/05/06, at 20:47, Nadezhda Dencheva wrote:
>>>>
>>>>
>>>>         
>>>>> Hi,
>>>>>
>>>>> You are running an older version of pywcs.
>>>>> I believe an upgrade to the latest release will fix this.
>>>>>
>>>>>
>>>>> Nadia Dencheva
>>>>>
>>>>> ---- Original message ----
>>>>>
>>>>>           
>>>>>> Date: Wed, 6 May 2009 15:30:23 +0900
>>>>>> From: astropy-bounces at scipy.org (on behalf of "OKUMURA, Akira" <oxon at ceres.phys.s.u-tokyo.ac.jp
>>>>>>             
>>>>>>> )
>>>>>>>
>>>>>>>               
>>>>>> Subject: [AstroPy] pywcs problem on Linux
>>>>>> To: astropy at scipy.org
>>>>>>
>>>>>> Hello all,
>>>>>>
>>>>>> I have installed pywcs in two environments.
>>>>>> (1) Scientific Linux 4.7 (64 bit)
>>>>>> + Python 2.5.4 (r254:67916, May  6 2009, 07:09:17)
>>>>>> + GCC 3.4.6 20060404 (Red Hat 3.4.6-10)] on linux2
>>>>>> + pyfits-1.3
>>>>>> + pywcs-1.3a1-4.3
>>>>>> (2) Red Hat Enterprise Linux 4 (32 bit).
>>>>>> + Python 2.5.1 (r251:54863, Aug 24 2007, 16:22:50)
>>>>>> + GCC 3.4.3 (TWW)] on linux2
>>>>>> + pywcs-1.3a1-4.3
>>>>>> + pyfits-2.1.1
>>>>>>
>>>>>> But I got following errors even though it runs properly on Mac  
>>>>>> OS X
>>>>>> 10.5.
>>>>>> === Error on (1) ===
>>>>>>
>>>>>>             
>>>>>>>>> hdulist = pyfits.open("cmap.fits")
>>>>>>>>> wcs = pywcs.WCS(hdulist[0].header)
>>>>>>>>>
>>>>>>>>>                   
>>>>>> zsh: segmentation fault  python
>>>>>>
>>>>>> === Error on (2) ===
>>>>>>
>>>>>>             
>>>>>>>>> hdulist = pyfits.open("cmap.fits")
>>>>>>>>> wcs = pywcs.WCS(hdulist[0].header)
>>>>>>>>>
>>>>>>>>>                   
>>>>>> Traceback (most recent call last):
>>>>>> File "<stdin>", line 1, in <module>
>>>>>> File "/u/gl/oxon/tmp/lib/python2.5/site-packages/pywcs/pywcs.py",
>>>>>> line 155, in __init__
>>>>>>  self.footprint = self._calcFootprint(header)
>>>>>> File "/u/gl/oxon/tmp/lib/python2.5/site-packages/pywcs/pywcs.py",
>>>>>> line 181, in _calcFootprint
>>>>>>  return self.all_pix2sky(corners)
>>>>>> File "/u/gl/oxon/tmp/lib/python2.5/site-packages/pywcs/pywcs.py",
>>>>>> line 307, in all_pix2sky
>>>>>>  return self._array_converter(self._all_pix2sky, *args, **kwargs)
>>>>>> File "/u/gl/oxon/tmp/lib/python2.5/site-packages/pywcs/pywcs.py",
>>>>>> line 294, in _array_converter
>>>>>>  return func(args[0], **kwargs)
>>>>>> SystemError: Python/getargs.c:1246: bad argument to internal
>>>>>> function
>>>>>>
>>>>>> Is there any tips on running pywcs with Linux ?
>>>>>>
>>>>>> The FITS is as follows.
>>>>>>
>>>>>>
>>>>>>             
>>>>>>>>> print hdulist[0].header
>>>>>>>>>
>>>>>>>>>                   
>>>>>> SIMPLE  =                    T / File conforms to NOST standard
>>>>>> BITPIX  =                   32 / Bits per pixel
>>>>>> NAXIS   =                    2 / No data is associated with this
>>>>>> header
>>>>>> NAXIS1  =                  160 / Length of data axis 1
>>>>>> NAXIS2  =                  160 / Length of data axis 2
>>>>>> EXTEND  =                    T / Extensions may be present
>>>>>> COMMENT   FITS (Flexible Image Transport System) format is
>>>>>> defined in
>>>>>> 'Astronomy
>>>>>> COMMENT   and Astrophysics', volume 376, page 359; bibcode:
>>>>>> 2001A&A...
>>>>>> 376..359H
>>>>>> CTYPE1  = 'GLON-AIT'           / RA---%%%, %%% represents the
>>>>>> projection method
>>>>>> CRPIX1  =                 80.5 / Reference pixel
>>>>>> CRVAL1  =                 211. / RA at the reference pixel
>>>>>> CDELT1  =                -0.25 / X-axis incr per pixel of physical
>>>>>> coord at posi
>>>>>> CUNIT1  = 'deg     '           / Physical unit of X-axis
>>>>>> CTYPE2  = 'GLAT-AIT'           / DEC---%%%, %%% represents the
>>>>>> projection method
>>>>>> CRPIX2  =                 80.5 / Reference pixel
>>>>>> CRVAL2  =                 -17. / DEC at the reference pixel
>>>>>> CDELT2  =                 0.25 / Y-axis incr per pixel of physical
>>>>>> coord at posi
>>>>>> CUNIT2  = 'deg     '           / Physical unit of Y-axis
>>>>>> CROTA2  =                   0. / Image rotation (deg)
>>>>>> DATE    = '2009-04-01T15:34:22' / file creation date (YYYY-MM-
>>>>>> DDThh:mm:ss U
>>>>>> FILENAME= 'cmap.fits'          /
>>>>>> TELESCOP= 'GLAST   '           /  name of telescope generating  
>>>>>> data
>>>>>> INSTRUME= 'LAT     '           /  name of instrument generating
>>>>>> data
>>>>>> DATE-OBS= '2009-03-11T21:33:18.000' / start date and time of the
>>>>>> observation (U
>>>>>> DATE-END= '2009-03-17T16:26:38.000' / end date and time of the
>>>>>> observation (UTC
>>>>>> NDSKEYS =                    5
>>>>>> EQUINOX =                2000. / Equinox of RA & DEC  
>>>>>> specifications
>>>>>> OBSERVER= 'Peter Michelson'    /  GLAST/LAT PI
>>>>>> CREATOR = 'gtbin   '           / Software and version creating  
>>>>>> file
>>>>>> HISTORY                   LatCountMapTemplate,v 1.3 2005/04/05
>>>>>> 21:06:39 peachey
>>>>>> HISTORY Exp
>>>>>> CHECKSUM= 'c8JZf8JXc8JXc8JX'   / HDU checksum updated
>>>>>> 2009-04-01T06:34:22
>>>>>> DATASUM = '182648  '           / data unit checksum updated
>>>>>> 2009-04-01T06:34:22
>>>>>> DSTYP1  = 'TIME    '
>>>>>> DSUNI1  = 's       '
>>>>>> DSVAL1  = 'TABLE   '
>>>>>> DSREF1  = ':GTI    '
>>>>>> DSTYP2  = 'POS(RA,DEC)'
>>>>>> DSUNI2  = 'deg     '
>>>>>> DSVAL2  = 'CIRCLE(86.81257852,-6.005536809,20)'
>>>>>> DSTYP3  = 'CTBCLASSLEVEL'
>>>>>> DSUNI3  = 'dimensionless'
>>>>>> DSVAL3  = '3:      '
>>>>>> DSTYP4  = 'ENERGY  '
>>>>>> DSUNI4  = 'MeV     '
>>>>>> DSVAL4  = '200:20000'
>>>>>> DSTYP5  = 'ZENITH_ANGLE'
>>>>>> DSUNI5  = 'deg     '
>>>>>> DSVAL5  = '0:100   '
>>>>>>
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> OKUMURA, Akira oxon at ceres.phys.s.u-tokyo.ac.jp
>>>>>> Department of Physics, The University of Tokyo
>>>>>> 7-3-1 Hongo, Bunkyo-ku, Tokyo 113-0033
>>>>>> TEL/FAX +81 3-5841-4173/4059
>>>>>> Skype : okumura.akira
>>>>>>
>>>>>> _______________________________________________
>>>>>> AstroPy mailing list
>>>>>> AstroPy at scipy.org
>>>>>> http://mail.scipy.org/mailman/listinfo/astropy
>>>>>>
>>>>>>             
>>>> _______________________________________________
>>>> AstroPy mailing list
>>>> AstroPy at scipy.org
>>>> http://mail.scipy.org/mailman/listinfo/astropy
>>>>
>>>>         
>>> -- 
>>> Michael Droettboom
>>> Science Software Branch
>>> Operations and Engineering Division
>>> Space Telescope Science Institute
>>> Operated by AURA for NASA
>>>
>>>       
>> _______________________________________________
>> AstroPy mailing list
>> AstroPy at scipy.org
>> http://mail.scipy.org/mailman/listinfo/astropy
>>     
>
>
>
>
> Regards,
>
> OKUMURA, Akira oxon at ceres.phys.s.u-tokyo.ac.jp
> Department of Physics, The University of Tokyo
> 7-3-1 Hongo, Bunkyo-ku, Tokyo 113-0033
> TEL/FAX +81 3-5841-4173/4059
> Skype : okumura.akira
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy
>   

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA




More information about the AstroPy mailing list