[AstroPy] Module suggestions?
Barrett at stsci.edu
Tue Aug 24 14:59:06 EDT 1999
ptak at snooker.phys.cmu.edu wrote:
> I would like to see a pure-Python FITS header keyword reading module. The
> last time I checked, PyFITS used some C code. Some problems I am
> interested in only require the values of some keywords (like the total
> number of counts, often in TOTCTS), and full-fledged fits i/o is overkill.
I am rather surprised by this request, since most of PyFITS is
_written_ in Python, namely the Header class. The C code that is
associated with PyFITS is for the data part of the header-data unit,
namely the Numeric module for images and the Record module for binary
tables. As far as I am aware, there is no efficient and easy way to
access binary table data using a pure-Python implementation.
I hope to have a new and more useable version of PyFITS out before the
ADASS meeting. This version uses lazy instantiation of the data
attribute, that is, initially, it only reads the header, skipping the
data. Only when data are requested, are they read.
In any case, you may want to go back to the PyFITS module and extract
that Python code which you find useful, for example the Header class.
Though I hate to admit it, this code has not changed much for more
than a year. It's the rest of the code that I've been struggling
with, mainly because of reasons of efficiency.
Norbert Pirzkal writes:
> I have a working read/write pure python header access code if you are
> interested. I am planning to release a pure python version that handles
> fits images within a few weeks. The header stuff is running already and
> is being tested right now. Let me know if you want to have an early look
> at what I have...
I'd be interested to see your code. I'm hoping we can manage to keep
some of our code in the two implementations the same. If not, then
maybe I can steal some of your good ideas.
AstroPy mailing list - astropy at stsci.edu
More information about the AstroPy