Changeset 362
- Timestamp:
- Mar 31, 2004, 11:14:20 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/doc/pslib/psLibSDRS.tex (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/psLibSDRS.tex
r361 r362 1 %%% $Id: psLibSDRS.tex,v 1.2 3 2004-04-01 08:54:37 price Exp $1 %%% $Id: psLibSDRS.tex,v 1.24 2004-04-01 09:14:20 eugene Exp $ 2 2 \documentclass[panstarrs]{panstarrs} 3 3 … … 1949 1949 specified by \code{psStats *stats}. 1950 1950 \begin{verbatim} 1951 psFloatArray *psImageSlice(psFloatArray *out, psImage *input, int x, int y, int nx, int ny, int direction, const psStats *stats); 1951 psFloatArray *psImageSlice(psFloatArray *out, psImage *input, 1952 int x, int y, int nx, int ny, 1953 int direction, const psStats *stats); 1952 1954 \end{verbatim} 1953 1955 … … 1962 1964 specified by \code{psStats stats}. 1963 1965 \begin{verbatim} 1964 psFloatArray *psImageCut(psFloatArray *out, psImage *input, float xs, float ys, float xe, float ye, float dw, const psStats *stats); 1966 psFloatArray *psImageCut(psFloatArray *out, psImage *input, 1967 float xs, float ys, float xe, float ye, float dw, 1968 const psStats *stats); 1965 1969 \end{verbatim} 1966 1970 … … 1973 1977 stats} 1974 1978 \begin{verbatim} 1975 psFloatArray *psImageRadialCut(psFloatArray *out, psImage *input, float x, float y, float radius, float dr, psStats *stats); 1979 psFloatArray *psImageRadialCut(psFloatArray *out, psImage *input, 1980 float x, float y, float radius, float dr, 1981 psStats *stats); 1976 1982 \end{verbatim} 1977 1983 … … 1980 1986 Rebin image to new scale. A new image is constructed in which the 1981 1987 dimensions are reduced by a factor of \code{scale} $\le 1$ (it is an 1982 error for \code{scale} $> 1$). The output image represents a 1983 one-to-one mapping of the pixels in the input image, except for edge 1984 effects. Each pixel in the output image is derived from the 1985 statistics of the corresponding input image pixels based on the 1986 statistics specified by \code{psStats stats}. \tbd{interpolation?} 1987 \begin{verbatim} 1988 psImage * 1989 psImageRebin(psImage *out, ///< Image to output, or NULL 1990 const psImage *input, ///< rebin this image 1991 float scale, ///< rebinning scale: doutput = scale*dinput 1992 const psStats *stats ///< defines statistics used to find output values 1993 ); 1988 error for \code{scale} $> 1$). The output image is generated from all 1989 input image pixels. Each pixel in the output image is derived from 1990 the statistics of the corresponding set of input image pixels based on 1991 the statistics specified by \code{psStats stats}. 1992 \begin{verbatim} 1993 psImage *psImageRebin(psImage *out, psImage *input, float scale, psStats *stats); 1994 1994 \end{verbatim} 1995 1995 … … 1997 1997 output image must contain all of the pixels from the input image in 1998 1998 their new frame. Pixels in the output image which do not map to input 1999 pixels should be set of\tbd{value}. The center of rotation is always1999 pixels should be set to \tbd{value}. The center of rotation is always 2000 2000 the center pixel of the image. The rotation is specified in the sense 2001 2001 that a positive angle is an anti-clockwise rotation. 2002 2002 \begin{verbatim} 2003 psImage * 2004 psImageRotate(psImage *out, ///< Image to output, or NULL 2005 const psImage *input, ///< rotate this image 2006 float angle ///< rotate by this amount anti-clockwise (degrees) 2007 ); 2003 psImage *psImageRotate(psImage *out, psImage *input, float angle); 2008 2004 \end{verbatim} 2009 2005 … … 2015 2011 set to the value given by \code{exposed}. 2016 2012 \begin{verbatim} 2017 psImage * 2018 psImageShift(psImage *out, ///< Image to output, or NULL 2019 const psImage *input, ///< shift this image 2020 float dx, ///< shift by this amount in x 2021 float dy, ///< shift by this amount in y 2022 float exposed ///< set exposed pixels to this value 2023 ); 2024 \end{verbatim} 2025 2026 Roll image by an integer number of pixels in either direction. The 2027 output image is the same dimensions as the input image. Edge pixels 2028 wrap to the other side (no values are lost). 2029 \begin{verbatim} 2030 psImage * 2031 psImageRoll(psImage *out, ///< Image to output, or NULL 2032 const psImage *input, ///< roll this image 2033 int dx, ///< roll this amount in x 2034 int dy ///< roll this amount in y 2035 ); 2013 psImage *psImageShift(psImage *out, psImage *input, float dx, float dy, float exposed); 2014 \end{verbatim} 2015 2016 Roll image by an integer number of pixels (\code{dx,dy}) in either 2017 direction. The output image is the same dimensions as the input 2018 image. Edge pixels wrap to the other side (no values are lost). 2019 \begin{verbatim} 2020 psImage *psImageRoll(psImage *out, psImage *input, int dx, int dy); 2036 2021 \end{verbatim} 2037 2022 … … 2041 2026 determined are specified by \code{psStats stats}. 2042 2027 \begin{verbatim} 2043 psStats * 2044 psImageGetStats(const psImage *input, ///< image (or subimage) to calculate stats 2045 psStats *stats ///< defines statistics to be calculated & target 2046 ); 2028 psStats *psImageGetStats(psImage *input, psStats *stats); 2047 2029 \end{verbatim} 2048 2030 2049 2031 Construct a histogram from an image (or subimage). The histogram to 2050 generate is specified by \code{psHistogram hist}. 2051 \begin{verbatim} 2052 psHistogram * 2053 psImageHistogram(psHistogram *hist, ///< input histogram description & target 2054 const psImage *input ///< determine histogram of this image 2055 ); 2056 \end{verbatim} 2057 2058 Fit a 2-D polynomial surface to an image. The input structure 2059 \code{coeffs} contains the desired order and terms of interest. 2060 \tbd{how do we specify the renormalization?} 2061 \begin{verbatim} 2062 psPolynomial2D * 2063 psImageFitPolynomial(const psImage *input, ///< image to fit 2064 psPolynomial2D *coeffs ///< coefficient structure carries in desired terms & target 2065 ); 2066 \end{verbatim} 2067 2068 Evaluate a 2-D polynomial surface to image pixels. Given the input 2069 polynomial coefficients, return an image generated on the basis of the 2070 input image pixels which evaluates the polynomial for all pixels in 2071 the image.a 2072 \begin{verbatim} 2073 int 2074 psImageEvalPolynomial(const psImage *input, ///< image to fit 2075 const psPolynomial2D *coeffs ///< coefficient structure carries in desired terms 2076 ); 2032 generate is specified by \code{psHistogram hist} (see 2033 section~\ref{histogram}). 2034 \begin{verbatim} 2035 psHistogram *psImageHistogram(psHistogram *hist, psImage *input); 2036 \end{verbatim} 2037 2038 Fit a 2-D Chebychev polynomial surface to an image. The input 2039 structure \code{coeffs} contains the desired order and terms of 2040 interest. 2041 \begin{verbatim} 2042 psPolynomial2D *psImageFitPolynomial(psImage *input, psPolynomial2D *coeffs); 2043 \end{verbatim} 2044 2045 Evaluate a 2-D polynomial surface for the image pixels. Given the 2046 input polynomial coefficients, set the image pixel values on the basis 2047 of the polynomial function. \tbd{return value?} 2048 \begin{verbatim} 2049 int psImageEvalPolynomial(psImage *input, psPolynomial2D *coeffs); 2077 2050 \end{verbatim} 2078 2051 … … 2087 2060 native image is a cube, the value of z specifies the requested slice 2088 2061 of the image. The data is read from the extension specified by 2089 extname (matching the EXTNAME keyword) or by the extnum value (with -12090 representing the PHU, 0the first extension, etc). This function must2062 extname (matching the EXTNAME keyword) or by the extnum value (with 0 2063 representing the PHU, 1 the first extension, etc). This function must 2091 2064 generate an error and return \code{NULL} if any of the specified 2092 2065 parameters are out of range for the data in the image file, if the … … 2094 2067 one-dimensional. 2095 2068 \begin{verbatim} 2096 psImage * 2097 psImageReadSection(psImage *output, ///< place data in this structure for output 2098 int x, ///< starting x coord of region 2099 int y, ///< starting y coord of region 2100 int nx, ///< x size of region (-1 for full range) 2101 int ny, ///< y size of region (-1 for full range) 2102 int z, ///< plane of interest 2103 const char *extname, ///< MEF extension name ("PHU" for primary header) 2104 int extnum, ///< MEF extension number (-1 for "PHU", 0 : Nextend - 1) 2105 const char *filename ///< file to read data from 2106 ); 2069 psImage *psImageReadSection(psImage *output, 2070 int x, int y, int nx, int ny, int z, 2071 char *extname, int extnum, char *filename); 2107 2072 \end{verbatim} 2108 2073 … … 2112 2077 \begin{verbatim} 2113 2078 psImage * 2114 psImageFReadSection(psImage *output, ///< place data in this structure for output 2115 int x, ///< starting x coord of region 2116 int y, ///< starting y coord of region 2117 int dx, ///< x size of region (-1 for full range) 2118 int dy, ///< y size of region (-1 for full range) 2119 int z, ///< plane of interest 2120 const char *extname, ///< MEF extension name ("PHU" for primary header) 2121 int extnum, ///< MEF extension number (-1 for "PHU", 0 : Nextend - 1) 2122 FILE *f ///< file descriptor to read data from 2123 ); 2124 \end{verbatim} 2125 2126 \TBD{The use of \code{FILE*} to carry around the file descriptor is to be reviewed.} 2127 2128 Write an image section to named file, which may exist. This 2079 psImageFReadSection(psImage *output, 2080 int x, int y, int nx, int ny, int z, 2081 char *extname, int extnum, FILE *f); 2082 \end{verbatim} 2083 \tbd{The use of \code{FILE*} to carry around the file descriptor is to be reviewed.} 2084 2085 Write an image section to the named file, which may exist. This 2129 2086 operation may write a portion of an image over the existing bytes of 2130 2087 an existing image. If the file does not exist, it should be created. 2131 2088 If the specified extension does not exist, it should be created. If 2132 2089 an extension is specified and no PHU exists, a basic PHU should be 2133 created. 2134 \begin{verbatim} 2135 psImage * 2136 psImageWriteSection(psImage *input, ///< image to write out 2137 int x, ///< starting x coord of region 2138 int y, ///< starting y coord of region 2139 int z, ///< plane of interest 2140 const char *extname, ///< MEF extension name ("PHU" for primary header) 2141 int extnum, ///< MEF extension number (-1 for "PHU", 0 : Nextend - 1) 2142 const char *filename ///< file to write data to 2143 ); 2144 \end{verbatim} 2145 2146 Write an image section to file descriptor. 2147 \begin{verbatim} 2148 psImage * 2149 psImageFWriteSection(psImage *input, ///< image to write out 2150 int x, ///< starting x coord of region 2151 int y, ///< starting y coord of region 2152 int z, ///< plane of interest 2153 const char *extname, ///< MEF extension name 2154 int extnum, ///< MEF extension number (-1 for "PHU", 0 : Nextend - 1) 2155 FILE *f ///< file descriptor to write data to 2156 ); 2157 \end{verbatim} 2158 2159 \TBD{The use of \code{FILE*} to carry around the file descriptor is to be reviewed.} 2090 created. 2091 \begin{verbatim} 2092 psImage *psImageWriteSection(psImage *input, 2093 int x, int y, int z, 2094 char *extname, int extnum, char *filename); 2095 \end{verbatim} 2096 2097 Write an image section to file descriptor as above: 2098 \begin{verbatim} 2099 psImage *psImageFWriteSection(psImage *input, 2100 int x, int y, int z, 2101 char *extname, int extnum, FILE *f); 2102 \end{verbatim} 2103 \tbd{The use of \code{FILE*} to carry around the file descriptor is to be reviewed.} 2160 2104 2161 2105 Read header data from a FITS image file into a \code{psMetaData} 2162 structure. If the named extension does not exist, the function should 2163 return an error. 2164 \begin{verbatim} 2165 psMetadata * 2166 psImageReadHeader(psMetadata *output, ///< read data to this structure 2167 const char *extname, ///< MEF extension name ("PHU" for primary header) 2168 int extnum, ///< MEF extension number (-1 for "PHU", 0 : Nextend - 1) 2169 const char *filename ///< file to read from 2170 ); 2106 structure (see section~\ref{metadata}. The \code{extname} and 2107 \code{extnum} parameters specify the extension of interest as above. 2108 If the named extension does not exist, the function should return an 2109 error. 2110 \begin{verbatim} 2111 psMetadata *psImageReadHeader(psMetadata *output, char *extname, int extnum, char *filename); 2171 2112 \end{verbatim} 2172 2113 … … 2174 2115 structure. 2175 2116 \begin{verbatim} 2176 psMetadata * 2177 psImageFReadHeader(psMetadata *output, ///< read data to this structure 2178 const char *extname, ///< MEF extension name ("PHU" for primary header) 2179 int extnum, ///< MEF extension number (-1 for "PHU", 0 : Nextend - 1) 2180 FILE *f ///< file descriptor to read from 2181 ); 2117 psMetadata *psImageFReadHeader(psMetadata *output, char *extname, int extnum, FILE *f); 2182 2118 \end{verbatim} 2183 2119 2184 2120 \subsubsection{Image Pixel Manipulations} 2185 2121 2186 Perform a 2-D FFT on the specified image. The returned image is of2187 type \code{psComplex}.2188 \begin{verbatim}2189 psImage *2190 psImageFFT(psImage *output, ///< Output image2191 const psImage *input, ///< image to FFT2192 int direction ///< FFT direction2193 );2194 \end{verbatim}2195 2196 2122 Clip image values outside of range to given values. All pixels with 2197 values $<$ min are set to the value vmin. All pixels with values $>$ 2198 max are set to the value vmax. 2199 \begin{verbatim} 2200 int 2201 psImageClip(psImage *input, ///< clip this image 2202 float min, ///< clip pixels with values < min 2203 float vmin, ///< set min-clipped pixels to vmin 2204 float max, ///< clip pixels with values > max 2205 float vmax ///< set max-clipped pixels to vmax 2206 ); 2207 \end{verbatim} 2208 2209 Clip NaN image pixels to given value. Pixels with NaN, +Inf or -Inf 2210 values are set to the specified value. Returns the number of clipped 2211 pixels. 2212 \begin{verbatim} 2213 int 2214 psImageClipNaN(psImage *input, ///< clip this image & target 2215 float value ///< set nan pixels to this value 2216 ); 2123 values \code{< min} are set to the value \code{vmin}. All pixels with 2124 values \code{> max} are set to the value \code{vmax}. Returns the 2125 number of clipped pixels. 2126 \begin{verbatim} 2127 int psImageClip(psImage *input, float min, float vmin, float max, float vmax); 2128 \end{verbatim} 2129 2130 Clip \code{NaN} image pixels to given value. Pixels with \code{NaN}, 2131 \code{+Inf} or \code{-Inf} values are set to the specified value. 2132 Returns the number of clipped pixels. 2133 \begin{verbatim} 2134 int psImageClipNaN(psImage *input, float value); 2217 2135 \end{verbatim} 2218 2136 … … 2220 2138 the \code{image} which correspond to the pixels in \code{overlay} with 2221 2139 values derived from the values in \code{image} and \code{overlay} 2222 based on the given operator. Valid operators are ``='' (set image 2223 value to overlay value), ``+'' (add overlay value to image value), 2224 ``-'' (subtract overlay from image), ``*'' (multiply overlay times 2225 image), ``/'' (divide image by overlay). 2226 \begin{verbatim} 2227 int 2228 psImageOverlaySection(psImage *image, ///< input image & target 2229 const psImage *overlay, ///< image to overlay 2230 int x0, ///< x offset of overlay subimage 2231 int y0, ///< y offset of overlay subimage 2232 const char *operator ///< overlay operation 2233 ); 2140 based on the given operator \code{op}. Valid operators are \code{=} 2141 (set image value to overlay value), \code{+} (add overlay value to 2142 image value), \code{-} (subtract overlay from image), \code{*} 2143 (multiply overlay times image), \code{/} (divide image by overlay). 2144 \begin{verbatim} 2145 int psImageOverlaySection(psImage *image, psImage *overlay, int x0, int y0, char *op); 2234 2146 \end{verbatim} 2235 2147
Note:
See TracChangeset
for help on using the changeset viewer.
