私はpython2.5を実行していて、astLibライブラリを使用して天文画像のWCS情報を分析しようとしています。次のスケルトンコードでオブジェクトをインスタンス化しようとします。
from astLib import astWCS
w = astWCS.WCS('file.fits') # error here
ここで、file.fitsは、有効なフィットファイルを指す文字列です。
pyfitsヘッダーオブジェクトを渡す別の方法を使用しようとしましたが、これも失敗します。
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
エラーは次のとおりです。
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 *'
ipythonで実行すると、pastebinで完全なエラーが発生します
astWCSモジュールがラップされたバージョンのWCStoolsであることは知っていますが、残りのコードはPythonであるため、Pythonモジュールを使用したいと思います。
誰かがこの問題を手伝うことができますか?