[AstroPy] Error in pixel to sky coordinate conversion with astropy.wcs

Tim Jenness tim.jenness at gmail.com
Tue Apr 29 13:38:54 EDT 2014


I'm not sure what this telescope is intending but the DATE-OBS header is
not at all compliant with the FITS standard so astropy is within its rights
to complain. DATE-OBS must be in ISO date format if HH:MM::SS is being
specified. Slashes are only used for pre Y2K format headers that just
specified the day.

I looked at the file with pyast and get the following warnings so it does
manage to read it (and ignores the broken DATE-OBS so guesses the date:

Reading your image produced the following messages:

Result of attempt to read WCS encoded as: FITS-IRAF

Succeeded

ASTWARN = '        '

ASTWARN = 'The original FITS header did not specify the longitude of '

ASTWARN = 'the native north pole. A default value of 180 degrees was '

ASTWARN = 'assumed.'

ASTWARN = '        '

ASTWARN = '        '

ASTWARN = 'The original FITS header did not specify the date of '

ASTWARN = 'observation. A default value of J2000 was assumed.'

ASTWARN = '        '




On Tue, Apr 29, 2014 at 10:20 AM, Angelo Varlotta <avarlotta at cfa.harvard.edu
> wrote:

>  Hello,
> I need to convert a list of sources from pixel coordinates to sky
> coordinates for some PAIRITel data, using astropy (0.3.1) and using the
> following code:
>
> from __future__ import division
> import numpy
> from astropy import wcs
> from astropy.io import fits
> import sys
>
> hdulist = fits.open(sys.argv[-1])
> w = wcs.WCS(hdulist[0].header)
> pixcrd = numpy.array([[0,0],[24,38],[45,98]], numpy.float_)
> world = w.wcs_pix2world(pixcrd, 1)
> print world
>
> (the fits file is at h_long_CYGX3.1.11_coadd.fits <https://db.tt/TfTbSBRH>,
> the code is in a file I called pix2sky.py)
>
> The code derives from the first example in the documentation for
> astropy.wcs at: http://docs.astropy.org/en/stable/wcs/index.html. While I
> can do this sucessfully with a fits file generated from Fermi analysis (so
> I know that astropy is installed properly and works), with the PAIRITel
> data I get the following error message, after running from the terminal
> prompt python pix2sky.py h_long_CYGX3.1.11_coadd.fits:
>
>
> WARNING: FITSFixedWarning: RADECSYS= 'ICRS ' / Astrometric system
> RADECSYS is non-standard, use RADESYSa. [astropy.wcs.wcs]
> WARNING: FITSFixedWarning: 'datfix' made the change 'Invalid parameter
> value: invalid date '2010/5/14 09:23:52''. [astropy.wcs.wcs]
> WARNING: FITSFixedWarning: 'celfix' made the change 'PV1_5 : Unrecognized
> coordinate transformation parameter'. [astropy.wcs.wcs]
>
> Traceback (most recent call last):
>   File "pix2sky.py", line 49, in <module>
>     load_wcs_from_file(sys.argv[-1])
>   File "pix2sky.py", line 36, in load_wcs_from_file
>     world = w.wcs_pix2world(pixcrd, 1)
>   File
> "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/astropy-0.3.1-py2.7-macosx-10.9-x86_64.egg/astropy/wcs/wcs.py",
> line 1159, in wcs_pix2world
>     'output', *args, **kwargs)
>   File
> "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/astropy-0.3.1-py2.7-macosx-10.9-x86_64.egg/astropy/wcs/wcs.py",
> line 1060, in _array_converter
>     return _return_single_array(xy, origin)
>   File
> "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/astropy-0.3.1-py2.7-macosx-10.9-x86_64.egg/astropy/wcs/wcs.py",
> line 1044, in _return_single_array
>     result = func(xy, origin)
>   File
> "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/astropy-0.3.1-py2.7-macosx-10.9-x86_64.egg/astropy/wcs/wcs.py",
> line 1158, in <lambda>
>     lambda xy, o: self.wcs.p2s(xy, o)['world'],
> astropy.wcs._wcs.InvalidTransformError: ERROR 6 in wcsset() at line 1562
> of file cextern/wcslib/C/wcs.c:
> PV1_5 : Unrecognized coordinate transformation parameter.
>
>
> How do I proceed?
>
> Cheers,
> Angelo
>
> Angelo Varlotta
> Smithsonian Astrophysical Observatory
> 60 Garden St. MS-06, Cambridge, MA 02138, USA
> Phone: +1-617-495-7138
> Office: B-226
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20140429/a5b07cd1/attachment.html>


More information about the AstroPy mailing list