Changeset 2337 for trunk/doc/pslib/psLibSDRS.tex
- Timestamp:
- Nov 10, 2004, 6:03:24 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/doc/pslib/psLibSDRS.tex (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/psLibSDRS.tex
r2314 r2337 1 %%% $Id: psLibSDRS.tex,v 1.14 7 2004-11-09 03:45:07price Exp $1 %%% $Id: psLibSDRS.tex,v 1.148 2004-11-11 04:03:24 price Exp $ 2 2 \documentclass[panstarrs,spec]{panstarrs} 3 3 … … 849 849 of the code is compiled. This can be implemented via macro front-ends 850 850 to private versions of the user APIs. In addition, a function 851 \code{ voidpsTraceReset(void)} will set all trace levels to 0.851 \code{bool psTraceReset(void)} will set all trace levels to 0. 852 852 853 853 … … 931 931 % 932 932 \begin{verbatim} 933 voidpsLogSetFormat(const char *fmt);933 bool psLogSetFormat(const char *fmt); 934 934 \end{verbatim} 935 935 % … … 1452 1452 psListElem *tail; ///< last element on list (may be NULL) 1453 1453 unsigned int nIter; ///< number of iterators 1454 ps ListIterator **iter; ///<iteration cursors1454 psArray *iter; ///< array of psListIterator: iteration cursors 1455 1455 pthread_mutex_t lock; ///< mutex to lock a node during changes 1456 1456 } psList; … … 2319 2319 \subsubsection{Levenberg-Marquardt} 2320 2320 2321 Consider a function of a collection of parameters, \code{params}, and 2322 (possibly several) coordinate vectors (which we represent as an array 2323 of vectors), \code{coord}, which returns a single floating point value 2324 which is the value of the function given the parameters and coordinate 2325 vectors, along with the derivatives of the function with respect to 2326 each of the parameters: 2327 \begin{verbatim} 2328 typedef float (*psMinimizeLMFunc)(psVector *deriv, const psVector *params, const psArray *coords); 2329 \end{verbatim} 2330 An example may help here. We say that the coordinate vectors may be 2331 several (and hence use a \code{psArray} for \code{coords}), since 2332 often one will want to minimize $\chi^2$, given a data set consisting 2333 of vectors for $x$, $y$ and $\sigma_y$. 2334 2335 Then \code{psMinimizeLM} shall mimimize the specified function, 2336 \code{func}, using the Levenberg-Marquardt method: 2337 2338 \begin{verbatim} 2339 bool psMinimizeLM(psMinimization *min, psImage *covar, psVector *params, const psVector *paramMask, 2340 const psArray *coords, psMinimizeLMFunc func); 2321 Consider a function of a collection of parameters, \code{params}, 2322 which is evaluated at a position, \code{x}, which returns a single 2323 floating point value which is the value of the function given the 2324 parameters and coordinate vectors, along with the derivatives of the 2325 function with respect to each of the parameters, \code{deriv}: 2326 \begin{verbatim} 2327 typedef float (*psMinimizeLMChi2Func)(psVector *deriv, const psVector *params, const psVector *x); 2328 \end{verbatim} 2329 2330 Then \code{psMinimizeLMChi2} shall fit the specified function, 2331 \code{func}, to a set of measurements, \code{x,y,yErr}, using the 2332 Levenberg-Marquardt method: 2333 2334 \begin{verbatim} 2335 bool psMinimizeLMChi2(psMinimization *min, psImage *covar, psVector *params, 2336 const psVector *paramMask, const psArray *x, const psVector *y, 2337 const psVector *yErr, psMinimizeLMChi2Func func); 2341 2338 \end{verbatim} 2342 2339 … … 2348 2345 the values appropriate from the minimization. 2349 2346 2350 On calling the minimizer, \code{params} shall consist of a ``best2351 guess'' for the parameters that minimize the inputfunction,2347 On calling the minimizer, the \code{params} vector shall consist of a 2348 ``best guess'' for the parameters that minimize the model function, 2352 2349 \code{func}. On successful completion, the input parameters, 2353 2350 \code{params}, shall be updated with the values that minimize the 2354 2351 input function. The function shall also update the covariance matrix, 2355 2352 \code{covar}, in the event that it is non-\code{NULL}. The function 2356 shall generate in error in the event that \code{covar} is not a square 2357 matrix with size matching that of \code{params}. 2353 shall generate in error in the event that \code{covar} is 2354 non-\code{NULL} and is not a square matrix with size matching that of 2355 \code{params}. 2358 2356 2359 2357 Parameters that have a corresponding \code{paramMask} entry of … … 2361 2359 for \code{paramMask} not to be of the same dimension as \code{params}. 2362 2360 2363 The \code{coords} are not handled by the minimizer, except to be 2364 passed to the function as additional input, and it is the 2365 responsibility of the function to interpret these. 2361 The measurement ordinates, \code{x}, shall consist of multiple 2362 vectors, each of which may be passed to the model \code{func}. If the 2363 measurement coordinates, \code{y}, and errors, \code{yErr}, are not of 2364 the same length as the ordinates array, \code{x}, then the function 2365 shall generate a warning, and truncate the longest of the 2366 array/vectors to match the length of the shortest. The vectors 2367 contained within the \code{x} array, and the \code{y} and \code{yErr} 2368 vectors must be of type \code{psF32}. The \code{yErr} vector may be 2369 \code{NULL}, in which case the errors shall be assumed to be 2370 identical. 2366 2371 2367 2372 \code{paramMask} must be of type \code{psU8}, while \code{params} must … … 2375 2380 2376 2381 \begin{verbatim} 2377 psMinimizeLMFunc psMinimizeLMChi2Gauss1D; 2378 psMinimizeLMFunc psMinimizeLMChi2Gauss2D; 2379 \end{verbatim} 2380 2381 \code{psMinimizeChi2LMGauss1D} shall take, as \code{params}, the 2382 normalization, center, and standard deviation of a Gaussian to be fit 2383 to the data. The data in the \code{coords} shall consist of vectors 2384 for each of \code{x}, \code{y}, and \code{yErr}. If the \code{yErr} 2385 is missing, or \code{NULL}, then the errors shall be taken to be 2386 unity, for the purpose of fitting where the errors are all identical 2387 (and possibly unknown). If the \code{x}, \code{y} or \code{yErr} (if 2388 supplied) vectors are of differing lengths, the function shall 2389 generate a warning and truncate the lengths to match the shortest. 2390 2391 \code{psMinimizeLMChi2Gauss1D} shall return the $\chi^2$ value for the 2392 specified Gaussian as a model for the supplied data, along with the 2393 derivatives of the $\chi^2$ with respect to each of the parameters. 2382 psMinimizeLMChi2Func psMinimizeLMChi2Gauss1D; 2383 psMinimizeLMChi2Func psMinimizeLMChi2Gauss2D; 2384 \end{verbatim} 2385 2386 \code{psMinimizeChi2LMGauss1D} shall take as \code{params}, the 2387 normalization, center, and standard deviation of a Gaussian to be fit, 2388 and as \code{x}, a vector containing a single value. It shall return 2389 the value of the Gaussian at the value, and the derivatives 2390 (\code{deriv}) with respect to each of the parameters. 2394 2391 2395 2392 \code{psMinimizeChi2LMGauss2D} shall take, as \code{params}, the 2396 2393 normalization, center (two values), standard deviation (two values) 2397 and position angle of a 2-dimensional Gaussian to be fit to the data. 2398 The data in the \code{coords} shall consist of vectors for each of 2399 \code{x}, \code{y}, \code{z} and \code{zErr}. If the \code{zErr} is 2400 missing, or \code{NULL}, then the errors shall be taken to be unity, 2401 for the purpose of fitting where the errors are all identical (and 2402 possibly unknown). If the \code{x}, \code{y}, \code{z} or \code{zErr} 2403 (if supplied) vectors are of differing lengths, the function shall 2404 generate a warning and truncate the lengths to match the shortest. 2405 2406 \code{psMinimizeLMChi2Gauss2D} shall return the $\chi^2$ value for the 2407 specified Gaussian as a model for the supplied data, along with the 2408 derivatives of the $\chi^2$ with respect to each of the parameters. 2394 and position angle of a 2-dimensional Gaussian, and as \code{x}, a 2395 vector containing a position, $(x,y)$. It shall return the value of 2396 the 2-dimensional Gaussian at the specified point, along with the 2397 derivatives with respect to each of the parameters. 2409 2398 2410 2399 \subsubsection{Powell} … … 2688 2677 \code{mask} is non-\code{NULL}, pixels for which the corresponding 2689 2678 \code{mask} pixel matches \code{maskVal} are excluded from operations. 2690 This function must be defined for the following types: \code{psU8}, 2691 \code{psU16}, \code{psS8}, \code{psS16}, \code{psF32}, \code{psF64}, 2692 \code{psC32}, \code{psC64}. 2679 This function must be defined for the following types: \code{psS8}, 2680 \code{psU16}, \code{psF32} and \code{psF64}. 2693 2681 2694 2682 \begin{verbatim} … … 3154 3142 \end{verbatim} 3155 3143 3156 The output from a FFT and power spectrum must be of the same size as 3157 the input. In the future, if this adversely affects performance, this 3158 will be revised so that the redundant information will be neglected. 3144 The output from a FFT must be of the same size as the input, and the 3145 size of the power spectrum equal to $N/2 + 1$, where $N$ is the number 3146 of elements in the input. In the future, if this adversely affects 3147 performance, this will be revised so that the redundant information 3148 will be neglected. 3159 3149 3160 3150 In analogy with the vector FFT operations, we also define matching … … 3251 3241 3252 3242 If the vectors are not all of the same number of elements, then the 3253 function shall generate a warning shall be generated, following which, 3254 the longer vector trimmed to the length of the shorter, and the 3255 function shall continue. 3243 function shall generate an error and return \code{NULL}. 3256 3244 3257 3245 \subsubsection{Convolve an image with the kernel} … … 3889 3877 which follows the conventions of the \code{psList} iterators. 3890 3878 \begin{verbatim} 3891 voidpsMetadataSetIterator(psMetadata *md, int iterator, int location);3879 bool psMetadataSetIterator(psMetadata *md, int iterator, int location); 3892 3880 psMetadataItem *psMetadataGetNext(psMetadata *md, const char *match, int iterator); 3893 3881 psMetadataItem *psMetadataGetPrevious(psMetadata *md, const char *match, int iterator); … … 3903 3891 data type, printing is not allowed. 3904 3892 \begin{verbatim} 3905 voidpsMetadataItemPrint(FILE *fd, const char *format, const psMetadataItem *md);3893 bool psMetadataItemPrint(FILE *fd, const char *format, const psMetadataItem *md); 3906 3894 \end{verbatim} 3907 3895
Note:
See TracChangeset
for help on using the changeset viewer.
