IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 14, 2005, 4:58:05 PM (21 years ago)
Author:
Paul Price
Message:

Updated psFits stuff --- added some functions, and changed some too

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/pslib/psLibSDRS.tex

    r4261 r4268  
    1 %%% $Id: psLibSDRS.tex,v 1.288 2005-06-15 01:19:11 price Exp $
     1%%% $Id: psLibSDRS.tex,v 1.289 2005-06-15 02:58:05 price Exp $
    22\documentclass[panstarrs,spec]{panstarrs}
    33
     
    35423542\begin{datatype}
    35433543typedef struct {
    3544     fitsfile fd;
     3544    fitsfile fd;                   // cfitsio structure
     3545    bool writable;                 // Is the file writable?
    35453546} psFits;
    35463547\end{datatype}
    35473548We begin by defining a datatype to wrap the CFITSIO \code{fitsfile}
    35483549structure.  This is necessary to allow repeated access to the data in
    3549 a file without multiple open commands (which are expensive).
     3550a file without multiple open commands (which are expensive).  Write
     3551operations are only permitted if \code{writable} is \code{true}.
    35503552
    35513553\subsubsection{FITS File Manipulations}
    35523554
    35533555\begin{prototype}
    3554 psFits *psFitsOpen(const char *filename);
    3555 \end{prototype}
    3556 
    3557 Opens a FITS file and positions the pointer to the PHU.
     3556psFits *psFitsOpen(const char *filename, const char mode);
     3557\end{prototype}
     3558
     3559Opens a FITS file and positions the pointer to the PHU.  The file is
     3560opened in the requested \code{mode}, which may be one of \code{r}
     3561(read only) \code{r+} (read and write), \code{rw} (alias for
     3562\code{r+}) or \code{w} (create new file for writing).
    35583563
    35593564\begin{prototype}
     
    35873592
    35883593\begin{prototype}
     3594bool psFitsMoveEnd(psFits *fits);
     3595\end{prototype}
     3596
     3597Moves the pointer to the end of the file, so that a new extension may
     3598be written.
     3599
     3600\begin{prototype}
    35893601int psFitsGetExtNum(const psFits* fits);
    35903602\end{prototype}
     
    35973609
    35983610Returns the number of HDUs in the file.
     3611
     3612\begin{prototype}
     3613bool psFitsDeleteExtNum(psFits *fits, int extnum, bool relative);
     3614bool psFitsDeleteExtName(psFits *fits, const char *extname);
     3615\end{prototype}
     3616
     3617These functions are similar to \code{psFitsMoveExtNum} and
     3618\code{psFitsMoveExtName} except that they delete the specified
     3619extension.  The file pointer is left pointing to where the extension
     3620was before deletion.
     3621
     3622\begin{prototype}
     3623bool psFitsTruncate(psFits *fits);
     3624\end{prototype}
     3625
     3626Deletes all extensions after the position of the file pointer.
    35993627
    36003628\begin{datatype}
     
    36523680Write metadata into the header of a FITS image file.  The header is
    36533681written at the current HDU.
     3682
     3683\begin{prototype}
     3684psMetadata *psFitsHeaderFromImage(psMetadata *header, psImage *image, const char *extname);
     3685psMetadata *psFitsHeaderFromTable(psMetadata *header, psArray *table, const char *extname);
     3686\end{prototype}
     3687
     3688These functions update the given \code{header} to be compatible with
     3689the supplied \code{image} (updating \code{BITPIX, NAXIS1, NAXIS2} or
     3690\code{table} (an array of \code{psMetadata}), and change the
     3691\code{EXTNAME} header to \code{extname}.
     3692
     3693\begin{prototype}
     3694bool psFitsHeaderValidate(psMetadata *header);
     3695\end{prototype}
     3696
     3697\code{psFitsHeaderValidate} shall validate the supplied \code{header}
     3698so that it is in compliance to the FITS standard for header keyword
     3699names and types.  The contents should be changed to conform to the
     3700FITS standard where possible by truncating names and adding (where
     3701missing) those keywords required by FITS (e.g., \code{SIMPLE}).  If
     3702the resulting \code{header} conforms to the FITS standard, the
     3703function shall return \code{true}; otherwise the function shall return
     3704\code{false}.
    36543705
    36553706\subsubsection{FITS Image I/O Functions}
     
    36923743
    36933744\begin{prototype}
    3694 bool psFitsWriteImage(psFits *fits, const psMetadata *header, const psImage *input, int depth);
     3745bool psFitsWriteImage(psFits *fits, psMetadata *header, const psImage *input, int depth,
     3746                      const char *extname);
    36953747\end{prototype}
    36963748Create a new image based on the dimensions specified for the image and
     
    37013753The user is expected to convert the data type as needed with
    37023754\code{psImageCopy}.  The return value must be 0 for a successful
    3703 operation and 1 for an error.
     3755operation and 1 for an error.  If \code{extname} is not \code{NULL},
     3756the \code{EXTNAME} in the \code{header} shall be updated to be
     3757\code{extname} before writing.
    37043758
    37053759\subsubsection{FITS Table I/O Functions}
Note: See TracChangeset for help on using the changeset viewer.