Astro-Py list
Andrew Williams
andrew at physics.uwa.edu.au
Thu Feb 24 03:25:38 CST 2000
This list has been quiet since I joined - is there actually anyone out
there?
I'm at Perth Observatory in Western Australia, using Python for data
reduction scripts, and to control an Apogee AP7 camera, through pipes
to a low-level driver ('Ariel') written by staff at Ohio State
University. The only code likely to be useful elsewhere is a FITS file
class that reads and parses header cards into a dictionary, so you can
do stuff like:
import fits
f=fits.FITSfile('/path/test.fits','h')
et=float(f.headers['EXPTIME'])
print 'Exptime=',et,' and comment was:',f.comments['EXPTIME']
print 'All history cards for ',f.filename,':'
print f.comments['HISTORY']
Not fancy - no error checking yet to see if the file actually _is_ in
FITS format, for example - but it's only 50 lines of python. So far it
only handles 'h' mode, to parse headers and leave the file closed. I
was planning to add 'r' and 'w' as for normal file classes when I need
to actually get at the data. I also don't want to spend too much time
duplicating something that's already been written.
The code is at: http://www.physics.uwa.edu.au/~andrew/
Andrew Williams
--
Dr Andrew Williams andrew at physics.uwa.edu.au
Perth Observatory, andrew at ucc.gu.uwa.edu.au
Walnut rd, Bickley, Western Australia. andrewW at cyllene.uwa.edu.au
More information about the AstroPy
mailing list