Changeset 4268 for trunk/doc/pslib/psLibSDRS.tex
- Timestamp:
- Jun 14, 2005, 4:58:05 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/doc/pslib/psLibSDRS.tex (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/psLibSDRS.tex
r4261 r4268 1 %%% $Id: psLibSDRS.tex,v 1.28 8 2005-06-15 01:19:11price Exp $1 %%% $Id: psLibSDRS.tex,v 1.289 2005-06-15 02:58:05 price Exp $ 2 2 \documentclass[panstarrs,spec]{panstarrs} 3 3 … … 3542 3542 \begin{datatype} 3543 3543 typedef struct { 3544 fitsfile fd; 3544 fitsfile fd; // cfitsio structure 3545 bool writable; // Is the file writable? 3545 3546 } psFits; 3546 3547 \end{datatype} 3547 3548 We begin by defining a datatype to wrap the CFITSIO \code{fitsfile} 3548 3549 structure. This is necessary to allow repeated access to the data in 3549 a file without multiple open commands (which are expensive). 3550 a file without multiple open commands (which are expensive). Write 3551 operations are only permitted if \code{writable} is \code{true}. 3550 3552 3551 3553 \subsubsection{FITS File Manipulations} 3552 3554 3553 3555 \begin{prototype} 3554 psFits *psFitsOpen(const char *filename); 3555 \end{prototype} 3556 3557 Opens a FITS file and positions the pointer to the PHU. 3556 psFits *psFitsOpen(const char *filename, const char mode); 3557 \end{prototype} 3558 3559 Opens a FITS file and positions the pointer to the PHU. The file is 3560 opened 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). 3558 3563 3559 3564 \begin{prototype} … … 3587 3592 3588 3593 \begin{prototype} 3594 bool psFitsMoveEnd(psFits *fits); 3595 \end{prototype} 3596 3597 Moves the pointer to the end of the file, so that a new extension may 3598 be written. 3599 3600 \begin{prototype} 3589 3601 int psFitsGetExtNum(const psFits* fits); 3590 3602 \end{prototype} … … 3597 3609 3598 3610 Returns the number of HDUs in the file. 3611 3612 \begin{prototype} 3613 bool psFitsDeleteExtNum(psFits *fits, int extnum, bool relative); 3614 bool psFitsDeleteExtName(psFits *fits, const char *extname); 3615 \end{prototype} 3616 3617 These functions are similar to \code{psFitsMoveExtNum} and 3618 \code{psFitsMoveExtName} except that they delete the specified 3619 extension. The file pointer is left pointing to where the extension 3620 was before deletion. 3621 3622 \begin{prototype} 3623 bool psFitsTruncate(psFits *fits); 3624 \end{prototype} 3625 3626 Deletes all extensions after the position of the file pointer. 3599 3627 3600 3628 \begin{datatype} … … 3652 3680 Write metadata into the header of a FITS image file. The header is 3653 3681 written at the current HDU. 3682 3683 \begin{prototype} 3684 psMetadata *psFitsHeaderFromImage(psMetadata *header, psImage *image, const char *extname); 3685 psMetadata *psFitsHeaderFromTable(psMetadata *header, psArray *table, const char *extname); 3686 \end{prototype} 3687 3688 These functions update the given \code{header} to be compatible with 3689 the 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} 3694 bool psFitsHeaderValidate(psMetadata *header); 3695 \end{prototype} 3696 3697 \code{psFitsHeaderValidate} shall validate the supplied \code{header} 3698 so that it is in compliance to the FITS standard for header keyword 3699 names and types. The contents should be changed to conform to the 3700 FITS standard where possible by truncating names and adding (where 3701 missing) those keywords required by FITS (e.g., \code{SIMPLE}). If 3702 the resulting \code{header} conforms to the FITS standard, the 3703 function shall return \code{true}; otherwise the function shall return 3704 \code{false}. 3654 3705 3655 3706 \subsubsection{FITS Image I/O Functions} … … 3692 3743 3693 3744 \begin{prototype} 3694 bool psFitsWriteImage(psFits *fits, const psMetadata *header, const psImage *input, int depth); 3745 bool psFitsWriteImage(psFits *fits, psMetadata *header, const psImage *input, int depth, 3746 const char *extname); 3695 3747 \end{prototype} 3696 3748 Create a new image based on the dimensions specified for the image and … … 3701 3753 The user is expected to convert the data type as needed with 3702 3754 \code{psImageCopy}. The return value must be 0 for a successful 3703 operation and 1 for an error. 3755 operation and 1 for an error. If \code{extname} is not \code{NULL}, 3756 the \code{EXTNAME} in the \code{header} shall be updated to be 3757 \code{extname} before writing. 3704 3758 3705 3759 \subsubsection{FITS Table I/O Functions}
Note:
See TracChangeset
for help on using the changeset viewer.
