Changeset 4245
- Timestamp:
- Jun 13, 2005, 5:29:12 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/doc/pslib/psLibSDRS.tex (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/psLibSDRS.tex
r4244 r4245 1 %%% $Id: psLibSDRS.tex,v 1.27 7 2005-06-14 03:07:19price Exp $1 %%% $Id: psLibSDRS.tex,v 1.278 2005-06-14 03:29:12 price Exp $ 2 2 \documentclass[panstarrs,spec]{panstarrs} 3 3 … … 1369 1369 \code{p_psError}. The \code{code} is an enumerated type which lists 1370 1370 the possible \textit{classes} of errors (e.g. \code{PS_ERR_IO}) that 1371 \PS{} code can generate (see section \ref{psErrorCodes}). The1371 \PS{} code can generate (see section~\ref{psErrorCodes}). The 1372 1372 \code{new} argument takes a boolean which, if \code{true} specifies 1373 1373 that the error was set initially at this location, and if \code{false} … … 1686 1686 1687 1687 All data items placed onto lists must have their reference counters 1688 (section \ref{secMemRefcounter}) incremented. When elements are1688 (section~\ref{secMemRefcounter}) incremented. When elements are 1689 1689 removed from a list, they must have their reference counters 1690 1690 decremented. The action of retrieving data from a list (with one of … … 2913 2913 } psMath; 2914 2914 \end{datatype} 2915 2916 \tbd{Why do we need this? Can't we use psMathType instead?} 2915 2917 2916 2918 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% … … 2984 2986 In this structure, the argument \code{n} is the length of the array 2985 2987 (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: 2988 allocated (\code{nalloc} $\ge$ \code{n}). The allocated memory is 2989 available in the union \code{data} which consists of pointers to each 2990 of the defined primitive data types. Note the parallelism in the 2991 names of the types, union elements, and the \code{psElemType} names. 2992 This parallelism allows us to use automatic construction mechanisms 2993 effectively. The data type is defined by the first element, 2994 \code{psMathType}. The structure is associated with a constructor and 2995 reallocator: 2993 2996 % 2994 2997 \begin{prototype} … … 3020 3023 \end{prototype} 3021 3024 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. 3025 This function increments \code{psVector.n} (the number of elements in 3026 the vector) by \code{nExtend}. If the current length of the vector 3027 plus {\em twice} the number of new elements (\code{nExtend}) is 3028 greater than the allocated space, an additional \code{delta} elements 3029 are allocated. If the value of \code{delta} is less than 1, 10 shall 3030 be used. 3027 3031 3028 3032 Here is an example of how \code{psVectorExtend} is used to … … 3030 3034 \begin{verbatim} 3031 3035 // create data vector 3032 psVector *y = psVectorAlloc (100);3036 psVector *y = psVectorAlloc(100); 3033 3037 y->n = 0; 3034 3038 for (int i = 0; i < 1000; i++) { … … 3036 3040 y->data.F32[y->n + 1] = 2*i; 3037 3041 y->data.F32[y->n + 2] = 2*i; 3038 psVectorExtend (y, 100, 3);3039 // increments n by 1, extends length if needed by 1003042 y = psVectorExtend (y, 100, 3); 3043 // increments n by 3, extends length by 100 if needed 3040 3044 } 3041 3045 \end{verbatim} … … 3092 3096 psC32 **C32; ///< Pointers to complex floating-point data 3093 3097 psC64 **C64; ///< Pointers to complex floating-point data 3098 psPtr V; ///< Pointers to raw data 3094 3099 } data; 3095 3100 const struct psImage *parent; ///< parent, if a subimage … … 3102 3107 pixels. The size of this array is given by the elements 3103 3108 \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 theparent image while \code{row0} is the starting row number. The3109 the \code{psMathType type} entry (specifically, the \code{psElemType} 3110 member, \code{type}; see \S\ref{sec:arithmetic}). (N.B.\ that for 3111 FITS images, these values are restricted to the datatypes equivalent 3112 to the valid BITPIX values 8, 16, 32, -32, -64). The image 3113 represented in the data structure may represent a subset of the pixels 3114 in a complete array, in which case the image is considered to be the 3115 child of that parent array. The offset of the \code{(0,0)} pixel in 3116 this array relative to the parent array is given by the elements 3117 \code{(col0,row0)}: \code{col0} is the starting column number in the 3118 parent image while \code{row0} is the starting row number. The 3114 3119 structure may include references to subrasters (\code{children}) 3115 3120 and/or to a containing array (\code{parent}). Unless this image is a 3116 3121 child 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}. 3122 image), the image data is allocated in a contiguous block 3123 (\code{data.V}). 3124 3125 \subsubsection{Support Functions} 3126 3127 We define the following supporting functions for images, which are 3128 valid for data types \code{psS8, psS16, psU8, psU16, psF32, psF64, 3129 psC32, psC64}. 3120 3130 3121 3131 \begin{prototype} … … 3126 3136 types and not restrict to the valid FITS BITPIX types. The image 3127 3137 dimensionality must be 2. 3128 3129 \subsubsection{Support Functions}3130 3138 3131 3139 \begin{prototype} … … 3176 3184 We define two functions to set and return the value of a 3177 3185 \code{psRegion}. The first defines the region by the corner 3178 coordinates. The second function converts the IRAF description of a3179 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 thecorresponding IRAF description.3186 coordinates. The second function converts the IRAF description region 3187 in the form \code{[x0:x1,y0:y1]}, used for header entries such as 3188 \code{BIASSEC}, into the corresponding \code{psRegion} structure (any 3189 values that do not parse correctly shall be returned as \code{NaN}). 3190 We also define a function that converts a \code{psRegion} to the 3191 corresponding IRAF description. 3184 3192 3185 3193 \begin{prototype}
Note:
See TracChangeset
for help on using the changeset viewer.
