[AstroPy] Draft specification for PyFITS functional interface

Phil Hodge hodge at stsci.edu
Wed Mar 30 14:22:07 EST 2005


>  Reading: getdata, getheader, getval
>  getdata returns a numarray (image extension) or recarray(table
>  extension) object by default; if the keyword argument 'header' is
>  specified with a value other than None, it returns a (data,header)
>  tuple. .
                                                                               
 
If the syntax header=x is allowed, what would that mean?
I would suggest header=False (or 0) for the default, and
header=True (or non-zero) to indicate the header should be
included.
                                                                               
 
What does getval return if the keyword is HISTORY, COMMENT or ""
and there are multiple such keywords in the header?  (I presume
it returns the first one, but this should be specified.)
                                                                               
 
I think the specifications should list all the functions
and their calling sequences together in one section.  I didn't
see any calling sequences except in examples.
                                                                               
 
>  Overwriting an existing file:
>  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  writeto will raise an exception if the specified filename already
>  exists.

Could update() be used to append a new extension to an existing
file?  Does writeto() have an argument to specify whether the
header/data should be written to the primary or first extension
(when the data block is an array)?
                                                                                

>  Pure PyFITS will not handle inheritance of keywords.
                                                                                

Good!
                                                                                

Phil




More information about the AstroPy mailing list