IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 30, 2005, 9:42:38 AM (21 years ago)
Author:
eugene
Message:

hacking on pstask, psphot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/psphot/psphot.tex

    r4900 r4902  
    1818\maketitle
    1919
    20 \note{the current configuration variables and some of the function
    21   names are not very well chosen.  expect these to be modified as the
    22   code base is cleaned.}
    23 
    2420\section{Introduction}
    2521
    26 \subsection{Background}
    27 
    28 {\bf note: add discussion of the PS project overview}
     22\subsection{Overview}
     23
     24The Institute for Astronomy at the University of Hawaii is developing
     25a large optical synoptic survey telescope system, the Panoramic Survey
     26Telescope and Rapid Response System (Pan-STARRS). The science goals,
     27priorities, top-level concept of operations with associated
     28operational requirements, and system performance drivers with
     29associated system performance requirements are described in the
     30Pan-STARRS Science Goals Statement (SGS).  As described in this
     31document, The system conceptual design for Pan-STARRS utilizes an
     32array of four 1.8m telescopes each with a 7 degree$^2$ field of view,
     33giving the system an \'etendue larger than all existing survey
     34instruments combined (defined as the product of the collecting area
     35$A$ multiplied by the field-of-view solid angle $\Omega$).  Each
     36telescope will be equipped with a 1.4 billion pixel CCD camera with
     37low noise and rapid read-out, and the data will be reduced in near
     38real time to produce both cumulative static sky and difference images
     39from which transient, moving, and variable objects can be
     40detected. Pan-STARRS will be able to survey up to $\approx 6,000$
     41degree$^{2}$ per night to a detection limit of approximately 24$^{th}$
     42magnitude.  This unique combination of sensitivity and sky coverage
     43will open up many new possibilities in time domain astronomy including
     44a major goal of surveying the Potentially Hazardous Object (PHO)
     45population down to a diameter of $\approx 300$ meters.  In addition,
     46the Pan-STARRS data will be used to investigate a broad range of
     47astronomical problems of extreme current interest concerning the Solar
     48System, the Galaxy, and the Cosmos at large.  A prototype single
     49telescope system, PS-1, is being developed as a preliminary step
     50before construction of the complete four telescope system.
     51
     52\begin{tabular}{ll}
     53Project sponsor:&       AFRL, United States Air Force \\
     54Acquirer:       &       University of Hawaii Institute for Astronomy \\
     55User:           &       Astronomical community \\
     56Developer:      &       University of Hawaii Institute for Astronomy, participating \\
     57                &       institutions, and associated subcontractors     
     58\end{tabular}
    2959
    3060The Pan-STARRS Image Processing Pipeline is responsible for the basic
    3161analysis of images from the Pan-STARRS telescopes Gigapixel Camera.
    32 Among the Pan-STARRS project survey goals is a repeated all-sky survey
    33 in 5 filters, {\it grizy}, beginning with a pre-survey with the
    34 prototype telescope PS-1.  The photometric and astrometric precision
    35 goals for the all-sky surveys, as well as the other survey components,
    36 are quite stringent:
     62The overall goals and requirements of the Image Processing Pipeline
     63are described in the IPP System/Subsystem Design Description (SSDD;
     64PSDC-430-XXX) and the IPP System Requirements Specification (SRS;
     65PSDC-430-XXX).  Among the Pan-STARRS project survey goals is a
     66repeated all-sky survey in 5 filters, {\it grizy}, beginning with a
     67pre-survey with the prototype telescope PS-1.  The photometric and
     68astrometric precision goals for the all-sky surveys, as well as the
     69other survey components, are quite stringent:
    3770
    3871\begin{itemize}
     
    4073across the sky in the internal photometric system;
    4174
    42 \item relative astrometry; 10 milliarcseconds scatter {\bf note: 2-D
    43 radial or 1-D linear?} for individual stars between repeated images.
     75\item relative astrometry; 10 milliarcseconds scatter for individual
     76stars between repeated images.
    4477
    4578\item absolute astrometry: 100 milliarcseconds scatter for all ICRS
    4679  reference stars (Tycho).
    47 
    4880\end{itemize}
    4981
     
    68100astrometry.
    69101
    70 \subsubsection{Existing Photometry Analysis Programs}
     102\subsection{Comparable Programs}
     103
     104A variety of astronomical software packages perform the basic object
     105detection, measurement, and classification tasks needed by the
     106Pan-STARRS IPP.  Each of these programs have their own advantages and
     107disadvantages.  Below we discuss some of the most widely used of these
     108other packages, highlighting the features of the programs which are
     109particularly desirable, and noting aspects of the programs which are
     110problematic for the IPP.
    71111
    72112\begin{itemize}
     
    75115  pro: well-tested, stable code.  con: limited range of models,
    76116  algorithm converges slowly to a PSF model, limited tests of PSF
    77   validity, inflexible code base, fortran
     117  validity, inflexible code base, fortran (P. Schechter)
    78118
    79119\item DAOPhot : Pixel-map PSF model with analytical component.  pro:
    80120  well-tested, high-quality photometry.  con: Difficult to use in an
    81   automated fashion, does it handle 2D variations well?
     121  automated fashion, does it handle 2D variations well? (P. Stetson)
    82122
    83123\item Sextractor : pure aperture measurement with rudimentary
    84124  object subtraction.  pro: fast, widely used, easy to automate.  con:
    85125  poor object separation in crowded regions, PSF-modeling is only
    86   beta (psfex), what models are available?
     126  beta (psfex), what models are available? (E. Bertin)
    87127
    88128\item apphot : IRAF-based aperture photometry.  pro: widely used.
    89   con: IRAF-based, aperture photometry.
     129  con: IRAF-based, aperture photometry. (???)
    90130
    91131\item galfit : detailed galaxy modeling.  not a multi-object PSF
    92132  analysis tool.  con: does not provide a PSF model, not easily
    93133  automated.  very detailed results in very slow processing.  only a
    94   galaxy analysis program.
     134  galaxy analysis program. (C. Impey)
    95135
    96136\item SDSS phot : con: tightly integrated into the SDSS software
    97   environment. 
     137  environment.  (R. Lupton)
    98138
    99139\end{itemize}
     140
     141\note{discussion of these packages is insufficient: flesh out
     142  discussion and add in the references.}
    100143
    101144The Pan-STARRS IPP team decided that none of the existing packages met
     
    103146the project.  We decided to redesign the photometry analysis from
    104147scratch, using the lessons learned from the existing photometry
    105 systems.  In addition, the software would be written using the data
    106 analysis C-code library written for the IPP, \code{psLib}, and
    107 integrate the elements of the photometry code into the IPP's mid-level
    108 astronomy data analysis toolkit called \code{psModules}.  The result
    109 is 'PSPhot', which can be used either as a stand-alone C program, or
    110 as one of the high-level IPP components of \code{psModules}, available
    111 to programmers either via a C interface or through a SWIG interface in
    112 Perl (or potentially Python). 
     148systems.  In the process, the object analysis software would be
     149written using the data analysis C-code library written for the IPP,
     150\code{psLib}, and the components of the photometry code would be
     151integrated into the IPP's mid-level astronomy data analysis toolkit
     152called \code{psModules}.  The result is 'PSPhot', which can be used
     153either as a stand-alone C program, or as one of the high-level IPP
     154components of \code{psModules}, available to programmers either via a
     155C interface or through a SWIG interface in Perl (or potentially
     156Python).
    113157
    114158\note{Add discussion of the lessons learned from experience with previous
     
    119163  easily modified. 
    120164\item PSF variation is fundamental : PSF representation should incorporate 2-D variations. 
    121 \item Speed fitting with accurate parameter guesses. 
     165\item Speed fitting with accurate parameter guesses.
    122166\item Make good use of moment information to speed analysis. 
    123167\item Careful definition of PSF validity tests. 
     
    127171\end{itemize}
    128172
    129 \section{Description of the PSPhot analysis steps}
     173\section{PSPhot Analysis Process}
    130174
    131175\subsection{Overview}
     
    155199  difference image, noise image, etc, as selected.
    156200\end{itemize}
     201
     202\note{the current configuration variables and some of the function
     203  names are not very well chosen.  expect these to be modified as the
     204  code base is cleaned.}
    157205
    158206\subsection{Image Preparation}
     
    186234constructed by default from the image by applying three rules: 1)
    187235Pixels which are above a specified saturation level are marked as
    188 saturated.  2) Pixels which are below a user-defined value are
    189 considered unresponsive and masked as dead \note{currently
    190 unimplemented and ignored}.  3) Pixels which lie outside of a
    191 user-defined window are considered non-data pixels (eg, overscan) and
    192 are marked as invalid \note{mask values are currently hard-wired
    193 numbers : they should be given named enum values}
     236saturated (configuration keyword: \code{SATURATE}).  2) Pixels which
     237are below a user-defined value are considered unresponsive and masked
     238as dead.  3) Pixels which lie outside of a user-defined window are
     239considered non-data pixels (eg, overscan) and are marked as invalid.
     240The valid window is defined by the configuration variables
     241\code{XMIN}, \code{XMAX}, \code{YMIN}, \code{YMAX}.
     242
     243\note{minimum valid data value is currently unimplemented}
     244
     245\note{mask values are currently hard-wired numbers : they should be
     246given named enum values}
    194247
    195248The noise image, if not supplied is constructed by default from the
     
    204257represents the noise as a function of position in the image.
    205258
    206 \subsubsection{Initial Object Detection}
     259\subsection{Initial Object Detection}
    207260
    208261The objects are initially detected by finding the location of local
    209 peaks in the image.  \note{In the ideal case, if we were only
    210 interested in detecting PSFs, and we had a good model for the PSF, we
    211 could optimally find the sources by smoothing the image and the noise
    212 image with the PSF model.  \em write out the description of Nick's
    213 optimal PSF finding}.  The flux image is smoothed with a very small
     262peaks in the image.  The flux image is smoothed with a very small
    214263circularly symmetric kernel using a two-pass 1D Gaussian.  At this
    215 stage, the goal is to detect only the brighter sources, above a user
    216 defined S/N limit.  The detection efficiency for the brighter sources
    217 is not strongly dependent on the form of this smoothing function.
    218 \note{is the smoothing needed?}
     264stage, the goal is only to detect the brighter sources, above a user
     265defined S/N limit (configuration keyword: \code{PEAK_NSIGMA}).  The
     266detection efficiency for the brighter sources is not strongly
     267dependent on the form of this smoothing function.
     268
     269\note{Is this smoothing needed?}
    219270
    220271The local peaks in the smoothed image are found by first detecting
     
    224275neighboring pixels is kept.  Any peak which is lower than any of the 8
    225276neighboring pixels is rejected.  Any peak which has the same value as
    226 any of the other 8 pixels is kept if the pixel X and Y coordinates are
    227 greater than or equal to the other equal value pixels.  This simple
    228 rule set means that a flat-topped region will maintain peaks at the
    229 maximum X and Y corners of the region.
    230 
    231 \note{the current implementation is ignoring the S/N map in making the
    232 peak detection.  This means that we cannot use the same code to find
    233 peaks in a difference image or to re-find peaks in the image after the
    234 modeled objects have been subtracted}.
     277any of the other 8 pixels is kept if the pixel $X$ and $Y$ coordinates
     278are greater than or equal to the other equal value pixels.  This
     279simple rule set means that a flat-topped region will maintain peaks at
     280the maximum $X$ and $Y$ corners of the region.
     281
     282\note{The current implementation ignores the S/N map in making the
     283peak detection.  This code must be modified (a la Kaiser) to be used
     284for a peak-detection pass in a difference image or to re-find peaks in
     285the image after the modeled objects have been subtracted}.
    235286
    236287Once a collection of peaks have been identified, basic properties of
    237288the objects are measured.  First, the local sky flux is measured
    238 (using Median? user-specific method?) within a square annulus with
    239 user-defined dimensions (\code{INNER_RADIUS} and \code{OUTER_RADIUS}).
    240 \note{rejection of some peaks based on the local sky measurement?}.
    241 This local background value is then used to calculate the object first
    242 and second moments within a small user-defined aperture
     289within a square annulus with user-defined dimensions
     290(\code{INNER_RADIUS} and \code{OUTER_RADIUS}), using the sample
     291median.  This local background value is then used to calculate the
     292object first and second moments within a small user-defined aperture
    243293(\code{MOMENT_RADIUS}).  The first-order moments are a good
    244294representation of the object position, while the second-order moments
    245295are a measure of the object shape.  The second-order moments are
    246296somewhat sensitive to the size of the aperture and the accuracy of the
    247 background measurement.  \note{discuss object rejection based on the
    248 value of the object moments and the value of the centroid vs peak
    249 pixel coordinates}.
     297background measurement.  The moment calculation is only performed
     298using pixels which exceed a S/N of 1.  If, in the process of
     299calculating the source moments, the S/N limits reject all but \note{3}
     300or fewer of the source pixels, the peak is identified as being
     301suspect, and is not used for further analysis.  If the measured
     302centroid coordinates differ from the peak coordinates be a large
     303amount (\code{MOMENT_RADIUS}), then the peak is again identified as
     304being of poor quality and is rejected.  In both of these cases, it is
     305likely that the `peak' was identified in a region of flat flux
     306distribution or many saturated or edge pixels.
    250307
    251308\subsection{PSF Determination}
     
    256313object.  An important concept within the PSPhot code is the
    257314distinction between a model which describes an object on an image and
    258 a model with describes the point-spread-function across an image. 
     315a model with describes the point-spread-function (PSF) across an
     316image.
    259317
    260318Any object in an image may be represented by some analytical model,
    261 for example, a 2-D elliptical Gaussian.  The object model will have a
    262 variety of model parameters, in this case the centroid coordinates
    263 ($x_o, y_o$), the elliptical shape parameters ($\sigma_x, \sigma_y,
    264 \sigma_{xy}$), the model normalization ($I_o$) and the local value of
    265 the background ($S$).  A specific object will have a particular set of
    266 values for these different parameters.
     319for example, a 2-D elliptical Gaussian:
     320\begin{eqnarray}
     321f(x,y) & = & I_o exp (-z) + S  \\
     322    R  & = & \frac{(x - x_o)^2}{2\sigma_x^2} + \frac{(y -
     323    y_o)^2}{2\sigma_y^2} + \sigma_{\rm xy}(x - x_o)(y - y_o)
     324\end{eqnarray}
     325The object model will have a variety of model parameters, in this case
     326the centroid coordinates ($x_o, y_o$), the elliptical shape parameters
     327($\sigma_x, \sigma_y, \sigma_{\rm xy}$), the model normalization
     328($I_o$) and the local value of the background ($S$).  A specific
     329object will have a particular set of values for these different
     330parameters.
    267331
    268332The point-spread-function (PSF) of an image describes the shape of all
     
    276340independent from object to object.  For the case of the elliptical
    277341Gaussian model, the PSF parameters would be the shape terms
    278 ($\sigma_x, \sigma_y, \sigma_{xy}$) while the independent parameters
    279 would be the centroid, normalization and local sky values ($x_o, y_o,
    280 I_o, S$).  PSPhot uses a 2-D polynomial to specify the variation in
    281 the PSF parameters as a function of position in the image.  In the
    282 case of the elliptical Gaussian, this implies that the parameters are
    283 each a function of the object centroid coordinates:
     342($\sigma_x, \sigma_y, \sigma_{\rm xy}$) while the independent
     343parameters would be the centroid, normalization and local sky values
     344($x_o, y_o, I_o, S$).  PSPhot uses a 2-D polynomial to specify the
     345variation in the PSF parameters as a function of position in the
     346image.  In the case of the elliptical Gaussian, this implies that the
     347parameters are each a function of the object centroid coordinates:
    284348\begin{eqnarray}
    285349\sigma_x    & = & f_1(x,y) \\
     
    3093733 for the PSF model. 
    310374
    311 \note{coding diversion} Throughout PSPhot, there are many places where
    312 it is necessary for the code to refer to an aspect of the object or
    313 PSF model.  Often, these quantities are needed deep within other parts
    314 of the code.  For example, when attempting to fit the pixel flux
    315 values for an object, it is necessary to generate a guess for the
    316 model parameters.  Or, in order to limit the domain of the fit, it is
    317 necessary to determine an isophotal radius for a model.  In order to
    318 avoid having the code depend on the specific form of a model, all of
    319 these types of circumstances are abstracted, and a method is provided
    320 to return the necessary function to the higher-level software.  For
    321 example, each model type has its own function to define an initial
    322 guess for the model, or a function to determine the radius for a given
    323 flux level.  These are then registered as part of the model function
    324 code.  Another function is then used to return the appropriate
    325 function for a specific model type.  For example, the
    326 \code{psModelLookup_GetFunction} will return the \code{psModelLookup}
    327 function for a given model type.  This mechanism makes it very easy to
    328 add new model functions into the PSPhot code base.  To add a new model
    329 function, the programmer simply defines a new model name (a string),
    330 the set of all necessary model lookup functions, and places the
    331 reference to the model code at the appropriate location in the
    332 psModelInit.c routine.  It is not necessary to specify the PSF model
    333 functions independently or the object model functions.  Nor is it
    334 necessary to identify the intended use of a given object model
    335 function (ie, PSF-like object, galaxy, comet, etc).  Any model can be
    336 used for the PSF model.  The code currently uses a fixed translation
    337 between the object model parameters and the PSF model parameters.  It
    338 also defines a specific order for the 4 independent parameters.
    339 \note{it may also require that two of the PSF-like parameters
     375PSPhot is written so that the object detection, measurement, and
     376classification code does not depend on the specific form of the
     377available object model functions.  Access to the characteristics of
     378the models is provided through a simple function abstraction method.
     379Throughout PSPhot, there are many places where it is necessary for the
     380code to refer to an aspect of the object or PSF model.  Often, these
     381quantities are needed deep within other parts of the code.  For
     382example, when attempting to fit the pixel flux values for an object,
     383it is necessary to generate a guess for the model parameters.  Or, in
     384order to limit the domain of the fit, it is necessary to determine an
     385isophotal radius for a model. 
     386
     387In order to avoid having the code depend on the specific form of a
     388model, the function calls needed in these types of circumstances are
     389abstracted, and a method is provided to return the necessary function
     390to the higher-level software.  For example, each model type has its
     391own function to define an initial guess for the model, or a function
     392to determine the radius for a given flux level.  These are then
     393registered as part of the model function code.  Another function is
     394then used to return the appropriate function for a specific model
     395type.  For example, the \code{psModelLookup_GetFunction} will return
     396the \code{psModelLookup} function for a given model type.  This
     397mechanism makes it very easy to add new model functions into the
     398PSPhot code base.  To add a new model function, the programmer simply
     399defines a new model name (a string), the set of all necessary model
     400lookup functions, and places the reference to the model code at the
     401appropriate location in the psModelInit.c routine.
     402
     403When a new model is provided to PSPhot, it is not necessary to specify
     404the intended use of the object model function (ie, PSF-like object,
     405galaxy, comet, etc).  Any model can be used for the PSF model, or to
     406describe the flux distributions of the non-PSF objects.  The code
     407currently uses a fixed translation between the object model parameters
     408and the PSF model parameters.  It also defines a specific order for
     409the 4 independent parameters. 
     410
     411\note{the code may also require that two of the PSF-like parameters
    340412represent the shape in some way}.
    341413
     
    346418to be PSF-like.  PSPhot uses the object moments to make the initial
    347419guess at a collection of PSF-like objects.  At this point, the program
    348 has measured the second order moments for all objects identified their
    349 peaks, as well as an approximate signal-to-noise ratio.  All objects
    350 with a S/N ratio greater than a user-defined parameter are selected by
    351 PSPhot, though objects which have more than a certain number of
    352 saturated pixels are excluded at this stage.  PSPhot then examines the
    353 2-D plane of $\sigma_x, \sigma_y$ in search of a concentrated clump of
    354 objects.  To do this, it constructs an artificial image with pixels
    355 representing the value of $\sigma_x, \sigma_y$, using a user-defined
    356 scale for the size of a pixel in this artificial image (note that the
    357 units of the $\sigma_x, \sigma_y$ plane are the size of the
    358 second-moment in pixels in the original image).  A typical value for
    359 the bin size is approximately 0.1 image pixels.  The binned $\sigma_x,
    360 \sigma_y$ plane is then examined to find a peak which has a
    361 significance greater than XXX.  Unless the image is extremely sparse,
    362 such a peak will be well-defined and should represent the objects
    363 which are all very similar in shape.  Other objects in the image will
    364 tend to land in very different locations, failing to produce a single
    365 peak.  To avoid detecting a peak from the unresolved cosmic rays,
    366 objects which have second-moments very close to 0 are ignored.  The
    367 only danger is if the PSF is very small and too many of these objects
    368 are rejected as cosmic rays.
     420has measured the second order moments for all objects identified by
     421their peaks, as well as an approximate signal-to-noise ratio.  All
     422objects with a S/N ratio greater than a user-defined parameter
     423(\code{PSF_SHAPE_NSIGMA} ???) are selected by PSPhot, though objects
     424which have more than a certain number of saturated pixels are excluded
     425at this stage.  PSPhot then examines the 2-D plane of $\sigma_x,
     426\sigma_y$ in search of a concentrated clump of objects.  To do this,
     427it constructs an artificial image with pixels representing the value
     428of $\sigma_x, \sigma_y$, using a user-defined scale for the size of a
     429pixel in this artificial image (note that the units of the $\sigma_x,
     430\sigma_y$ plane are the size of the second-moment in pixels in the
     431original image).  A typical value for the bin size is approximately
     4320.1 image pixels.  The binned $\sigma_x, \sigma_y$ plane is then
     433examined to find a peak which has a significance greater than XXX.
     434Unless the image is extremely sparse, such a peak will be well-defined
     435and should represent the objects which are all very similar in shape.
     436Other objects in the image will tend to land in very different
     437locations, failing to produce a single peak.  To avoid detecting a
     438peak from the unresolved cosmic rays, objects which have
     439second-moments very close to 0 are ignored.  The only danger is if the
     440PSF is very small and too many of these objects are rejected as cosmic
     441rays.
    369442
    370443Once a peak has been detected in this plane, the centroid and second
     
    378451model, allowing all of the parameters (PSF and independent) to vary in
    379452the fit.  PSPhot uses the Levenberg-Marqardt process for the
    380 non-linear fitting \note{discuss the convergence criteria, model
    381 parameter guesses}.  In this process, any objects which fail to
    382 converge in the fit are flagged as invalid.  For the resulting
    383 collection of object model parameters, the PSF-dependent parameters of
    384 the models are all fitted as a function of position to a 2-D
    385 polynomial.  The order of this polynomial is (should be?) a
    386 user-defined parameter.  The fitting process for these polynomials is
    387 iterative, and rejects the $3-\sigma$ outliers in each of three
    388 passes.  This fitting technique results in a robust measurement of the
    389 variation of the PSF model parameters as a function of position
    390 without being excessively biased by individual objects which fail
    391 drastically.  Objects whose model parameters are rejected by this
    392 iterative fitting technique are also marked as invalid and ignored in
    393 the later PSF model fitting stages.
     453non-linear fitting.  Non-linear fitting can be very computationally
     454intensive, particularly for if the starting parameters are far from
     455the minimization values.  PSPhot uses a the first and second moments
     456to make a good guess for the centroid and shape parameters for the PSF
     457models.  In order to minimize the impact of close neighbors, the noise
     458values used in the fit are enhanced by a fraction of the deviation of
     459the particular pixel value from the model guess.  Any objects which
     460fail to converge in the fit are flagged as invalid.
     461
     462\note{does the noise enhancement introduce too much bias?}
     463
     464\note{discuss the convergence criteria, model parameter guesses}
     465
     466For the resulting collection of object model parameters, the
     467PSF-dependent parameters of the models are all fitted as a function of
     468position to a 2-D polynomial.  The order of this polynomial is (should
     469be?) a user-defined parameter.  The fitting process for these
     470polynomials is iterative, and rejects the $3-\sigma$ outliers in each
     471of three passes.  This fitting technique results in a robust
     472measurement of the variation of the PSF model parameters as a function
     473of position without being excessively biased by individual objects
     474which fail drastically.  Objects whose model parameters are rejected
     475by this iterative fitting technique are also marked as invalid and
     476ignored in the later PSF model fitting stages.
    394477
    395478All of the PSF-candidate objects are then re-fitted using the PSF
     
    402485model for this particular image. 
    403486
    404 The metric used by PSPhot to assess the PSF model is currently the
    405 scatter in the differences between the aperture and fit magnitudes for
    406 the PSF objects.  The difference between the aperture and fit
    407 magnitudes ({\em ApResid}) is a critical parameter for any PSF
    408 modeling software which uses an analytical model to represent the
    409 flux distribution of the objects in an image. 
     487The metric used by PSPhot to assess the PSF model is the scatter in
     488the differences between the aperture and fit magnitudes for the PSF
     489objects.  The difference between the aperture and fit magnitudes ({\em
     490ApResid}) is a critical parameter for any PSF modeling software which
     491uses an analytical model to represent the flux distribution of the
     492objects in an image.
    410493
    411494The important concept here is that an analytical model will always
     
    452535quality are dominant.  The brighter is the object, the smaller is the
    453536error introduced by the large size of the aperture.  However, the
    454 number of very bright stars is limited in any image.
    455 
    456 Consider a typical bright object with a flux of (say) 40,000 counts in
    457 an image of background 1000 counts per pixel, with FWHM of 4 pixels.
    458 In principle, the flux of this object should be measurable with an
    459 accuracy of roughly 0.57\% ($\frac{\sqrt{40000 + 1000 \times
    460 12}}{40000}$).  However, the measurement of the sky is limited at some
    461 finite level by Poisson statistics.  If we are required to use an
    462 aperture of (say) 25 pixels in radius (eg, 5 arcseconds for an 0.2
    463 arcsec / pixel detector), and we have an annulus of twice this radius
    464 to measure the local sky, then we will have an error of XXX.
     537number of very bright stars is limited in any image, and of course the
     538brighter stars are more likely to suffer from non-linearity or
     539saturation. 
     540
     541\note{this discussion sucks: put in some more details of my point:
     542  amplitude of systematic vs random sky errors}
     543
     544How important is this effect?  Consider a typical bright object with a
     545flux of (say) 40,000 counts in an image of background 1000 counts per
     546pixel, with FWHM of 4 pixels.  In principle, the flux of this object
     547should be measurable with an accuracy of roughly 0.57\%
     548($\frac{\sqrt{40000 + 1000 \times 12}}{40000}$).  However, the
     549measurement of the sky is limited at some finite level by Poisson
     550statistics.  If we are required to use an aperture of (say) 25 pixels
     551in radius (eg, 5 arcseconds for an 0.2 arcsec / pixel detector), and
     552we have an annulus of twice this radius to measure the local sky, then
     553we will have an error of XXX.
    465554
    466555\note{outline the variation of {\em ApResid} as a function of
     
    469558PSPhot measures the aperture correction ({\em ApResid}) for every PSF
    470559candidate object, then calculates the trend of this correction as a
    471 function of the magnitude.  This trend \note{write the correct form}
    472 is fitted with a line.  The resulting function can be used to
    473 determine the effective aperture correction for an infinite flux
    474 object and the average bias inherent in the sky measurement for the
    475 image.  The scatter of the PSF-candidate object measurements about
    476 this trend is a measure of how well we can measure photometry from the
    477 image by applying the specific PSF model.
     560function of the magnitude.  This trend is fitted with a line.  The
     561resulting function can be used to determine the effective aperture
     562correction for an infinite flux object and the average bias inherent
     563in the sky measurement for the image.  The scatter of the
     564PSF-candidate object measurements about this trend is a measure of how
     565well we can measure photometry from the image by applying the specific
     566PSF model.  The slope of this trend is a measure of the bias in the
     567local sky measurment for each object.  In principal, the measured sky
     568levels could be modified by this bias.  More generally, the measured
     569bias in a collection of images could be used to improve the model
     570fitting or sky fitting portion of the software the remove the bias
     571term.
    478572
    479573PSPhot allows a collection of PSF model functions to be tried on all
     
    481575ApResid scatter is measured.  The PSF model function with the smallest
    482576value for the ApResid scatter is then used by PSPhot as the best PSF
    483 model for this image.
     577model for this image.  The number of models to be tested is specified
     578by the configuration keyword \code{PSF_MODEL_N}.  The configuration
     579variables \code{PSF_MODEL_0}, \code{PSF_MODEL_1}, through
     580\code{PSF_MODEL_N - 1} specify the names of the models which should be
     581tested.
    484582
    485583\subsubsection{PSF Model applied to detected objects}
     
    561659\subsubsection{Types of Object / PSF models currently available}
    562660
     661\note{the discussion of the model types needs to be extended}
     662
    563663\begin{itemize}
    564664\item Pure elliptical Gaussian (GAUSS)
     
    608708  test in this case}.
    609709
    610 \subsection{faint sources}
     710\subsection{Faint Sources}
    611711
    612712\note{the following discussion is theoretical : it is not yet coded}
     
    660760constraints on the quality of the detection (no Chi-Square is
    661761measured, for example).
     762
     763\note{In the ideal case, if we were only interested in detecting PSFs,
     764and we had a good model for the PSF, we could optimally find the
     765sources by smoothing the image and the noise image with the PSF model.
     766\em write out the description of Nick's optimal PSF finding}.
    662767
    663768PSPhot allows the user to select between these three options for the
     
    732837\note{need to discuss failings and holes}
    733838
     839\section{User's Guide}
     840
     841\subsection{Configuration Parameters}
     842
     843\begin{verbatim}
     844FAINT_SN_LIM
     845FIT_MAX_CHI
     846FIT_MIN_SN
     847FIT_NSIGMA
     848FIT_PADDING
     849FIT_RADIUS
     850GAIN
     851GAL_MODEL
     852GAL_MOMENTS_RADIUS
     853INNER_RADIUS
     854INPUT
     855MASK
     856NOISE
     857NSUBSET
     858OUTER_RADIUS
     859OUTPUT
     860OUTPUT_MODE
     861PEAK_NSIGMA
     862PSF_MODEL_N
     863PSF_MOMENTS_RADIUS
     864PSF_SHAPE_NSIGMA
     865RDNOISE
     866SATURATE
     867SMOOTH_NSIGMA
     868SMOOTH_SIGMA
     869XMAX
     870XMIN
     871YMAX
     872YMIN
     873\end{verbatim}
     874
     875\subsection{Command-Line Arguments and Options}
     876
     877\subsection{Input \& Output Data Formats}
     878
     879\section{Sample Tests}
     880
    734881\end{document}
Note: See TracChangeset for help on using the changeset viewer.