DarkEnergySurvey / ugali

Ultra-faint galaxy likelihood toolkit
MIT License
14 stars 15 forks source link

Move to fitsio #24

Closed kadrlica closed 3 years ago

kadrlica commented 7 years ago

I've found fitsio to be superior to pyfits. In addition, astropy has taken over pyfits, which is now accessed as astropy.io.fits. I'd like to switch to fitsio, or abstract the interface to the fits reader so the user can use whatever is available on their system (fitsio > astropy.io.fits > pyfits).

kadrlica commented 7 years ago

I did some timing for an issue on healpy and found that fitsio is significantly faster (~4x) for loadinghealpy formatted, gzipped files:

>>> %timeit hp.read_map('tmp.fits.gz',dtype=int,verbose=False)
1 loops, best of 3: 32.7 s per loop

>>> %timeit pyfits.open('tmp.fits.gz')[1].data['I'].ravel()
1 loops, best of 3: 20.6 s per loop

>>> %timeit fitsio.read('tmp.fits.gz',ext=1)['I'].ravel()
1 loops, best of 3: 7.98 s per loop
kadrlica commented 6 years ago

I've implemented a fitsio version of read_map in 353581abb62c3c8fc056750f2562a774a8d99fbf.

kadrlica commented 6 years ago

With the exception of the scratch directory, I think this migration is complete. I'll double check and get this into v1.8.0.

kadrlica commented 3 years ago

Closed by #94