3

astropy.table を使用して単純なテーブルを読み取りたい。行の最初の要素は長整数です。「OverflowError: Python int が大きすぎて C long に変換できません」というエラー メッセージが表示されて失敗します。どうすればこれを回避できますか?

詳細:

テーブルは test.cat にあります。それは非常に単純で、1 行です: 81421100001 2 1 1 37.5991 1.0213 785.364 539.291

私が使用するコードは次のとおりです。

import numpy as np
from astropy.table import Table

catalog_filename = 'test.cat'

t = Table.read(catalog_filename, format='ascii')

次のエラーが表示されます。

Traceback (most recent call last):
  File "catread.py", line 15, in <module>
    t = Table.read(catalog_filename, format='ascii')
  File "/usr/local/lib/python2.7/dist-packages/astropy/table/table.py", line 2561, in read
    return io_registry.read(cls, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/astropy/io/registry.py", line 319, in read
    table = reader(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/astropy/io/ascii/connect.py", line 18, in read_asciitable
    return read(filename, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/astropy/io/ascii/ui.py", line 154, in read
    dat = _guess(table, new_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/astropy/io/ascii/ui.py", line 196, in _guess
    dat = reader.read(table)
  File "/usr/local/lib/python2.7/dist-packages/astropy/io/ascii/core.py", line 872, in read
    table = self.outputter(cols, self.meta)
  File "/usr/local/lib/python2.7/dist-packages/astropy/io/ascii/core.py", line 670, in __call__
    self._convert_vals(cols)
  File "/usr/local/lib/python2.7/dist-packages/astropy/io/ascii/core.py", line 652, in _convert_vals
    col.data = converter_func(col.str_vals)
  File "/usr/local/lib/python2.7/dist-packages/astropy/io/ascii/core.py", line 611, in converter
    return numpy.array(vals, numpy_type)
OverflowError: Python int too large to convert to C long
4

1 に答える 1