저는 python2.5를 실행 중이며 astLib 라이브러리를 사용하여 천문학적 이미지에서 WCS 정보를 분석하려고합니다. 나는 시도하고 다음과 같은 골격 코드를 통해 인스턴스 개체 수 : file.fits 유효한 가리키는 문자열 파일을 맞는 것입니다astWCS를 사용하여 WCS 객체를 만들 때 오류가 발생했습니다.
from astLib import astWCS
w = astWCS.WCS('file.fits') # error here
합니다.
나는 pyfits 헤더 객체를 전달하는 다른 방법을 사용하여 시도하고이 또한 실패 : 내가 ipython에서 실행하면
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/astro/phrfbf/build/lib/python2.6/site-packages/astLib/astWCS.py", line 79, in __init__
self.updateFromHeader()
File "/home/astro/phrfbf/build/lib/python2.6/site-packages/astLib/astWCS.py", line 119, in updateFromHeader
self.WCSStructure=wcs.wcsinit(cardstring)
File "/home/astro/phrfbf/build/lib/python2.6/site-packages/PyWCSTools/wcs.py", line 70, in wcsinit
return _wcs.wcsinit(*args)
TypeError: in method 'wcsinit', argument 1 of type 'char *'
, 내가 얻을 :
import pyfits
from astLib import astWCS
f = pyfits.open('file.fits')
header = f[0].header
f.close()
w = astWCS.WCS(header, mode='pyfits') # error here also
오류이있다 pastebin
나는 astWCS 모듈이 WCStools의 래핑 된 버전이라는 것을 알고 있지만 나머지 코드는 P로 사용하고 싶습니다. ython
누구든지이 문제를 해결할 수 있습니까?
어떤 Python 버전을 사용하고 있습니까? –
첫 줄에 나와있는 @Alok : python2.5. 더 명확하게 2.5.4 –