[AstroPy] Draft specification for PyFITS functional interface

Peter Erwin erwin at iac.es
Wed Mar 30 17:14:42 EST 2005


At 3:08 PM -0500 3/30/05, <laidler at stsci.edu> wrote:
>I agree with Peter - to my mind, one of the strengths of
>Python is that it supports both functional and object-oriented
>programming, so that it's easy and painless to switch back and
>forth or mix them as the need arises. In an interactive
>session, I might be very likely to use the functional routines
>as long as things are going as I expect, and then want to
>switch to the OO ones for cases where things are going wrong
>and I need more direct control of the file's innards.

Well, obviously, I agree with this ;-)

It's actually what I was going to add, but you beat me to it -- one
of the things that makes Python so useful is its flexibility and *lack*
of forced adherence to a particular programming style.  Complaints
that it would be "polluting" the pyfits interface make no sense to me,
I'm afraid.  (My personal perspective is that it would make pyfits
*more useful* and easier to start using; I've been slightly leery of
digging into pyfits because an object-oriented approach seems
slightly excessive for the things I usually want to do with FITS files.)
Many of the Python standard libraries are similarly "unclean", and
more useful because of it.

As for the ".fits[1]" issue -- I'd find it somewhat convenient to be
able to use that syntax, but it's not a big issue for me.  So if you're
looking for votes on:

At 3:42 PM -0500 3/30/05, Perry Greenfield wrote:
>Which is worse:
>oo-only pyfits and iraf/cfitsio-convention-contaminated xxxfits?
>oo+functional pyfits and  iraf/cfitsio-convention-contaminated xxxfits?

then my votes is that the *first* in that list is worse...

    -- Peter

-- 
=============================================================
Peter Erwin                   Instituto de Astrofisica de Canarias
erwin at iac.es                  C/ Via Lactea s/n
tel. +34 922 605 238          38200 La Laguna, Tenerife, Spain
fax  +34 922 605 210          http://www.iac.es/galeria/erwin



More information about the AstroPy mailing list