Changeset 2007 for trunk/doc/pslib/psLibSDRS.tex
- Timestamp:
- Oct 7, 2004, 9:55:20 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/doc/pslib/psLibSDRS.tex (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/psLibSDRS.tex
r1998 r2007 1 %%% $Id: psLibSDRS.tex,v 1.12 8 2004-10-07 18:16:09eugene Exp $1 %%% $Id: psLibSDRS.tex,v 1.129 2004-10-07 19:55:20 eugene Exp $ 2 2 \documentclass[panstarrs,spec]{panstarrs} 3 3 … … 1154 1154 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1155 1155 1156 \section{Basic Data Collections}1156 \section{Basic Data Types and Collections} 1157 1157 1158 1158 We require general data containers, so that associated values (e.g.\ … … 2715 2715 2716 2716 \tbd{this section is being deprecated and the equivalent of these 2717 functions are being moved to FITS I/O Functions.} 2717 functions are being moved to FITS I/O Functions. I will leave this 2718 section here until others may read the section on FITS I/O.} 2718 2719 2719 2720 \begin{verbatim} … … 3081 3082 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3082 3083 3083 \subs ubsection{Convolution}3084 \subsection{Convolution} 3084 3085 3085 3086 Convolution will be an essential operation for the IPP. For example, … … 3090 3091 PSF-matching. 3091 3092 3092 \subsubs ubsection{Kernel definition}3093 \subsubsection{Kernel definition} 3093 3094 3094 3095 In order to perform a convolution, we need to define the convolution … … 3140 3141 be exchanged. 3141 3142 3142 \subsubs ubsection{Generation of a convolution kernel}3143 \subsubsection{Generation of a convolution kernel} 3143 3144 3144 3145 Given a list of values (e.g., shifts made in the course of OT … … 3165 3166 function shall continue. 3166 3167 3167 \subsubs ubsection{Convolve an image with the kernel}3168 \subsubsection{Convolve an image with the kernel} 3168 3169 3169 3170 Given an input image and the convolution kernel, … … 3473 3474 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3474 3475 3476 \subsection{Regions} 3477 3478 In many places, we need to refer to a rectangular area. We define a 3479 structure to represent a rectangle: 3480 \begin{verbatim} 3481 typedef struct { 3482 float x0; 3483 float x1; 3484 float y0; 3485 float y1; 3486 } psRegion; 3487 psRegion *psRegionAlloc (float x0, float x1, float y0, float y1); 3488 \end{verbatim} 3489 3490 \begin{verbatim} 3491 psRegion *psRegionFromString (char *region); 3492 \end{verbatim} 3493 This 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}, 3495 into the corresponding \code{psRegion} structure. 3496 3475 3497 \subsection{Metadata} 3476 3498 \label{sec:metadata} … … 3911 3933 \S\ref{sec:configgrammar}. 3912 3934 3935 \subsection{FITS I/O Functions} 3936 3937 We need a variety of I/O functions between the disk and certain of our 3938 PSLib data structures. We need the ability to access FITS headers, 3939 images and tables (both ASCII and Binary). We define here the FITS 3940 I/O functions, all of which are currently specified as wrappers to 3941 functions within CFITSIO. CFITSIO provides a wide range of utilities 3942 which we do not feel are particularly appropriate as part of a generic 3943 I/O library, such as assumptions about names which change the data 3944 interpretation, etc. We are defining our calls to avoid the hidden 3945 'features'. The CFITSIO functions which are wrapped should in general 3946 be the most basic versions. 3947 3948 \begin{verbatim} 3949 typedef struct { 3950 fitsfile fd; 3951 } psFits; 3952 \end{verbatim} 3953 We begin by defining a datatype to wrap the CFITSIO \code{fitsfile} 3954 structure. This is necessary to allow repeated access to the data in 3955 a file without multiple open commands (which are expensive). 3956 3913 3957 \subsubsection{FITS Header I/O Functions} 3914 3958 … … 3939 3983 for the primary header unit). 3940 3984 3985 \begin{verbatim} 3986 bool psFitsWriteHeader(psMetadata *output, const char *filename); 3987 bool psFitsReadHeaderPtr(psMetadata *output, const psFits *fd); 3988 \end{verbatim} 3989 Write metadata into the header of a FITS image file. \tbd{where?} 3990 \tbd{consistency check?} \tbd{function to remove non-FITS header 3991 entries?} The header is written to the end of the given file. 3992 \tbd{Allow for overwriting a specific header? dangerous in anycase: 3993 the header and data must agree for the file to be valid...} 3994 3995 \subsubsection{FITS Image I/O Functions} 3996 3997 \begin{verbatim} 3998 psImage *psFitsReadImageSection(psImage *output, psRegion region, int z, const char *extname, int extnum, const char *filename); 3999 psImage *psFitsReadImageSectionPtr(psImage *output, psRegion region, int z, const char *extname, int extnum, const psFits *fd); 4000 \end{verbatim} 4001 Read an image or subimage from a named file or \code{psFits} file 4002 pointer. This function is a wrapper to the CFITSIO library function. 4003 The input parameters allow a full image or a subimage to be read. The 4004 region to be read is specified by \code{region}. A negative value 4005 for either of \code{region.x1} or \code{region.y1} specifies the 4006 size of the region to be read counting down from the end of the array. 4007 The file pointer version must not make any assumption about the 4008 current position of the file pointer. 4009 4010 If the native image is a cube, the value of z specifies the requested 4011 slice of the image. The data is read from the extension specified by 4012 extname (matching the EXTNAME keyword) or by the extnum value (with 0 4013 representing the primary header unit (PHU), 1 the first extension, 4014 etc). This function must call \code{psError} and return \code{NULL} 4015 if any of the specified parameters are out of range for the data in 4016 the image file, if the specified image file does not exist, or the 4017 image on disk is zero- or one-dimensional. This function need only 4018 read images of the native FITS image types (\code{psU8}, \code{psS16}, 4019 \code{psS32}, \code{psF32}, \code{psF64}). The user is expected to 4020 convert the data type as needed with \code{psImageCopy}. 4021 4022 \begin{verbatim} 4023 bool psFitsWriteImageSection(const psImage *input, int x, int y, int z, const char *extname, int extnum, const char *filename); 4024 bool psFitsWriteImageSectionPtr(const psImage *input, int x, int y, int z, const char *extname, int extnum, const psFits *fd); 4025 \end{verbatim} 4026 Write 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 4028 image over the existing bytes of an existing image. If the file does 4029 not exist, it should be created. If the specified extension does not 4030 exist, it should be created. If an extension is specified and no PHU 4031 exists, a basic PHU should be created. Care must be taken to 4032 interpret x,y,z in the two cases a) there is already an existing image 4033 and b) there is not an existing image. If the image exists, write the 4034 complete psImage data to the existing image starting at the coordinate 4035 x,y,z. If any of these parameters implies writing pixels outside the 4036 existing data area of the image, return an error (ie, if \code{x + 4037 image.nx >= NAXIS1}, \code{y + image.ny >= NAXIS2}, or \code{z >= 4038 NAXIS3}). If the image does not exist, require x,y,z to be zero. 4039 This function will only write images of the native FITS image types 4040 (\code{psU8}, \code{psS16}, \code{psS32}, \code{psF32}, \code{psF64}). 4041 The user is expected to convert the data type as needed with 4042 \code{psImageCopy}. The return value must be 0 for a successful 4043 operation and 1 for an error. 4044 4045 \tbd{versions of these functions which do not construct the header, 4046 but instead use a corresponding metadata structure, need to exist}. 4047 3941 4048 \subsubsection{FITS Table I/O Functions} 3942 4049 … … 3988 4095 table data in the table header. 3989 4096 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} 4021 4100 4022 4101 Both detector and sky positions will be used extensively in the IPP.
Note:
See TracChangeset
for help on using the changeset viewer.
