Skip to content

Instantly share code, notes, and snippets.

@boada
Created July 13, 2015 22:16
Show Gist options
  • Save boada/a147ba91ce38c6e47747 to your computer and use it in GitHub Desktop.
Save boada/a147ba91ce38c6e47747 to your computer and use it in GitHub Desktop.
from glob import glob
from astropy import table
import h5py as hdf
from os.path import exists
files = glob('*.fit')
for f in files[:2]:
print f, '.....',
if not exists(f.replace('fit', 'hdf5')):
t =table.Table.read(f, 'r')
t.write(f.replace('.fit', '.hdf5'),
path=f.split('_')[1]+'_'+f.split('.')[1])
print 'done'
else:
print 'already done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment