[AstroPy] all_pix2world() NULL error

Michael Droettboom mdroe at stsci.edu
Tue Feb 18 12:34:41 EST 2014


Indeed, there was an bug in propagating the error message back to Python 
in |astropy.wcs|.

A fix for that is now in this pull request:

https://github.com/astropy/astropy/pull/2106

As a workaround until this fix is merged into a release, you can 
explicitly call |.wcs.set()| on the |WCS| object after creating it 
(astropy 0.4 already does this implicitly anyway).

That reveals the actual error in the WCS header:

|astropy.wcs._wcs.InvalidTransformError: ERROR 6 in wcsset() at line 1562 of file cextern/wcslib/C/wcs.c:
PV1_5 : Unrecognized coordinate transformation parameter.
|

This is because the WCS specifies TAN projections, which don’t have any 
additional PV parameters, yet this header has them. I’ve seen this in 
headers generated by SCAMP before, and we have a fix this technically 
non-standard construction in this pull request (which will make it into 
astropy 0.4):

https://github.com/astropy/astropy/pull/1278

Mike

On 02/16/2014 06:49 AM, frohmaier c. (cf5g09) wrote:

> Hi Mike,
>
> I’m using PTF data, here is an example image: https://www.dropbox.com/s/yc7lz51ar56a68f/PTF201203051940_2_o_62108_00.w.fits
>
> My steps to reproduce the problem are:
>>>> hdulist=fits.open('PTF201203051940_2_o_62108_00.w.fits')
>>>> worldc=wcs.WCS(hdulist[0].header)
>>>> pixcrd=numpy.array([[536.0,894.0]],numpy.float_)
>>>> cords=worldc.all_pix2world(pixcrd,0)
> ERROR: RuntimeError: NULL error object in wcslib [astropy.wcs.wcs]
>
> Many thanks,
>
> Chris
>
> On 14 Feb 2014, at 20:15, Michael Droettboom <mdroe at stsci.edu> wrote:
>
>> Can you provide a standalone example and data that reproduces the error?
>>
>> This indicates that wcslib set an error flag on an operation but didn't
>> actually set any information about the error.  This really shouldn't
>> happen in normal usage except if there's some latent bug in wcslib or
>> astropy.wcs...  but I'll need to be able to reproduce it to be sure.
>>
>> Mike
>>
>> On 02/14/2014 10:09 AM, frohmaier c. (cf5g09) wrote:
>>> Hi,
>>>
>>> When attempting to run all_pix2world() I get the following error:
>>>
>>> ERROR: RuntimeError: NULL error object in wcslib
>>>
>>> I cannot find any reference to this in the Astropy documentation. Does anyone know how I can resolve this?
>>>
>>> Cheers,
>>> Chris
>>>
>>>
>>>
>>> _______________________________________________
>>> AstroPy mailing list
>>> AstroPy at scipy.org
>>> http://mail.scipy.org/mailman/listinfo/astropy
>> -- 
>>                     _
>> |\/|o _|_  _. _ | | \.__  __|__|_|_  _  _ ._ _
>> |  ||(_| |(_|(/_| |_/|(_)(/_|_ |_|_)(_)(_)| | |
>>
>> http://www.droettboom.com
>>
>> _______________________________________________
>> AstroPy mailing list
>> AstroPy at scipy.org
>> http://mail.scipy.org/mailman/listinfo/astropy

-- 
                    _
|\/|o _|_  _. _ | | \.__  __|__|_|_  _  _ ._ _
|  ||(_| |(_|(/_| |_/|(_)(/_|_ |_|_)(_)(_)| | |

http://www.droettboom.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20140218/eaa3d1d5/attachment.html>


More information about the AstroPy mailing list