IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 1, 2005, 5:49:53 PM (21 years ago)
Author:
Paul Price
Message:

Fixed psFits bugs.

File:
1 edited

Legend:

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

    r5457 r5459  
    1 %%% $Id: psLibSDRS.tex,v 1.351 2005-11-02 03:03:44 price Exp $
     1%%% $Id: psLibSDRS.tex,v 1.352 2005-11-02 03:49:53 price Exp $
    22\documentclass[panstarrs,spec]{panstarrs}
    33
     
    38923892
    38933893\begin{prototype}
    3894 psFits *psFitsOpen(const char *filename, const char mode);
     3894psFits *psFitsOpen(const char *filename, const char *mode);
    38953895\end{prototype}
    38963896
     
    39003900\code{r+}) or \code{w} (create new file for writing).
    39013901
    3902 \begin{prototype}
    3903 psFits *psFitsOpenFD(int fd);
    3904 \end{prototype}
    3905 
    3906 Opens a file descriptor and positions the pointer to the PHU.
    3907 
    3908 \begin{prototype}
    3909 psFits *psFitsOpenStream(FILE *stream);
    3910 \end{prototype}
    3911 
    3912 Opens a stream and positions the pointer to the PHU.
     3902%%%%
     3903%%%% psFitsOpenFD and psFitsOpenStream probably can't be implemented
     3904%%%% using cfitsio without creating temporary files.
     3905%%%%
     3906%% \begin{prototype}
     3907%% psFits *psFitsOpenFD(int fd);
     3908%% \end{prototype}
     3909%% Opens a file descriptor and positions the pointer to the PHU.
     3910%% \begin{prototype}
     3911%% psFits *psFitsOpenStream(FILE *stream);
     3912%% \end{prototype}
     3913%% Opens a stream and positions the pointer to the PHU.
    39133914
    39143915\begin{prototype}
     
    39363937
    39373938\begin{prototype}
    3938 bool psFitsMoveEnd(psFits *fits);
    3939 \end{prototype}
    3940 
    3941 Moves the pointer to the end of the file, so that a new extension may
    3942 be written.
     3939bool psFitsMoveLast(psFits *fits);
     3940\end{prototype}
     3941
     3942Moves the pointer to the last extension in the file.
    39433943
    39443944\begin{prototype}
     
    40704070 
    40714071\begin{prototype}
    4072 bool psFitsUpdateImage(psFits *fits, const psImage *input, psRegion region, int z);
     4072bool psFitsUpdateImage(psFits *fits, const psImage *input, int x0, int y0, int z);
    40734073\end{prototype}
    40744074Write an image section to the open \code{psFits} file pointer.  This
    40754075operation may write a portion of an image over the existing bytes of
    4076 an existing image.  Care must be taken to interpret \code{region},
    4077 which specified the output pixels to be written / over-written.  If
    4078 the combination of \code{region} and the size of \code{psImage *input}
    4079 implies writing pixels outside the existing data area of the image,
    4080 the function shall return an error (ie, if \code{region.x0 + image.nx
    4081 >= NAXIS1}, \code{region.y0 + image.ny >= NAXIS2}, or \code{z >=
    4082 NAXIS3}).  This function will only write images of the native FITS
    4083 image types (\code{psU8}, \code{psS16}, \code{psS32}, \code{psF32},
    4084 \code{psF64}).  The user is expected to convert the data type as
    4085 needed with \code{psImageCopy}.  The return value must be 0 for a
    4086 successful operation and 1 for an error.  \tbd{is region in the frame
    4087 of input or of disk image?  how do image coordinates relate to disk
    4088 image coords?}
     4076an existing image, starting at \code{x0,y0} in the \code{fits} image.
     4077Note that the origin of the \code{input} must be (0,0), not that of
     4078any parent (i.e., \code{input->col0,input->row0)}).  Care must be
     4079taken to interpret region which specifies the output pixels to be
     4080written / over-written.  If the combination of \code{x0,y0} and the
     4081size of \code{psImage *input} implies writing pixels outside the
     4082existing data area of the image, the function shall return an error
     4083(ie, if \code{x0 + image.nx >= NAXIS1}, \code{y0 + image.ny >=
     4084NAXIS2}, or \code{z >= NAXIS3}).  This function will only write images
     4085of the native FITS image types (\code{psU8}, \code{psS16},
     4086\code{psS32}, \code{psF32}, \code{psF64}).  The user is expected to
     4087convert the data type as needed with \code{psImageCopy}.  The return
     4088value must be 0 for a successful operation and 1 for an error.
    40894089
    40904090\begin{prototype}
     
    40944094Create a new image based on the dimensions specified for the image and
    40954095the requested depth.  The header and image data segments are written
    4096 in the file at the current position of the \code{psFits} pointer.
    4097 This function will only write images of the native FITS image types
    4098 (\code{psU8}, \code{psS16}, \code{psS32}, \code{psF32}, \code{psF64}).
    4099 The user is expected to convert the data type as needed with
    4100 \code{psImageCopy}.  The return value must be 0 for a successful
    4101 operation and 1 for an error.  If \code{extname} is not \code{NULL},
    4102 the \code{EXTNAME} in the \code{header} shall be updated to be
    4103 \code{extname} before writing.
     4096at the end of the file.  This function will only write images of the
     4097native FITS image types (\code{psU8}, \code{psS16}, \code{psS32},
     4098\code{psF32}, \code{psF64}).  The user is expected to convert the data
     4099type as needed with \code{psImageCopy}.  The return value must be 0
     4100for a successful operation and 1 for an error.  If \code{extname} is
     4101not \code{NULL}, the \code{EXTNAME} in the \code{header} shall be
     4102updated to be \code{extname} before writing.
     4103
     4104\begin{prototype}
     4105bool psFitsInsertImage(psFits *fits, psMetadata *header, const psImage *input, int depth,
     4106                       const char *extname, bool after);
     4107\end{prototype}
     4108
     4109\code{psFitsInsertImage} behaves in the same manner as
     4110\code{psFitsWriteImage}, except that the extension is inserted
     4111according to the value of the boolean \code{after}.  If \code{after}
     4112is \code{true}, then the extension is inserted after the current
     4113\code{psFits} pointer; otherwise the extension is inserted before the
     4114current \code{psFits} pointer.  \textbf{The user should beware that
     4115this is potentially a very expensive operation in terms of time, since
     4116the entire file following the inserted extension must be rewritten.}
    41044117
    41054118\subsubsection{FITS Table I/O Functions}
     
    41714184bool psFitsWriteTable(psFits* fits, const psMetadata *header, const psArray* table);
    41724185\end{prototype}
    4173 Accepts a \code{psArray} of \code{psMetadata} and writes it to the
    4174 current HDU.  If the current HDU is not a table type, this will fail
    4175 and return FALSE.
     4186Accepts a \code{psArray} of \code{psMetadata} and writes it to the end
     4187of the file.
    41764188
    41774189\begin{prototype}
     
    41814193in the current HDU.  If the current HDU is not a table type, this will
    41824194fail and return FALSE. 
     4195
     4196\begin{prototype}
     4197bool psFitsInsertTable(psFits *fits, const psMetadata *header, const psArray* table,
     4198                       bool after);
     4199\end{prototype}
     4200
     4201\code{psFitsInsertTable} behaves in the same manner as
     4202\code{psFitsWriteTable}, except that the extension is inserted
     4203according to the value of the boolean \code{after}.  If \code{after}
     4204is \code{true}, then the extension is inserted after the current
     4205\code{psFits} pointer; otherwise the extension is inserted before the
     4206current \code{psFits} pointer.  \textbf{The user should beware that
     4207this is potentially a very expensive operation in terms of time, since
     4208the entire file following the inserted extension must be rewritten.}
    41834209
    41844210%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracChangeset for help on using the changeset viewer.