Changeset 1113 for trunk/doc/modules/ModulesSDRS.tex
- Timestamp:
- Jun 28, 2004, 3:44:33 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/doc/modules/ModulesSDRS.tex (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/modules/ModulesSDRS.tex
r1110 r1113 1 %%% $Id: ModulesSDRS.tex,v 1. 4 2004-06-26 03:42:48price Exp $1 %%% $Id: ModulesSDRS.tex,v 1.5 2004-06-29 01:44:23 price Exp $ 2 2 \documentclass[panstarrs]{panstarrs} 3 3 … … 294 294 295 295 \subsection{Bias subtraction} 296 \label{sec:bias} 296 297 297 298 Given an input image and various other parameters, … … 299 300 The API shall be the following: 300 301 \begin{verbatim} 301 psReadout *psPhase2SubtractBias(psReadout *in, void *fitSpec, psOverscanAxis overscanAxis, ps BiasFit fit,302 psReadout *psPhase2SubtractBias(psReadout *in, void *fitSpec, psOverscanAxis overscanAxis, psFit fit, 302 303 int nBin, const psList *regions, const psStats *stat, const psImage *bias); 303 304 \end{verbatim} … … 310 311 311 312 \begin{verbatim} 312 /** Fit type for bias*/313 /** Fit type */ 313 314 typedef enum { 314 PS_OVERSCAN_FIT_NONE, ///< No fit to bias 315 PS_OVERSCAN_FIT_LINEAR, ///< Do linear interpolation on bias 316 PS_OVERSCAN_FIT_POLYNOMIAL, ///< Fit polynomial to bias 317 PS_OVERSCAN_FIT_CHEBYSHEV, ///< Fit chebyshev to bias 318 PS_OVERSCAN_FIT_SPLINE ///< Fit cubic splines to bias 319 } psBiasFit; 320 \end{verbatim} 321 322 If \code{fitSpec} is \code{NULL}, or \code{fit} is 323 \code{PS_OVERSCAN_FIT_NONE}, then no fit shall be performed to the 324 overscan. If \code{fit} is \code{PS_OVERSCAN_FIT_LINEAR}, then the 325 function shall perform simple linear interpolation between points in 326 the overscan. Otherwise, \code{fitSpec} shall be interpreted to be a 327 structure of the appropriate type (\code{psPolynomial1D} for 328 \code{PS_OVERSCAN_FIT_POLYNOMIAL} and 329 \code{PS_OVERSCAN_FIT_CHEBYSHEV}, and \code{psSpline1D} for 330 \code{PS_OVERSCAN_FIT_SPLINE}), and the overscan shall be fit using 331 the specified functional form. Upon return, the \code{fitSpec} shall 315 PS_FIT_NONE, ///< No fit 316 PS_FIT_LINEAR, ///< Do linear interpolation 317 PS_FIT_POLYNOMIAL, ///< Fit polynomial 318 PS_FIT_CHEBYSHEV, ///< Fit chebyshev 319 PS_FIT_SPLINE ///< Fit cubic splines 320 } psFit; 321 \end{verbatim} 322 323 If \code{fitSpec} is \code{NULL}, or \code{fit} is \code{PS_FIT_NONE}, 324 then no fit shall be performed to the overscan. If \code{fit} is 325 \code{PS_FIT_LINEAR}, then the function shall perform simple linear 326 interpolation between points in the overscan. Otherwise, 327 \code{fitSpec} shall be interpreted to be a structure of the 328 appropriate type (\code{psPolynomial1D} for \code{PS_FIT_POLYNOMIAL} 329 and \code{PS_FIT_CHEBYSHEV}, and \code{psSpline1D} for 330 \code{PS_FIT_SPLINE}), and the overscan shall be fit using the 331 specified functional form. Upon return, the \code{fitSpec} shall 332 332 contain the coefficients of the overscan fit. 333 333 … … 351 351 warning shall be generated if the \code{overscanAxis} is 352 352 \code{PS_OVERSCAN_NONE} or \code{PS_OVERSCAN_ALL} and the \code{fit} 353 is not \code{PS_ OVERSCAN_FIT_NONE}.353 is not \code{PS_FIT_NONE}. 354 354 355 355 If the \code{overscanAxis} is \code{PS_OVERSCAN_ROWS} or … … 361 361 If the overscan is not defined for each row/column, then the function 362 362 shall generate a warning and then interpolate using the provided 363 functional form if \code{fit} is not \code{PS_ OVERSCAN_FIT_NONE};363 functional form if \code{fit} is not \code{PS_FIT_NONE}; 364 364 otherwise, the function shall generate an error. 365 365 … … 484 484 \subsection{Subtract sky} 485 485 486 Given an input image, a polynomial specifying the order of a desired 487 fit, a list of template background images, a list of catalog stars on 488 or near the chip, and parameters specifying how to grow the radius of 489 the objects, and the binning factor, \code{psPhase2SubtractSky} shall 490 fit and subtract the background of the image. The API shall be the 491 following: 492 \begin{verbatim} 493 /** Subtracts the sky background. */ 486 \tbd{This is a simply sky subtraction routine. A more complicated 487 routine will be specified in the future, following research into the 488 best algorithm.} 489 490 Given an input image, a polynomial or spline specifying the order of a 491 desired fit, a binning factor and statistics to use for the binning, 492 along with a clipping level, \code{psPhase2SubtractSky} shall fit and 493 subtract a model for the background of the image. The API shall be 494 the following: 495 \begin{verbatim} 496 /** Simple sky subtraction */ 494 497 psReadout *psPhase2SubtractSky(psReadout *in, ///< Input image to be sky-subtracted, and output 495 psPolynomial2D *poly, ///< Polynomial specification, returns coeffcients 496 psVector *outNorms, ///< Normalisations of the template sky images: output 497 const psList *skyImages, ///< Template sky images: a list of type psImage, or 498 ///< NULL 499 const psList *catalog, ///< Sources nearby to mask when measuring the 500 ///< background: a list of type psObject, or NULL 501 float radiusMultiply, ///< Multiplying factor of object radius for mask 502 float radiusAdd, ///< Additive factor to grow the object masks 503 int binFactor ///< Binning factor to use on image before solving for polynomial 504 ); 505 \end{verbatim} 506 507 The polynomial specification, \code{poly}, specifies the order of the 508 polynomial to be used in fitting the background. Note that the input 509 image, \code{in}, shall be subtracted in-place. The function shall 510 return the subtracted image, and also update the polynomial, 511 \code{poly}, to hold the polynomial coefficients used in the 512 subtraction, and update the vector \code{outNorms} to hold the 513 normalisations of each of the template background images used in the 514 subtraction. The \code{outNorms} vector shall be resized if necessary 515 to match the number of template sky images in the list 516 \code{skyImages}. If the polynomial specification is \code{NULL}, then 517 no polynomial shall be fit to the input image. 518 519 Note that the input image, \code{in}, and the template sky images, 520 \code{skyImages}, need not be the same size, since the input image may 521 already have been trimmed (following overscan subtraction), but the 522 function shall use the offsets in the image (\code{in->x0} and 523 \code{in->y0}) to determine the appropriate offsets to obtain the 524 correct pixels. In the event that one (or more) of the 525 \code{skyImages} is too small (i.e., pixels on the input image refer 526 to pixels outside the range of the \code{skyImages} image), the 527 function shall generate an error. 528 529 The \code{catalog} shall be a linked list of \code{psObject} which 530 corresponds to objects on the input image. If the size of a source in 531 the \code{catalog} is \code{size}, then the radius to mask around the 532 source before fitting the background shall be \code{radiusMultiply} 533 $\times$ \code{size} + \code{radiusAdd}. 534 535 \tbd{Are the catalog stars in celestial or pixel coordinates? I lean 536 to pixel coordinates.} 537 538 \tbd{What size do we use? FWHM?} 539 540 When fitting a polynomial, the function shall bin the input image by 541 \code{binFactor} in order to reduce the required processing time. 542 543 \code{poly} may be \code{NULL} in order to specify that only the 544 template sky images should be used in the fitting, and no polynomial 545 terms. \code{outNorms} may be \code{NULL} if the caller is not 546 interested in the normalisations. \code{skyImages} may be \code{NULL} 547 in order to specify that there are no input sky template images. 548 \code{catalog} may be \code{NULL} in order to specify that there are 549 no objects to mask. If both \code{poly} and \code{skyImages} are 550 \code{NULL}, then the function shall simply return the input image 551 with no processing. 498 void *fitSpec, ///< Polynomial/Spline specification, returns coeffcients 499 psFit fit, ///< Fit type 500 int binFactor, ///< Binning factor to use on image before solving for polynomial 501 psStats *stats, ///< Statistics to use in binning 502 float clipSD ///< Standard deviations to clip at after binning. 503 ); 504 \end{verbatim} 505 506 Note that the input image, \code{in}, shall be subtracted in-place. 507 The function shall return the subtracted image, and also update the 508 polynomial, chebyshev or spline specified by \code{fitSpec}, to hold 509 the coefficients used in the subtraction. 510 511 The fit specification, \code{fitSpec}, specifies the order of the 512 polynomial or spline to be used in fitting the background. 513 \code{fitSpec} shall be interpreted as a polynomial, Chebyshev or 514 spline on the basis of \code{fit} (in the same manner as for bias 515 subtraction; \S\ref{sec:bias}). If \code{fitSpec} is \code{NULL} or 516 \code{fit} is \code{PS_FIT_NONE}, then no fit shall be performed, and 517 the function shall simply return. 518 519 When fitting the polynomial, the function shall first bin the input 520 image by \code{binFactor} in order to reduce the required processing 521 time. The statistic to use in this binning is specified by 522 \code{stat}. \code{stat} is of type \code{psStats} instead of simply 523 \code{psStatsOptions} so that clipping levels may be specified, if 524 desired. In the event that multiple options are specified by 525 \code{stats}, a warning shall be generated, and the option with the 526 highest priority shall be used, according to the following priority 527 order: \code{PS_STAT_SAMPLE_MEAN}, \code{PS_STAT_SAMPLE_MEDIAN}, 528 \code{PS_STAT_CLIPPED_MEAN}, \code{PS_STAT_ROBUST_MEAN},\ 529 \code{PS_STAT_ROBUST_MEDIAN}, \code{PS_STAT_ROBUST_MODE}. If the 530 \code{binFactor} is non-positive, or \code{stats} is \code{NULL} or 531 fails to specify an option, a warning shall be generated, and the fit 532 shall be performed on the entire image. 533 534 Binned pixels deviating more than \code{clipSD} standard deviations 535 from the mean of the binned pixels shall be clipped in a single 536 clipping iteration. If the \code{clipSD} is non-positive, then the 537 function shall generate a warning and not perform any clipping. 538 552 539 553 540 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note:
See TracChangeset
for help on using the changeset viewer.
