IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4245


Ignore:
Timestamp:
Jun 13, 2005, 5:29:12 PM (21 years ago)
Author:
Paul Price
Message:

Small edits.

File:
1 edited

Legend:

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

    r4244 r4245  
    1 %%% $Id: psLibSDRS.tex,v 1.277 2005-06-14 03:07:19 price Exp $
     1%%% $Id: psLibSDRS.tex,v 1.278 2005-06-14 03:29:12 price Exp $
    22\documentclass[panstarrs,spec]{panstarrs}
    33
     
    13691369\code{p_psError}.  The \code{code} is an enumerated type which lists
    13701370the possible \textit{classes} of errors (e.g. \code{PS_ERR_IO}) that
    1371 \PS{} code can generate (see section \ref{psErrorCodes}). The
     1371\PS{} code can generate (see section~\ref{psErrorCodes}). The
    13721372\code{new} argument takes a boolean which, if \code{true} specifies
    13731373that the error was set initially at this location, and if \code{false}
     
    16861686
    16871687All data items placed onto lists must have their reference counters
    1688 (section \ref{secMemRefcounter}) incremented.  When elements are
     1688(section~\ref{secMemRefcounter}) incremented.  When elements are
    16891689removed from a list, they must have their reference counters
    16901690decremented.  The action of retrieving data from a list (with one of
     
    29132913} psMath;
    29142914\end{datatype}
     2915
     2916\tbd{Why do we need this?  Can't we use psMathType instead?}
    29152917
    29162918%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
    29842986In this structure, the argument \code{n} is the length of the array
    29852987(the number of elements); \code{nalloc} is the number of elements
    2986 allocated ($nalloc \ge n$).  The allocated memory is available in the
    2987 union \code{data} which consists of pointers to each of the defined
    2988 primitive data types.  Note the parallelism in the names of the types,
    2989 union elements, and the \code{psElemType} names.  This parallelism
    2990 allows us to use automatic construction mechanisms effectively.  The
    2991 data type is defined by the first element, \code{psMathType}.  The
    2992 structure is associated with a constructor and reallocator:
     2988allocated (\code{nalloc} $\ge$ \code{n}).  The allocated memory is
     2989available in the union \code{data} which consists of pointers to each
     2990of the defined primitive data types.  Note the parallelism in the
     2991names of the types, union elements, and the \code{psElemType} names.
     2992This parallelism allows us to use automatic construction mechanisms
     2993effectively.  The data type is defined by the first element,
     2994\code{psMathType}.  The structure is associated with a constructor and
     2995reallocator:
    29932996%
    29942997\begin{prototype}
     
    30203023\end{prototype}
    30213024
    3022 This function increments \code{psVector.n}, the number of elements in
    3023 the vector by \code{nExtend}.  If the current length of the vector
    3024 plus {\em twice} the number of new elements is greater than the
    3025 allocated space, an additional \code{delta} elements are allocated.
    3026 If the value of \code{delta} is less than 1, 10 shall be used. 
     3025This function increments \code{psVector.n} (the number of elements in
     3026the vector) by \code{nExtend}.  If the current length of the vector
     3027plus {\em twice} the number of new elements (\code{nExtend}) is
     3028greater than the allocated space, an additional \code{delta} elements
     3029are allocated.  If the value of \code{delta} is less than 1, 10 shall
     3030be used.
    30273031
    30283032Here is an example of how \code{psVectorExtend} is used to
     
    30303034\begin{verbatim}
    30313035  // create data vector
    3032   psVector *y = psVectorAlloc (100);
     3036  psVector *y = psVectorAlloc(100);
    30333037  y->n = 0;
    30343038  for (int i = 0; i < 1000; i++) {
     
    30363040    y->data.F32[y->n + 1] = 2*i;
    30373041    y->data.F32[y->n + 2] = 2*i;
    3038     psVectorExtend (y, 100, 3);
    3039     // increments n by 1, extends length if needed by 100
     3042    y = psVectorExtend (y, 100, 3);
     3043    // increments n by 3, extends length by 100 if needed
    30403044  }
    30413045\end{verbatim}
     
    30923096        psC32 **C32;                    ///< Pointers to complex floating-point data
    30933097        psC64 **C64;                    ///< Pointers to complex floating-point data
     3098        psPtr V;                        ///< Pointers to raw data
    30943099    } data;
    30953100    const struct psImage *parent;       ///< parent, if a subimage
     
    31023107pixels.  The size of this array is given by the elements
    31033108\code{(numRows, numCols)}.  The data type of the pixel is defined in
    3104 the \code{psMathType type} entry (specifically, the
    3105 \code{psElemType} member, \code{type}; see \ref{sec:arithmetic}).
    3106 (n.b. that for FITS images, these values are restricted to the
    3107 datatypes equivalent to the valid BITPIX values 8, 16, 32, -32, -64).
    3108 The image represented in the data structure may represent a subset of
    3109 the pixels in a complete array, in which case the image is considered
    3110 to be the child of that parent array.  The offset of the \code{(0,0)}
    3111 pixel in this array relative to the parent array is given by the
    3112 elements \code{(col0,row0)}: \code{col0} is the starting column number
    3113 in the parent image while \code{row0} is the starting row number.  The
     3109the \code{psMathType type} entry (specifically, the \code{psElemType}
     3110member, \code{type}; see \S\ref{sec:arithmetic}).  (N.B.\ that for
     3111FITS images, these values are restricted to the datatypes equivalent
     3112to the valid BITPIX values 8, 16, 32, -32, -64).  The image
     3113represented in the data structure may represent a subset of the pixels
     3114in a complete array, in which case the image is considered to be the
     3115child of that parent array.  The offset of the \code{(0,0)} pixel in
     3116this array relative to the parent array is given by the elements
     3117\code{(col0,row0)}: \code{col0} is the starting column number in the
     3118parent image while \code{row0} is the starting row number.  The
    31143119structure may include references to subrasters (\code{children})
    31153120and/or to a containing array (\code{parent}).  Unless this image is a
    31163121child of another image (represents a subset of the pixels of another
    3117 image), the image data is allocated in a contiguous block.  We define
    3118 the following supporting functions, which are valid for data types
    3119 \code{psS8, psS16, psU8, psU16, psF32, psF64, psC32, psC64}.
     3122image), the image data is allocated in a contiguous block
     3123(\code{data.V}).
     3124
     3125\subsubsection{Support Functions}
     3126
     3127We define the following supporting functions for images, which are
     3128valid for data types \code{psS8, psS16, psU8, psU16, psF32, psF64,
     3129psC32, psC64}.
    31203130
    31213131\begin{prototype}
     
    31263136types and not restrict to the valid FITS BITPIX types.  The image
    31273137dimensionality must be 2. 
    3128 
    3129 \subsubsection{Support Functions}
    31303138
    31313139\begin{prototype}
     
    31763184We define two functions to set and return the value of a
    31773185\code{psRegion}.  The first defines the region by the corner
    3178 coordinates.  The second function converts the IRAF description of a
    3179 region in the form \code{[x0:x1,y0:y1]}, used for header entries such
    3180 as \code{BIASSEC}, into the corresponding \code{psRegion} structure
    3181 (any values that do not parse correctly shall be returned as
    3182 \code{NaN}).  We also define a function that converts a
    3183 \code{psRegion} to the corresponding IRAF description.
     3186coordinates.  The second function converts the IRAF description region
     3187in the form \code{[x0:x1,y0:y1]}, used for header entries such as
     3188\code{BIASSEC}, into the corresponding \code{psRegion} structure (any
     3189values that do not parse correctly shall be returned as \code{NaN}).
     3190We also define a function that converts a \code{psRegion} to the
     3191corresponding IRAF description.
    31843192
    31853193\begin{prototype}
Note: See TracChangeset for help on using the changeset viewer.