File: test.py

package info (click to toggle)
python-fitsio 0.9.10%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 580 kB
  • ctags: 452
  • sloc: python: 3,493; ansic: 2,917; makefile: 10
file content (17 lines) | stat: -rw-r--r-- 445 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import fitsio
from astropy.table import Table
import numpy as np

print('Reading X column test')
filename = 'test_x.fits'
data, header = fitsio.read(filename, header=True)
print(data.dtype)

print('Writing test')
filename = 'test_write.fits'
t = Table([[1], [2], [3]], dtype=[np.bool, np.uint8, np.int8]).as_array()  # 'b1', 'u1', 'i1'
fitsio.write(filename, t)

data, header = fitsio.read(filename, header=True)
print(header)
print(data.dtype)