Created
May 10, 2018 20:46
-
-
Save cdeil/f6a63f9109a66d8f38056364d2b0ef04 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| In [45]: from astropy.io import fits | |
| ...: from astropy.table import Table | |
| ...: | |
| ...: t1 = Table(dict(a=[1, 2, 3], b=[4, 5, 6], c=[7, 8, 9])) | |
| ...: t1.write('test.fits', overwrite=True) | |
| ...: | |
| ...: with fits.open('test.fits') as hdu_list: | |
| ...: t2 = Table.read(hdu_list[1]) | |
| ...: | |
| ...: | |
| In [46]: for name in t1.colnames: | |
| ...: array = t1[name].data | |
| ...: print(name, array.itemsize, array.strides, array.flags.c_contiguous) | |
| ...: | |
| ...: | |
| a 8 (8,) True | |
| b 8 (8,) True | |
| c 8 (8,) True | |
| In [47]: for name in t2.colnames: | |
| ...: array = t2[name].data | |
| ...: print(name, array.itemsize, array.strides, array.flags.c_contiguous) | |
| ...: | |
| ...: | |
| ...: | |
| a 8 (24,) False | |
| b 8 (24,) False | |
| c 8 (24,) False | |
| In [48]: t = Table.read('https://github.com/gammapy/gammapy-extra/raw/master/datasets/cta-1dc/data/baseline/gps/gps_baseline_110380.fits') | |
| Downloading https://github.com/gammapy/gammapy-extra/raw/master/datasets/cta-1dc/data/baseline/gps/gps_baseline_110380.fits | |
| |========================================================================================================================================| 3.8M/3.8M (100.00%) 2s | |
| WARNING: hdu= was not specified but multiple tables are present, reading in first available table (hdu=1) [astropy.io.fits.connect] | |
| In [49]: for name in t.colnames: | |
| ...: array = t[name].data | |
| ...: print(name, array.itemsize, array.strides, array.flags.c_contiguous) | |
| ...: | |
| ...: | |
| ...: | |
| EVENT_ID 4 (4,) True | |
| TIME 8 (36,) False | |
| RA 4 (36,) False | |
| DEC 4 (36,) False | |
| ENERGY 4 (36,) False | |
| DETX 4 (36,) False | |
| DETY 4 (36,) False | |
| MC_ID 4 (36,) False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment