IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 2007


Ignore:
Timestamp:
Oct 7, 2004, 9:55:20 AM (22 years ago)
Author:
eugene
Message:

moved back some things around which I moved earlier (coordinates)

File:
1 edited

Legend:

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

    r1998 r2007  
    1 %%% $Id: psLibSDRS.tex,v 1.128 2004-10-07 18:16:09 eugene Exp $
     1%%% $Id: psLibSDRS.tex,v 1.129 2004-10-07 19:55:20 eugene Exp $
    22\documentclass[panstarrs,spec]{panstarrs}
    33
     
    11541154%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    11551155
    1156 \section{Basic Data Collections}
     1156\section{Basic Data Types and Collections}
    11571157
    11581158We require general data containers, so that associated values (e.g.\
     
    27152715
    27162716\tbd{this section is being deprecated and the equivalent of these
    2717 functions are being moved to FITS I/O Functions.}
     2717functions are being moved to FITS I/O Functions.  I will leave this
     2718section here until others may read the section on FITS I/O.}
    27182719
    27192720\begin{verbatim}
     
    30813082%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    30823083
    3083 \subsubsection{Convolution}
     3084\subsection{Convolution}
    30843085
    30853086Convolution will be an essential operation for the IPP.  For example,
     
    30903091PSF-matching.
    30913092
    3092 \subsubsubsection{Kernel definition}
     3093\subsubsection{Kernel definition}
    30933094
    30943095In order to perform a convolution, we need to define the convolution
     
    31403141be exchanged.
    31413142
    3142 \subsubsubsection{Generation of a convolution kernel}
     3143\subsubsection{Generation of a convolution kernel}
    31433144
    31443145Given a list of values (e.g., shifts made in the course of OT
     
    31653166function shall continue.
    31663167
    3167 \subsubsubsection{Convolve an image with the kernel}
     3168\subsubsection{Convolve an image with the kernel}
    31683169
    31693170Given an input image and the convolution kernel,
     
    34733474%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    34743475
     3476\subsection{Regions}
     3477
     3478In many places, we need to refer to a rectangular area.  We define a
     3479structure to represent a rectangle:
     3480\begin{verbatim}
     3481typedef struct {
     3482  float x0;
     3483  float x1;
     3484  float y0;
     3485  float y1;
     3486} psRegion;
     3487psRegion *psRegionAlloc (float x0, float x1, float y0, float y1);
     3488\end{verbatim}
     3489
     3490\begin{verbatim}
     3491psRegion *psRegionFromString (char *region);
     3492\end{verbatim}
     3493This function converts the IRAF description of a region in the form
     3494\code{[x0,x1:y0,y1]}, used for header entries such as \code{BIASSEC},
     3495into the corresponding \code{psRegion} structure.
     3496
    34753497\subsection{Metadata}
    34763498\label{sec:metadata}
     
    39113933\S\ref{sec:configgrammar}.
    39123934
     3935\subsection{FITS I/O Functions}
     3936
     3937We need a variety of I/O functions between the disk and certain of our
     3938PSLib data structures.  We need the ability to access FITS headers,
     3939images and tables (both ASCII and Binary).  We define here the FITS
     3940I/O functions, all of which are currently specified as wrappers to
     3941functions within CFITSIO.  CFITSIO provides a wide range of utilities
     3942which we do not feel are particularly appropriate as part of a generic
     3943I/O library, such as assumptions about names which change the data
     3944interpretation, etc.  We are defining our calls to avoid the hidden
     3945'features'.  The CFITSIO functions which are wrapped should in general
     3946be the most basic versions.
     3947
     3948\begin{verbatim}
     3949typedef struct {
     3950    fitsfile fd;
     3951} psFits;
     3952\end{verbatim}
     3953We begin by defining a datatype to wrap the CFITSIO \code{fitsfile}
     3954structure.  This is necessary to allow repeated access to the data in
     3955a file without multiple open commands (which are expensive).
     3956
    39133957\subsubsection{FITS Header I/O Functions}
    39143958
     
    39393983for the primary header unit).
    39403984
     3985\begin{verbatim}
     3986bool psFitsWriteHeader(psMetadata *output, const char *filename);
     3987bool psFitsReadHeaderPtr(psMetadata *output, const psFits *fd);
     3988\end{verbatim}
     3989Write metadata into the header of a FITS image file.  \tbd{where?}
     3990\tbd{consistency check?}  \tbd{function to remove non-FITS header
     3991entries?}  The header is written to the end of the given file.
     3992\tbd{Allow for overwriting a specific header? dangerous in anycase:
     3993the header and data must agree for the file to be valid...}
     3994
     3995\subsubsection{FITS Image I/O Functions}
     3996
     3997\begin{verbatim}
     3998psImage *psFitsReadImageSection(psImage *output, psRegion region, int z, const char *extname, int extnum, const char *filename);
     3999psImage *psFitsReadImageSectionPtr(psImage *output, psRegion region, int z, const char *extname, int extnum, const psFits *fd);
     4000\end{verbatim}
     4001Read an image or subimage from a named file or \code{psFits} file
     4002pointer.  This function is a wrapper to the CFITSIO library function.
     4003The input parameters allow a full image or a subimage to be read.  The
     4004region to be read is specified by \code{region}.  A negative value
     4005for either of \code{region.x1} or \code{region.y1} specifies the
     4006size of the region to be read counting down from the end of the array.
     4007The file pointer version must not make any assumption about the
     4008current position of the file pointer.
     4009
     4010If the native image is a cube, the value of z specifies the requested
     4011slice of the image.  The data is read from the extension specified by
     4012extname (matching the EXTNAME keyword) or by the extnum value (with 0
     4013representing the primary header unit (PHU), 1 the first extension,
     4014etc).  This function must call \code{psError} and return \code{NULL}
     4015if any of the specified parameters are out of range for the data in
     4016the image file, if the specified image file does not exist, or the
     4017image on disk is zero- or one-dimensional.  This function need only
     4018read images of the native FITS image types (\code{psU8}, \code{psS16},
     4019\code{psS32}, \code{psF32}, \code{psF64}).  The user is expected to
     4020convert the data type as needed with \code{psImageCopy}. 
     4021 
     4022\begin{verbatim}
     4023bool psFitsWriteImageSection(const psImage *input, int x, int y, int z, const char *extname, int extnum, const char *filename);
     4024bool psFitsWriteImageSectionPtr(const psImage *input, int x, int y, int z, const char *extname, int extnum, const psFits *fd);
     4025\end{verbatim}
     4026Write an image section to the named file (which may exist) or open
     4027\code{psFits} file pointer.  This operation may write a portion of an
     4028image over the existing bytes of an existing image.  If the file does
     4029not exist, it should be created.  If the specified extension does not
     4030exist, it should be created.  If an extension is specified and no PHU
     4031exists, a basic PHU should be created.  Care must be taken to
     4032interpret x,y,z in the two cases a) there is already an existing image
     4033and b) there is not an existing image.  If the image exists, write the
     4034complete psImage data to the existing image starting at the coordinate
     4035x,y,z.  If any of these parameters implies writing pixels outside the
     4036existing data area of the image, return an error (ie, if \code{x +
     4037image.nx >= NAXIS1}, \code{y + image.ny >= NAXIS2}, or \code{z >=
     4038NAXIS3}).  If the image does not exist, require x,y,z to be zero.
     4039This function will only write images of the native FITS image types
     4040(\code{psU8}, \code{psS16}, \code{psS32}, \code{psF32}, \code{psF64}).
     4041The user is expected to convert the data type as needed with
     4042\code{psImageCopy}.  The return value must be 0 for a successful
     4043operation and 1 for an error.
     4044
     4045\tbd{versions of these functions which do not construct the header,
     4046but instead use a corresponding metadata structure, need to exist}.
     4047
    39414048\subsubsection{FITS Table I/O Functions}
    39424049
     
    39884095table data in the table header.
    39894096
    3990 \subsection{Rectangles}
    3991 
    3992 In many places, we need to refer to a rectangular area.  We define a
    3993 structure to represent a rectangle:
    3994 \begin{verbatim}
    3995 typedef struct {
    3996   psS32 x0;
    3997   psS32 x1;
    3998   psS32 y0;
    3999   psS32 y1;
    4000 } psRectangleS32;
    4001 \end{verbatim}
    4002 
    4003 \begin{verbatim}
    4004 typedef struct {
    4005   psF32 x0;
    4006   psF32 x1;
    4007   psF32 y0;
    4008   psF32 y1;
    4009 } psRectangleF32;
    4010 psRectangle *psRectangleAlloc (float x0, float x1, float y0, float y1);
    4011 \end{verbatim}
    4012 
    4013 \begin{verbatim}
    4014 psRectangle *psRectangleFromString (char *region);
    4015 \end{verbatim}
    4016 This 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},
    4018 into the corresponding \code{psRectangle} structure.
    4019 
    4020 \subsection{Detector and sky positions}
     4097\tbd{need to have corresponding table write functions...}
     4098
     4099\subsection{Detector and Sky Coordinates}
    40214100
    40224101Both detector and sky positions will be used extensively in the IPP.
Note: See TracChangeset for help on using the changeset viewer.