IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 7, 2004, 8:16:09 AM (22 years ago)
Author:
eugene
Message:

added FITS I/O routines, modified existing image/header I/O funcs
added psRectangle

File:
1 edited

Legend:

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

    r1996 r1998  
    1 %%% $Id: psLibSDRS.tex,v 1.127 2004-10-07 03:14:26 price Exp $
     1%%% $Id: psLibSDRS.tex,v 1.128 2004-10-07 18:16:09 eugene Exp $
    22\documentclass[panstarrs,spec]{panstarrs}
    33
     
    27142714\subsubsection{Image I/O Functions}
    27152715
     2716\tbd{this section is being deprecated and the equivalent of these
     2717functions are being moved to FITS I/O Functions.}
     2718
    27162719\begin{verbatim}
    27172720psImage *psImageReadSection(psImage *output, int x0, int y0, int x1, int y1, int z,
     
    37793782the function shall raise an error.
    37803783
     3784\tbd{this function is being deprecated and the equivalent is being
     3785moved to FITS I/O Functions.}
     3786
    37813787\begin{verbatim}
    37823788psMetadata *psMetadataFReadHeader(psMetadata *output, const char *extname,
     
    37863792\code{psMetadata} structure.
    37873793
     3794\tbd{this function is being deprecated and the equivalent is being
     3795moved to FITS I/O Functions.}
    37883796
    37893797\subsubsection{Configuration files}
     
    39023910A BNF-like grammar of the configuration file is contained in
    39033911\S\ref{sec:configgrammar}.
     3912
     3913\subsubsection{FITS Header I/O Functions}
     3914
     3915\begin{verbatim}
     3916psMetadata *psFitsReadHeader(psMetadata *output, const char *extname, int extnum, const char *filename);
     3917psMetadata *psFitsReadHeaderPtr(psMetadata *output, const char *extname, int extnum, const psFits *fd);
     3918\end{verbatim}
     3919Read header data from a FITS image file into a \code{psMetadata}
     3920structure.  The \code{extname} and \code{extnum} parameters specify
     3921the extension of interest as above.  The data is read from the
     3922extension specified by extname (matching the EXTNAME keyword) or by
     3923the extnum value (with 0 representing the primary header unit (PHU), 1
     3924the first extension, etc).  This function must call \code{psError} and
     3925return \code{NULL} if the specified extension does not exist.  If
     3926\code{extname} is not \code{NULL}, \code{extnum} must be set to -1 or
     3927the function shall raise an error.  The file is either specified as a
     3928named file on disk or by an open \code{psFits} file pointer.
     3929
     3930\begin{verbatim}
     3931psHash *psFitsReadHeaderSet (const char *filename);
     3932psHash *psFitsReadHeaderSetPtr (const psFits *fd);
     3933\end{verbatim}
     3934Load a complete set of headers from a named file or \code{psFits} file
     3935pointer.  This function loads the headers from all extensions into a
     3936\code{psHash}, each entry of which is a pointer to a \code{psMetadata}
     3937structure containing the header data.  The hash keys are the
     3938\code{EXTNAME} values for each header (with the value of \code{PHU}
     3939for the primary header unit).
     3940
     3941\subsubsection{FITS Table I/O Functions}
     3942
     3943\begin{verbatim}
     3944void *psFitsReadTableRow (int *nBytes, char *extname, int row, char *filename);
     3945void *psFitsReadTableRowPtr (int *nBytes, char *extname, int row, psFits *fd);
     3946\end{verbatim}
     3947These functions read a single row of the table in the extension
     3948specified by \code{extname}, in the file specified by the given
     3949\code{filename} or \code{psFits} file pointer.  The row number to be
     3950read is given by \code{row}.  The result is returned as collection of
     3951\code{nBytes} bytes allocated by the function.  The function must
     3952apply the needed byte-swapping on the data in the row based on the
     3953description of the table data in the table header.  \tbr{we may need
     3954  to be more flexible here: if we call this function repeatedly, it
     3955  would be more efficient to pass the corresponding header or keep it
     3956  somewhere (and the file pointer location, for that matter).}
     3957
     3958\begin{verbatim}
     3959psArray *psFitsReadTableColumn (char *extname, char *colname, char *filename);
     3960psArray *psFitsReadTableColumnPtr (char *extname, char *colname, psFits *fd);
     3961\end{verbatim}
     3962These functions read a single column of the table in the extension
     3963specified by \code{extname}, in the file specified by the given
     3964\code{filename} or \code{psFits} file pointer.  The column is
     3965specified by the FITS table column key given by \code{row}.  The
     3966result is returned as a \code{psArray}, with one row's worth of data
     3967per array element.
     3968
     3969\begin{verbatim}
     3970psVector *psFitsReadTableColumnNum (char *extname, char *colname, char *filename);
     3971psVector *psFitsReadTableColumnNumPtr (char *extname, char *colname, psFits *fd);
     3972\end{verbatim}
     3973These functions read a single column of the table in the extension
     3974specified by \code{extname}, in the file specified by the given
     3975\code{filename} or \code{psFits} file pointer.  The column is
     3976specified by the FITS table column key given by \code{row}. 
     3977
     3978\begin{verbatim}
     3979psArray *psFitsReadTable (int *nBytes, char *extname, char *filename);
     3980psArray *psFitsReadTablePtr (int *nBytes, char *extname, psFits *fd);
     3981\end{verbatim}
     3982This function reads the entire data block from a table into the a
     3983\code{psArray}, with one element of the array per row.  The number of
     3984bytes per row is returned in \code{nBytes}.  The result is returned as
     3985a \code{psVector}, which, as a numerical data type, is only valid for
     3986numerical table columns.  The function must apply the needed
     3987byte-swapping on the data in each row based on the description of the
     3988table data in the table header.
     3989
     3990\subsection{Rectangles}
     3991
     3992In many places, we need to refer to a rectangular area.  We define a
     3993structure to represent a rectangle:
     3994\begin{verbatim}
     3995typedef struct {
     3996  psS32 x0;
     3997  psS32 x1;
     3998  psS32 y0;
     3999  psS32 y1;
     4000} psRectangleS32;
     4001\end{verbatim}
     4002
     4003\begin{verbatim}
     4004typedef struct {
     4005  psF32 x0;
     4006  psF32 x1;
     4007  psF32 y0;
     4008  psF32 y1;
     4009} psRectangleF32;
     4010psRectangle *psRectangleAlloc (float x0, float x1, float y0, float y1);
     4011\end{verbatim}
     4012
     4013\begin{verbatim}
     4014psRectangle *psRectangleFromString (char *region);
     4015\end{verbatim}
     4016This function converts the IRAF description of a region in the form
     4017\code{[x0,x1:y0,y1]}, used for header entries such as \code{BIASSEC},
     4018into the corresponding \code{psRectangle} structure.
    39044019
    39054020\subsection{Detector and sky positions}
Note: See TracChangeset for help on using the changeset viewer.