IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39948 for trunk


Ignore:
Timestamp:
Jan 17, 2017, 10:49:05 AM (10 years ago)
Author:
eugene
Message:

various edits

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/release.2015/ps1.analysis/analysis.tex

    r39946 r39948  
    237237\code{psLib}.  Components of the photometry code were integrated into
    238238the IPP's mid-level astronomy data analysis toolkit called
    239 \code{psModules}.  The resulting software, `PSPhot', can be used either
     239\code{psModules}.  The resulting software, `\code{psphot}', can be used either
    240240as a stand-alone C program, or as a set of library functions which may
    241241be integrated into other programs
     
    243243\note{add refs to the psLib and psModules ADDs}
    244244
    245 The main version of PSPhot is a stand-alone program which is run on a
     245The main version of \code{psphot} is a stand-alone program which is run on a
    246246single image, or a group of related images representing the data read
    247247from a camera in a single exposure.  The images are expected to have
     
    253253  integrated library call}
    254254
    255 The version called PSPhotStack accepts a set of images, each
     255The version called \code{psphotStack} accepts a set of images, each
    256256representing the same patch of sky in a different filter, nominally
    257257the full $grizy$ filter set for the analysis of the PS1 PV3 stack
    258258images, though where insufficient data were available in a given
    259259filter, a subset of these filters was processed as a group.  As
    260 discussed in detail below, the PSPhotStack analysis includes the
     260discussed in detail below, the \code{psphotStack} analysis includes the
    261261capability of measuring forced PSF photometry in some filter images
    262262based on the position of sources detected in the other filters.  It
     
    265265photometry.
    266266
    267 Another version of PSPhot used in the PV3 analysis is called
    268 PSPhotFullForce.  In this version, a set of image all representing the
     267Another version of \code{psphot} used in the PV3 analysis is called
     268\code{psphotFullForce}.  In this version, a set of image all representing the
    269269same pixels are processed together, with the positions of sources to
    270270be analysed loaded from a supplied file.  In this version of the
     
    276276supplied guess model. 
    277277
    278 \section{PSPhot Design Goals}
    279 
    280 PSPhot has a number of important requirements that it must meet, and a
     278\section{\code{psphot} Design Goals}
     279
     280\code{psphot} has a number of important requirements that it must meet, and a
    281281number of design goals which we believe will help to make usable in a
    282282wide range of circumstances.  The critical requirements of the
    283 Pan-STARRS IPP which drive the requirements for PSPhot:
     283Pan-STARRS IPP which drive the requirements for \code{psphot}:
    284284
    285285\begin{itemize}
    286 \item {\bf 10 millimagnitude photometric accuracy}.  For PSPhot, this
     286\item {\bf 10 millimagnitude photometric accuracy}.  For \code{psphot}, this
    287287  implies that the measured photometry of stellar sources must be
    288288  substantially better than this 10 mmag since the photometry error
    289289  per image is combined with an error in the flat-field calibration
    290290  and an error in measuring the atmospheric effects.  We have set a
    291   goal for PSPhot of 3mmag photometric consistency for bright stars
     291  goal for \code{psphot} of 3mmag photometric consistency for bright stars
    292292  between pairs of images obtained in photometric conditions at the
    293293  same pointing, ie to remove sensitivity to flat-field errors.  This
     
    298298\item {\bf 10 milliarcsecond astrometric accuracy}. Relative
    299299  astrometric calibration depends on the consistency of the individual
    300   measurements.  The measurements from PSPhot must be sufficiently
     300  measurements.  The measurements from \code{psphot} must be sufficiently
    301301  representative of the true source position to enable astrometric
    302302  calibration at the 10mas level.  The error in the individual
    303303  measurements will be folded together with the errors introduced by
    304304  the optical system, the effects of seeing, and by the available
    305   reference catalogs.  We have set a goal for PSPhot of 5mas
     305  reference catalogs.  We have set a goal for \code{psphot} of 5mas
    306306  consistency between the true source postion and the measured
    307307  position given reasonable PSF variations under simulations.  This
    308308  level must be reached for images with 250 mas pixels, implying
    309   PSPhot must introduce measurement errors less than 1/50th of a
     309  \code{psphot} must introduce measurement errors less than 1/50th of a
    310310  pixel. The choice of 32 bit floating point data values for the
    311311  source centroids places a numerical limit of 1e-7 on the accuracy of
     
    315315\end{itemize}
    316316
    317 The design goals for PSPhot are chosen to make the program flexible,
     317The design goals for \code{psphot} are chosen to make the program flexible,
    318318general, and able to meet the unknown usages cases future projects may
    319319require:
     
    328328  naturally incorporate 2-D variations.
    329329
    330 \item {\bf Flexible non-PSF models} PSPhot must be able to represent
     330\item {\bf Flexible non-PSF models} \code{psphot} must be able to represent
    331331  PSF-like sources as well as non-PSF sources (e.g., galaxies).  It
    332332  must be easy to add new source models as interesting representations
    333333  of sources are invented.
    334334
    335 \item {\bf Clean code base} PSPhot should incorporate a high-degree of
     335\item {\bf Clean code base} \code{psphot} should incorporate a high-degree of
    336336  abstraction and encapsulation so that changes to the code structure
    337337  can be performed without pulling the code apart and starting from scratch.
    338338
    339 \item {\bf PSF validity tests} PSPhot should include the ability to
     339\item {\bf PSF validity tests} \code{psphot} should include the ability to
    340340  choose different types of PSF models for diffent situations, or to
    341341  provide the user with methods for assessing the different PSF models.
    342342
    343 \item {\bf Careful systematic corrections} PSPhot must carefully
     343\item {\bf Careful systematic corrections} \code{psphot} must carefully
    344344  measure and correct for the photometric and astrometric trends
    345345  introduced by using analytical PSF models.
    346346
    347 \item {\bf User Configurable} PSPhot should allow users to change the
     347\item {\bf User Configurable} \code{psphot} should allow users to change the
    348348  options easily and to allow different approaches to the analysis.
    349349
    350350\end{itemize}
    351351
    352 \section{PSPhot Analysis Process}
     352\section{\code{psphot} Analysis Process}
    353353
    354354\subsection{Overview}
    355355
    356 The PSPhot analysis is divided into several major stages:
     356The \code{psphot} analysis is divided into several major stages:
    357357
    358358\begin{enumerate}
     
    383383\end{enumerate}
    384384
    385 PSPhot is highly configurable.  Users may choose via the configuration
     385\code{psphot} is highly configurable.  Users may choose via the configuration
    386386system which of the above analyses are performed.  This is useful for
    387387testing, but also allows for specialized use cases.  For example, the
     
    405405references to the mask and variance are provided in the configuration
    406406information.  As in the stand-alone C-program, the variance and mask may
    407 be constructed automatically by PSPhot.
     407be constructed automatically by \code{psphot}.
    408408
    409409The mask is represented as a 16-bit integer image in which a value of
     
    445445
    446446\begin{table*}
    447 \caption{\label{tab:mask_values} PSPhot / GPC1 Mask Image Pixel Values}\vspace{-0.5cm}
     447\caption{\label{tab:mask_values} \code{psphot} / GPC1 Mask Image Pixel Values}\vspace{-0.5cm}
    448448\begin{center}
    449449\begin{tabular}{lcl}
     
    650650The peaks detected in the image may correspond to real sources, but
    651651they may also correspond to noise fluctuations, especially in the
    652 wings of bright stars.  PSPhot attempts to identify peaks which may be
     652wings of bright stars.  \code{psphot} attempts to identify peaks which may be
    653653formally significant, but are not locally significant.  It first
    654654generates a set of ``footprints'', contiguous collections of pixels in
     
    830830\subsubsection{PSF Model vs Source Model}
    831831
    832 The PSF model used by \code{psphot} consists of an analytical function
     832The point-spread-function (PSF) of an image describes the shape of all
     833unresolved sources in the image.  In a typical wide-field image, the
     834shape of unresolved sources varies as a function of position in the
     835image.  The full PSF thus needs to include a model with parameters
     836which vary across the image.
     837
     838The PSF used by \code{psphot} consists of an analytical function
    833839combined with a pixelized representation of the residual differences
    834840between the analytical model and the true PSF.  Both the shape
     
    837843
    838844Within \code{psphot}, several analytical models may be used to
    839 describe the PSF, but all share a few common characteristics.
    840 
    841 Any source in an image may be represented by some analytical model,
    842 for example, a 2-D elliptical Gaussian:
     845describe the smooth portion of the PSF, but all share a few common
     846characteristics.  As an example, a simple model consists of a 2-D
     847elliptical Gaussian:
    843848\begin{eqnarray}
    844849f(x,y) & = & I_o e^{-z} + S  \\
     
    847852    y  & = & y_{\rm ccd} - y_o
    848853\end{eqnarray}
    849 The source model will have a variety of model parameters, in this case
    850 the centroid coordinates ($x_o, y_o$), the elliptical shape parameters
    851 ($\sigma_x, \sigma_y, \sigma_{\rm xy}$), the model normalization
    852 ($I_o$) and the local value of the background ($S$).  A specific
    853 source will have a particular set of values for these different
    854 parameters.
    855 
    856 The point-spread-function (PSF) of an image describes the shape of all
    857 unresolved sources in the image.  In a typical image, the shape of
    858 point sources is not well described by a single function.  Instead,
    859 the shape will vary as a function of position in the image.  The PSF
    860 model therefore must describe the parameter variation as a function of
    861 the position of the source on the image.  Note that the source model
    862 consists of a certain number of parameters which are defined by the
    863 PSF model, and another set of parameters which are independent from
    864 source to source.  For the case of the elliptical Gaussian model, the
    865 PSF parameters would be the shape terms ($\sigma_x, \sigma_y,
    866 \sigma_{\rm xy}$) while the independent parameters would be the
    867 centroid, normalization and local sky values ($x_o, y_o, I_o, S$).
    868 Thus these parameters are each a function of the source centroid
     854Here the model parameters consist of the centroid coordinates ($x_o,
     855y_o$), the elliptical shape parameters ($\sigma_x, \sigma_y,
     856\sigma_{\rm xy}$), the model normalization ($I_o$) and the local value
     857of the background ($S$). 
     858
     859A specific source will have a particular set of values for the model
     860parameters, some of which depend on the PSF model and the position of
     861the source in the image, while the rest are unique to the individual
     862source.  For the case of the elliptical Gaussian model, the PSF
     863parameters would be the shape terms ($\sigma_x, \sigma_y, \sigma_{\rm
     864  xy}$) while the independent parameters would be the centroid,
     865normalization and local sky values ($x_o, y_o, I_o, S$).  Thus the
     866shape parameters are each a function of the source centroid
    869867coordinates:
    870868\begin{eqnarray}
    871 \sigma_x    & = & f_1(x,y) \\
    872 \sigma_y    & = & f_2(x,y) \\
    873 \sigma_{xy} & = & f_3(x,y) \\
     869\sigma_x    & = & f_1(x_{\rm ccd},y_{\rm ccd}) \\
     870\sigma_y    & = & f_2(x_{\rm ccd},y_{\rm ccd}) \\
     871\sigma_{xy} & = & f_3(x_{\rm ccd},y_{\rm ccd}) \\
    874872\end{eqnarray}
    875 PSPhot represents the variation in the PSF parameters as a function of
     873\code{psphot} represents the variation in the PSF parameters as a function of
    876874position in the image in two possible ways, specified by the
    877875configuration.  The first option is to use a 2-D polynomial which is
     
    890888some of the observed PSF variations in the images
    891889
    892 % XXX specify the rule for the polynomial order and grid scale
    893 % XXX discuss the improvements in the astrometric modeling PV1 - PV3
    894 
    895 PSPhot uses a single structure to represent the source model and
    896 another structure to represent the PSF model.  The source model
    897 structure consists of the collection of measured source model
    898 parameters, carried as a \code{psLib} vector (\code{psVector}) along
    899 with an equal-length vector with the parameter errors.  The structure
    900 also includes an integer giving the identifier of the model used in
    901 the particular case, as well as model fit statistics such as the
    902 Chi-Square of the fit and the magnitude representation of the ratio
    903 between the model flux and an aperture flux (see below for more
    904 details on this value).
    905 
    906 The PSPhot representation of the PSF consists of an array of
    907 polynomials, each representing the variation in the source model PSF
    908 parameters (\code{psArray} of \code{psPolynomial2D}).  The PSF model
    909 structure also includes the same integer used to identify which model
    910 corresponds to particular instance of the PSF.  At the moment, the
    911 number of PSF parameters is a fixed number (4) fewer than the number
    912 of parameters of the corresponding source model.  For example, the
    913 elliptical Gaussian model uses 7 parameters to represent the source and
    914 3 for the PSF model. 
    915 
    916 PSPhot is written so that the source detection, measurement, and
    917 classification code does not depend on the specific form of the
    918 available source model functions.  Access to the characteristics of
    919 the models is provided through a simple function abstraction method.
    920 Throughout PSPhot, there are many places where it is necessary for the
    921 code to refer to an aspect of the source or PSF model.  Often, these
    922 quantities are needed deep within other parts of the code.  For
    923 example, when attempting to fit the pixel flux values for a source,
    924 it is necessary to generate a guess for the model parameters.  Or, in
    925 order to limit the domain of the fit, it is necessary to determine an
    926 isophotal radius for a model. 
    927 
    928 In order to avoid having the code depend on the specific form of a
    929 model, the function calls needed in these types of circumstances are
    930 abstracted, and a method is provided to return the necessary function
    931 to the higher-level software.  For example, each model type has its
    932 own function to define an initial guess for the model, or a function
    933 to determine the radius for a given flux level.  These are then
    934 registered as part of the model function code.  Another function is
    935 then used to return the appropriate function for a specific model
    936 type.  For example, the \code{psModelLookup_GetFunction} will return
    937 the \code{psModelLookup} function for a given model type.  This
    938 mechanism makes it very easy to add new model functions into the
    939 PSPhot code base.  To add a new model function, the programmer simply
    940 defines a new model name (a string), the set of all necessary model
    941 lookup functions, and places the reference to the model code at the
    942 appropriate location in the psModelInit.c routine.
    943 
    944 When a new model is provided to PSPhot, it is not necessary to specify
    945 the intended use of the source model function (ie, PSF-like source,
    946 galaxy, comet, etc).  Any model can be used for the PSF model, or to
    947 describe the flux distributions of the non-PSF sources.  The code
    948 currently uses a fixed translation between the source model parameters
    949 and the PSF model parameters.  It also defines a specific order for
    950 the 4 independent parameters. 
     890\note{need to describe fitting the pixel residual image}
     891
     892\note{write up the fitting process to define the grid?}
     893
     894\notespecify the rule for the polynomial order and grid scale}
     895
     896\note{discuss the improvements in the astrometric modeling PV1 - PV3}
     897
     898Several analytical functions which are likely candidates to describe
     899the smooth portion of the PSF are available in \code{psphot}:
     900\begin{itemize}
     901\item Gaussian : $f = I_0 e^{-z}$
     902\item Pseudo-Gaussian : $f = I_0 (1 + z + \frac{1}{2} z^2 + \frac{1}{6} z^3)^{-1}$ \code{[PGAUSS]}
     903\item Variable Power-Law : $f = I_0 (1 + z + z^{\alpha})^{-1}$ \code{[RGAUSS]}
     904\item Steep Power-Law : $f = I_0 (1 + \kappa z + z^{2.25})^{-1}$ \code{[QGAUSS]}
     905\item PS1 Power-Law : $f = I_0 (1 + \kappa z + z^{1.67})^{-1}$ \code{[PS1_V1]}
     906\end{itemize}
     907The Pseudo-Gaussian is a Taylor expansion of the Gaussian and is used
     908by Dophot \citep{1993PASP..105.1342S}.  The latter profiles are
     909similar to the Moffat profile form
     910\citep{1969AA.....3..455M,1983AA...126..278B}, with small differences.
     911A user may choose to try more than one analytical function for a given
     912image.  As discussed below (Section~\ref{sec:psf.model.choice}),
     913\code{psphot} can automatically choose the best model based on the
     914quality of the PSF fits.
     915
     916For the PS1 GPC1 analysis, we used the \code{PS1_V1} model, which we
     917found by experimentation to match well to the observed profiles
     918generated by PS1.  Figure~\ref{fig:radial.profiles} shows example
     919radial profiles for moderately bright stars in fairly good (0.9
     920arcsec) and poor (2.2 arcsec) seeing.  Using a fixed power-law
     921exponent results in somewhat faster profile fitting compared to the
     922variable power-law exponent model.
     923
     924The analytical models in \code{psphot} are written with a high degree
     925of code abstraction making it relatively easy to add different
     926analytical models to the software.  The same portion of code used to
     927describe the analytical portion of the PSF sources is also used to for
     928galaxy models.
     929
     930% moffat : 1969A&A.....3..455M
     931% buonanno : 1983A&AS...51...83B
     932
     933\begin{figure}[htbp]
     934  \begin{center}
     935  \includegraphics[width=\hsize]{{pics/radial.profiles}.\plotext}
     936  \caption{\label{fig:radial.profiles} Radial profiles of stellar images from PS1.  These two
     937    profiles illustrate the radial trend of the PS1 PSFs for a star
     938    with FWHM 0.9 arcsec (red) and 2.2 arcsec (blue).  The black line
     939    shows the PSF model with radial trend of the form $(1 + \kappa r^2 + r^{3.33})^{-1}$.}
     940  \end{center}
     941\end{figure}
    951942
    952943\subsubsection{Candidate PSF Source Selection}
     
    955946The first stage of determining the PSF model for an image is to
    956947identify a collection of sources in the image which are {\em likely}
    957 to be PSF-like.  PSPhot uses the source moments to make the initial
    958 guess at a collection of PSF-like sources.  At this point, the program
    959 has measured the second order moments for all sources identified by
    960 their peaks, as well as an approximate signal-to-noise ratio.  All
    961 sources with a S/N ratio greater than a user-defined parameter
    962 (\code{PSF_SHAPE_NSIGMA} = 20.0) are selected by PSPhot, though
    963 sources which have more than a certain number of saturated pixels are
    964 excluded at this stage.  PSPhot then examines the 2-D plane of
    965 $\sigma_x, \sigma_y$ in search of a concentrated clump of sources (see
    966 Figure~\ref{fig:moment.class}).  To
    967 do this, it constructs an artificial image with pixels representing
    968 the value of $\sigma_x, \sigma_y$, using a user-defined scale for the
    969 size of a pixel in this artificial image (note that the units of the
    970 $\sigma_x, \sigma_y$ plane are the size of the second-moment in pixels
    971 in the original image).  A typical value for the bin size is
    972 approximately 0.1 image pixels.  The binned $\sigma_x, \sigma_y$ plane
    973 is then examined to find a peak which has a significance greater than
    974 XXX.  Unless the image is extremely sparse, such a peak will be
    975 well-defined and should represent the sources which are all very
    976 similar in shape.  Other sources in the image will tend to land in
    977 very different locations, failing to produce a single peak.  To avoid
    978 detecting a peak from the unresolved cosmic rays, sources which have
    979 second-moments very close to 0 are ignored.  The only danger is if the
    980 PSF is very small and too many of these sources are rejected as cosmic
    981 rays.
     948to be unresolved (i.e., stars).  \code{psphot} uses the source sizes as
     949estimated from the second moments to make the initial guess at a
     950collection of unresolved sources.  At this point, the program has
     951measured the second order moments for all sources identified by their
     952peaks, as well as an approximate signal-to-noise ratio, above the
     953bright threshold.  All sources with a S/N ratio greater than a
     954user-defined parameter (\code{PSF_SN_LIM} = 20.0 for PS1 PV3) are
     955selected by \code{psphot}, though sources which have more than a
     956certain number of saturated pixels are excluded at this stage.  The
     957program then examines the 2-D plane of $\sigma_x, \sigma_y$ in search
     958of a concentrated clump of sources (see
     959Figure~\ref{fig:moment.class}).  To do this, it constructs an
     960artificial image with pixels representing the value of $\sigma_x,
     961\sigma_y$, using $0.1 \sigma_w$ as the size of a pixel in this
     962artificial image.  The binned $\sigma_x, \sigma_y$ plane is then
     963examined to find a significant peak.  Unless the image is extremely
     964sparse, such a peak will be well-defined and should represent the
     965sources which are all very similar in shape.  Other sources in the
     966image will tend to land in very different locations, failing to
     967produce a single peak.  To avoid detecting a peak from the unresolved
     968cosmic rays, sources which have second-moments very close to 0 are
     969ignored.
    982970
    983971Once a peak has been detected in this plane, the centroid and second
     
    985973$\sigma$ of this centroid are selected as likely PSF-like sources in
    986974the image. 
     975
     976\note{work out the logic for selecting the PSF stars}
    987977
    988978\begin{figure}[htbp]
     
    1000990
    1001991\subsubsection{Candidate PSF Source Model Fits}
    1002 
     992\label{sec:psf.model.choice}
    1003993% \note{link to psLibADD}
     994
     995% Madsen:
     996%% http://www2.imm.dtu.dk/pubdb/views/edoc_download.php/3215/pdf/imm3215.pdf
     997% Press
    1004998
    1005999All candidate PSF sources are then fitted with the selected source
    10061000model, allowing all of the parameters (PSF and independent) to vary in
    1007 the fit.  PSPhot uses the Levenberg-Marquardt minimization technique
    1008 for the non-linear fitting.  Non-linear
     1001the fit.  The software uses the Levenberg-Marquardt minimization
     1002technique \citep{Press,Madsen} for the non-linear fitting.  Non-linear
    10091003fitting can be very computationally intensive, particularly for if the
    1010 starting parameters are far from the minimization values.  PSPhot uses
    1011 the first and second moments to make a good guess for the centroid and
     1004starting parameters are far from the minimization values.  The first
     1005and second moments are used to make a good guess for the centroid and
    10121006shape parameters for the PSF models.  Any sources which fail to
    10131007converge in the fit are flagged as invalid.
     
    10151009For the resulting collection of source model parameters, the
    10161010PSF-dependent parameters of the models are all fitted as a function of
    1017 position to a 2-D polynomial.  The order of this polynomial is a
    1018 user-defined parameter.  The fitting process for these polynomials is
    1019 iterative, and rejects the $3-\sigma$ outliers in each of three
    1020 passes.  This fitting technique results in a robust measurement of the
    1021 variation of the PSF model parameters as a function of position
    1022 without being excessively biased by individual sources which fail
    1023 drastically.  Sources whose model parameters are rejected by this
    1024 iterative fitting technique are also marked as invalid and ignored in
    1025 the later PSF model fitting stages.
     1011position using either the 2-D polynomial or the gridded superpixel
     1012representation.  The maximum order of these fits depends on the number
     1013of PSF sources (see Table~\ref{tab:order}).  The fitting process for
     1014these polynomials is iterative, and rejects the $3\sigma$ outliers in
     1015each of three passes.  This fitting technique results in a robust
     1016measurement of the variation of the PSF model parameters as a function
     1017of position without being excessively biased by individual sources
     1018which are not well described by the PSF model (e.g., galaxies which
     1019snuck into the sample).  Sources whose model parameters are rejected
     1020by this iterative fitting technique are also marked as invalid PSF
     1021sources and ignored in the later PSF model fitting stages.
     1022
     1023%% table of orders:
     1024%% N stars | max order | max Ncells
     1025%%  16   |  1; //  4 cells, 4 per cell
     1026%%  54   |  2; //  9 cells, 6 per cell
     1027%% 128   |  3; // 16 cells, 8 per cell
     1028%% 300   |  4; // 25 cells, 12 per cell
     1029%% 576   |  5; // 36 cells, 16 per cell
    10261030
    10271031All of the PSF-candidate sources are then re-fitted using the PSF
    1028 model to specify the dependent model parameter values for each source.
    1029 For example, in the case of the elliptical Gaussian model, the shape
    1030 parameters ($\sigma_x, \sigma_y, \sigma_{xy}$) for each source are
    1031 set by the coordinates of the source centroid and fixed (not allowed
    1032 to vary) in the fitting procedure.  The resulting fitted models are
    1033 then used to determine a metric which tests the quality of the PSF
    1034 model for this particular image. 
    1035 
    1036 The metric used by PSPhot to assess the PSF model is the scatter in
     1032model to specify the PSF-dependent model parameter values for each
     1033source.  For example, in the case of the elliptical Gaussian model,
     1034the shape parameters ($\sigma_x, \sigma_y, \sigma_{xy}$) for each
     1035source are set by the coordinates of the source centroid and fixed
     1036(not allowed to vary) in the fitting procedure.  The resulting fitted
     1037models are then used to determine a metric which tests the quality of
     1038the PSF model for this particular image.
     1039
     1040The metric used by \code{psphot} to assess the PSF model is the scatter in
    10371041the differences between the aperture and fit magnitudes for the PSF
    1038 sources.  The difference between the aperture and fit magnitudes ({\em
    1039 ApResid}) is a critical parameter for any PSF modeling software which
    1040 uses an analytical model to represent the flux distribution of the
    1041 sources in an image.  An approximate correction is measured here, with
    1042 a more detailed correction measured after all source analysis is
    1043 performed.  The PSF model with the best consistency of the aperture
    1044 correction is judged to be the best model.
     1042sources.  This difference is a critical parameter for any PSF modeling
     1043software as it is a measurement of how well the PSF model captures the
     1044flux of the star.  An approximate correction is measured here, with a
     1045more detailed correction measured after all source analysis is
     1046performed (see Section~\ref{sec:aperture.correction}).  The PSF model
     1047with the best consistency of the aperture correction is judged to be
     1048the best model.  \note{are we making a decision on the order or
     1049  anything based on apresid?}
    10451050
    10461051\subsection{Bright Source Analysis}
     
    10761081\subsubsection{Very Bright Stars}
    10771082
    1078 The PSF modeling code fails to fit the wings of highly saturated stars
    1079 if the core of the star is too contaminated by saturated pixels. For
    1080 stars with estimated instrumental magnitudes brighter than XXX, we fit
    1081 and subtract a radial profile modeled with a spline (?).
    1082 
    1083 \note{more here}
     1083The standard \code{psphot} PSF modeling code fails to fit the wings of
     1084highly saturated stars, especially if the core of the star is too
     1085contaminated by saturated pixels.  For stars with more than a single
     1086saturated pixel, we model the radial profile of the logarithmic
     1087instrumental flux in logarithmically spaced radial bins.  For each
     1088radial bin, we determine the median of the log-flux.  This median
     1089profile is then interpolated to generate the full radial flux
     1090distribution.
     1091
     1092% logRdel = 0.1
     1093% logRmax = log(320)
    10841094
    10851095\subsubsection{Fast Ensemble PSF Fitting}
     
    11131123diagonal square matrix.  The dimension is the number of sources,
    11141124likely to be 1000s or 10,000s.  Direct inversion of the matrix would
    1115 be computationally very slow.  However, an interative solution quickly
     1125be computationally very slow.  However, an iterative solution quickly
    11161126yields a result with sufficient accuracy.  In the iterative solution,
    11171127a guess at the solution $\bar{A}$ is made assuming $M_{i,j}$ is purely
     
    11191129compared with the observed vector $\bar{F_j}$.  The difference is used
    11201130to modify the initial guess.  This proces is repeated several times to
    1121 achieve a good convergence.
     1131achieve a good convergence.  Convergence is quick (a few iterations)
     1132because of the highly diagonal matrix with small off-diagonal terms:
     1133the dot product of source $i$ and source $j$ is 1 where $i = j$ and
     1134much less than 1 where $i \noteq j$.
    11221135
    11231136Once a solution set for $A_i$ is found, all of the sources are
    1124 subtracted from the by applying these values to the unit-flux PSF.
     1137subtracted from the image by applying these values to the unit-flux
     1138PSF.
    11251139
    11261140\subsubsection{Full PSF Model Fitting}
     
    11281142% \note{review the discussion below}
    11291143
    1130 Once a PSF model has been selected for an image, PSPhot attempts to
     1144Once a PSF model has been selected for an image, \code{psphot} attempts to
    11311145fit all of the detected sources, above a user-defined signal-to-noise
    11321146ratio with the PSF model.  For these fits, the dependent parameters
    11331147are fixed by the PSF model and only the 4 independent source model
    1134 parameters are allowed to vary in the fit.  PSPhot again uses
     1148parameters are allowed to vary in the fit.  \code{psphot} again uses
    11351149Levenberg-Marquardt minimization for the non-linear fitting.  The
    11361150sources are fitted in their S/N order, starting with the brightest and
    1137 working down to the user-specified limit.
    1138 
    1139 Once a solution has been achieved for a source, PSPhot attempts to
     1151working down to the user-specified limit, with the other sources
     1152subtracted as discussed above.
     1153
     1154\node{code review for the next bit}
     1155
     1156Once a solution has been achieved for a source, \code{psphot} attempts to
    11401157judge the quality of the PSF model as a representation of the source
    11411158shape.  To do this, it calculates the next step of the minimization
     
    11491166$\sigma_y$.  For a generic model, the shape parameters may be defined
    11501167differently, but there should always be two parameters which scale the
    1151 source size in two dimensions.  Currently, PSPhot requires the two
     1168source size in two dimensions.  Currently, \code{psphot} requires the two
    11521169relevant shape parameters to be the first two dependent parameters in
    11531170the list of model parameters (ie, parameters 4 \& 5).
     
    11721189as a likely defect. 
    11731190
    1174 At this stage of the analysis, PSPhot uses two additional indicators
     1191At this stage of the analysis, \code{psphot} uses two additional indicators
    11751192to identify good and poor PSF fits.  The first of these is the
    11761193signal-to-noise ratio.  It is possible for the peak finding algorithm
     
    11831200smoothed image).  The fit can either fail to converge or it can
    11841201converge on a fit with very low or negative peak flux / flux
    1185 normalization.  PSPhot will flag any non-convergent PSF fit and any
     1202normalization.  \code{psphot} will flag any non-convergent PSF fit and any
    11861203source with PSF S/N ratio lower than a user-defined cutoff.  It is
    11871204also useful to identify very poor fits by setting a maximum Chi-Square
     
    12241241\label{sec:source.size}
    12251242
     1243\note{is this in the right place?}
     1244
    12261245After the PSF model has been fitted to all sources, and the Kron flux
    1227 has been measured for all sources, PSPhot uses these two measurements,
     1246has been measured for all sources, \code{psphot} uses these two measurements,
    12281247along with some additional pixel-level analysis, to determine the size class
    12291248of the source.  If the source is large compared to a PSF, it is
     
    12331252PSF, it is considered to be a {\em cosmic ray} and masked.
    12341253
    1235 Extended sources are identified as those for which the Kron magnitude is
    1236 significantly brighter than the PSF magnitude when compared to a PSF
    1237 star.  The value $dMagKP = m_{\rm Kron} - m_{\rm PSF}$, the difference between the PSF
    1238 and Kron magnitudes, is calculated for each source.  The median of
    1239 $dMagKP$ is calculated for the PSF stars.  This median is subtracted
    1240 from $dMagKP$ for each star.  The result is divided by the quadrature
    1241 error of the PSF and Kron magnitudes and called \code{extNsigma}.  If
    1242 \code{extNsigma} is larger than \code{PSPHOT.EXT.NSIGMA.LIMIT} (3.0),
    1243 the source is considered to be extended.
     1254Extended sources are identified as those for which the Kron magnitude
     1255is significantly brighter than the PSF magnitude when compared to a
     1256PSF star.  The value $\delta M_{rm KP} = m_{\rm Kron} - m_{\rm PSF}$,
     1257the difference between the PSF and Kron magnitudes, is calculated for
     1258each source.  The median of $\delta M_{rm KP}$ is calculated for the
     1259PSF stars.  This median is subtracted from $\delta M_{rm KP}$ for each
     1260star.  The result is divided by the quadrature error of the PSF and
     1261Kron magnitudes and called \code{extNsigma}.  If \code{extNsigma} is
     1262larger than \code{PSPHOT.EXT.NSIGMA.LIMIT} (3.0), the source is
     1263considered to be extended.
    12441264
    12451265Cosmic Rays are identified by a combination of the Kron magnitude and
     
    12541274and the associated pixels are masked.
    12551275
     1276\note{how are / were these parameters set?}
     1277
    12561278\subsubsection{Non-PSF Sources}
    12571279
     
    12631285aperture) and working to a user defined S/N limit. 
    12641286
    1265 PSPhot will use the user-selected galaxy model to attempt the galaxy
     1287\code{psphot} will use the user-selected galaxy model to attempt the galaxy
    12661288model fits.  In the configuration system, the keyword \code{GAL_MODEL}
    12671289is set to the model of interest.  All suspected extended sources are
     
    12941316After a first pass through the image, in which the brighter sources
    12951317above a high threshold level have been detected, measured, and
    1296 subtracted, PSPhot optionally begins a second pass at the image.  In
     1318subtracted, \code{psphot} optionally begins a second pass at the image.  In
    12971319this stage, the new peaks are detected on the image with the bright
    12981320sources subtracted.  In this pass, the peak detection process uses the
     
    13101332\subsection{Extended Source Analysis}
    13111333
    1312 \note{intro paragraph: After the initial, fast analysis of the image
    1313   relying primarily on the PSF model, a complete analysis of the
    1314   extended source properties may be performed.  For PS1 processing,
    1315   this step is the nightly (PV0) analysis of individual exposures and
    1316   only performed for the stacks. }
     1334After the initial, fast analysis of the image relying primarily on the
     1335PSF model, a complete analysis of the extended source properties may
     1336be performed.  For PS1 processing, this step is the nightly (PV0)
     1337analysis of individual exposures and only performed for the stacks.
    13171338
    13181339\subsubsection{Radial Profiles}
     
    13261347contour and radial profile. 
    13271348
    1328 In order to facilitate the Petrosian photometry analysis below, PSPhot
     1349In order to facilitate the Petrosian photometry analysis below, \code{psphot}
    13291350generates a radial profile for each suspected galaxy.  This analysis
    13301351starts by generating a radial profile in 24 azimuthal segments.  Near
     
    13411362profiles, pairs of radial profiles from opposite sides of the source
    13421363are compared.  Any masked values are replaced by the corresponding
    1343 value in the other profile.  The minimum of both profiles is the kept
     1364value in the other profile.  The minimum of both profiles is then kept
    13441365for both profiles.  The result of this analysis is a set of profiles
    13451366of the form $f_i(r_i)$.  In this case, $f_i$ is effectively the
    13461367surface brightness for each radius in instrumental counts per pixel.
    13471368
    1348 The surface brightness profiles are then used to define the radial
     1369The surface brightness profiles are then used to define the azimuthal
    13491370contour at a specific isophotal level.  This contour will be used to
    13501371rescale the radial profiles into a single set of profiles normalized
     
    13661387(\code{RADIAL.ANNULAR.BINS.LOWER} \&
    13671388\code{RADIAL.ANNULAR.BINS.UPPER}).  For each source, the resulting
    1368 surface brightness profile is saved in the output cmf-file as an
    1369 N-element value in the FITS table (\code{PROF_SB}).  The flux at each
    1370 radial position and the fill-factor (fraction of pixels used to the
    1371 total possible) as also saved as equal-length vectors in the FITS
    1372 table (\code{PROF_FLUX} and \code{PROF_FILL}).  The values of the
    1373 radial bins are saved in the cmf header (\code{RMIN_NN},
    1374 \code{RMAX_NN}).
     1389surface brightness profile is saved in the output FITS table as a
     1390vector (\code{PROF_SB}).  The flux at each radial position and the
     1391fill-factor (fraction of pixels used to the total possible) are also
     1392saved as equal-length vectors in the FITS table (\code{PROF_FLUX} and
     1393\code{PROF_FILL}).  The values of the radial bins are saved in the
     1394output file FITS header (\code{RMIN_NN}, \code{RMAX_NN}).
    13751395
    13761396% \note{these profiles are not saved in PSPS}
     
    13821402aperture which can be determined for galaxies without significant
    13831403biases as a function of distance.  Since surface brightness in a
    1384 resolved source is conserved, using a ratio of surface brightness to
    1385 define a spatial scale results in a spatial scale which is constant
    1386 regardless of galaxy distance.
     1404resolved source is conserved as a function of distance, using a ratio
     1405of surface brightness to define a spatial scale results in a spatial
     1406scale which is constant regardless of galaxy distance.
    13871407
    13881408To measure the Petrosian radius and flux, we start by defining a
     
    14401460
    14411461Preliminary Kron radius and flux values \citep{1980ApJS...43..305K}
    1442 are calculated soon after sources are detected (Section~\ref{sec:moments}).
    1443 However, these preliminary values are not accurate due to the
    1444 window-functions applied.  After sources have been characterized and
    1445 the PSF model is well-determined, the Kron parameters are
    1446 re-calculated more carefully.  In this version of the calculation, the
    1447 image is first smoothed by Gaussian kernel with $\sigma = 1.7$ pixels,
    1448 corresponding to a FWHM of 1.0\arcsec\ in the PS1 stack images.  Next,
    1449 the Kron radius is determined in an iterative process: the first
    1450 radial moment is measured using the pixels in an aperture 6$\times$
    1451 the first radial moment from the previous iteration.  On the first
    1452 iteration, the sky radius is used in place of the first radial moment.
    1453 By default, 2 iterations are performed.  The Kron radius is defined
    1454 the be 2.5$\times$ the first radial moment.  The Kron flux is the sum
    1455 of pixel fluxes within the Kron radius.  We also calculate the flux in
    1456 two related annular apertures: the Kron inner flux is the sum of pixel
    1457 values for the annulus $R_1 < r < 2.5 R_1$, while the Kron outer flux
    1458 is the sum of pixel values for $2.5 R_1 < r < 4 R_1$.
     1462are calculated soon after sources are detected
     1463(Section~\ref{sec:moments}).  However, these preliminary values are
     1464not accurate due to the window-functions applied.  After sources have
     1465been characterized and the PSF model is well-determined, the Kron
     1466parameters are re-calculated more carefully.  In this version of the
     1467calculation, following the algorithm described by \cite{sextractor},
     1468the image is first smoothed by Gaussian kernel with $\sigma = 1.7$
     1469pixels, corresponding to a FWHM of 1.0\arcsec\ in the PS1 stack
     1470images.  Next, the Kron radius is determined in an iterative process:
     1471the first radial moment is measured using the pixels in an aperture
     14726$\times$ the first radial moment from the previous iteration.  On the
     1473first iteration, the sky radius is used in place of the first radial
     1474moment.  By default, 2 iterations are performed.  The Kron radius is
     1475defined the be 2.5$\times$ the first radial moment.  The Kron flux is
     1476the sum of pixel fluxes within the Kron radius.  We also calculate the
     1477flux in two related annular apertures: the Kron inner flux is the sum
     1478of pixel values for the annulus $R_1 < r < 2.5 R_1$, while the Kron
     1479outer flux is the sum of pixel values for $2.5 R_1 < r < 4 R_1$.
    14591480
    14601481Two details in the calculation above should be noted.  First, for
     
    14791500effect of reducing the impact of pixels which include flux from near
    14801501neighbors.
     1502
     1503\note{give a test example}
    14811504
    14821505\subsubsection{Convolved Galaxy Model Fits}
     
    15461569a function of the Sersic index.
    15471570
    1548 The PSF-convolved galaxy model fitting analysys uses the
     1571\note{special handling for central pixel}
     1572
     1573The PSF-convolved galaxy model fitting analysis uses the
    15491574Levenberg-Marquardt minimization method to determine the best fit.  In this
    15501575process, the $\chi^2$ value to be minimized is:
     
    15871612The gradient vector and Hessian matrix are used in the
    15881613Levenberg-Marquardt minimization analysis using the standard
    1589 techinique of determining a step from the current set of model
     1614technique of determining a step from the current set of model
    15901615parameters to a new set by solving the matrix equation:
    15911616\[
     
    16111636(galaxy model) image to be convolved before multiplying by the PSF
    16121637model profile at that radial coordinate.  This approximation reduces
    1613 the number of multiplications by a factor of near 8 for larger radii.
     1638the number of multiplications by a factor of \approx 8 for larger radii.
    16141639For the small size of the PSF model used to convolve the galaxy model
    16151640images, it was found that this direct convolution was faster than
    16161641using an FFT-based convolution.
    16171642
    1618 % \note{(examples?)}
     1643\note{examples?  show timing comparisons?}
    16191644
    16201645For the Exponential and DeVaucouleur fits, all parameters are fitted
     
    16391664previous, values in the grid above.  E.g., if the minimum fitted index
    16401665value is 3.0, then the LMM fits are performed using $n$ = 2.5, 3.0, 3.5.
    1641 The resulting $\chi^2$ values are then used to perform quadratid
    1642 interpolation to find the index $n$ which produces the locally minium
     1666The resulting $\chi^2$ values are then used to perform quadratic
     1667interpolation to find the index $n$ which produces the locally minimum
    16431668$\chi^2$ value.  Finally, this best-fit index value is held constant
    16441669while Levenberg-Marquardt minimization is used to find the best fit
     
    16531678important than an accurate total magnitude.  In the case of PS1, the image
    16541679quality variations for stacks of different filters presents a serious
    1655 challenge for the determination of precise colors.  PSPhot determines
     1680challenge for the determination of precise colors.  \code{psphot} determines
    16561681a set of PSF-matched radial aperture flux measurements in order to
    16571682minimize the impact of the stack image quality variations.
    16581683
    1659 In PSPhotStack, the stack analysis version of PSPhot, the 5 filter
     1684In \code{psphotStack}, the stack analysis version of \code{psphot}, the 5 filter
    16601685images are processed together.  After the PSF models have been fitted
    16611686and a best set of galaxy models have been determined, three sets of
     
    16831708
    16841709\subsection{Aperture Correction}
    1685 
    1686 The important concept here is that an analytical model will always
    1687 fail to describe the flux of the sources at some level.  In the end,
    1688 all astronomical photometry is in some sense a relative measurement
    1689 between two images.  Whether the goal is calibration of a science
    1690 image taken at one location to a standard star image at another
    1691 location, or the goal is simply the repetitive photometry of the same
    1692 star at the same location in the image, it is always necessary to
    1693 compare the photometry between two images.  If this measurement is to
    1694 be consistent, then the measurement must represent the flux of the
    1695 stars in the same way regardless of the conditions under which the
    1696 images were taken, at least within some range of normal image
    1697 conditions.  So, for example, two images with different image quality,
    1698 or with different tracking and focus errors, will have different PSF
    1699 models.  Since an analytical model will always fail to represent the
    1700 flux of the star at some level, the measured flux of the same source
    1701 in the two images will be different (even assuming all other
    1702 atmospheric and instrumental effects have been corrected).  The
    1703 amplitude of the error will by determined by how inconsistently the
    1704 models represent the actual source flux.  For example, if the first
    1705 image PSF model flux is consistently 10\% too low and the second is 5\%
    1706 too high, then the comparison between the two images will be in error
    1707 by 15\%
    1708 
    1709 Aperture photometry avoids these problems, by trading for other
    1710 difficulties.  In aperture photometry, if a large enough aperture is
    1711 chosen, the amount of flux which is lost will be a small fraction of
    1712 the total source flux.  Even more importantly, as the image conditions
    1713 change, the amount lost will change by an even smaller fraction, at
    1714 least for a large aperture.  This can be seen by the fact that the
    1715 dominant variations in the image quality are in the focus, tracking
    1716 and seeing.  All of these errors initially affect the cores of the
    1717 stellar images, rather than the wide wings.  The wide wings are
    1718 largely dominated by scattering in the optics and scattering in the
    1719 atmosphere.  The amplitude and distribution of these two scattering
    1720 functions do not change significantly or quickly for a single
    1721 telescope and site. 
     1710\label{sec:aperture.correction}
     1711
     1712A PSF model will always fail to describe the flux of the stellar
     1713sources at some level.  For high-precision photometry, we need to be
     1714able to correct for the difference between the PSF model fluxes and
     1715the total flux of the sources.  In the end, all astronomical
     1716photometry is in some sense a relative measurement between two images.
     1717Whether the goal is calibration of a science image taken at one
     1718location to a standard star image at another location, or the goal is
     1719simply the repetitive photometry of the same star at the same location
     1720in the image, it is always necessary to compare the photometry between
     1721two images.  If this measurement is to be consistent, then the
     1722measurement must represent the flux of the stars in the same way
     1723regardless of the conditions under which the images were taken, at
     1724least within some range of normal image conditions.  So, for example,
     1725two images with different image quality, or with different tracking
     1726and focus errors, will have different PSF models.  Since an analytical
     1727model will always fail to represent the flux of the star at some
     1728level, the measured flux of the same source in the two images will be
     1729different (even assuming all other atmospheric and instrumental
     1730effects have been corrected).  The amplitude of the error will by
     1731determined by how inconsistently the models represent the actual
     1732source flux
     1733
     1734Aperture photometry attempts to avoid these problems, but introduces
     1735other difficulties.  In aperture photometry, if a large enough
     1736aperture is chosen, the amount of flux which is lost will be a small
     1737fraction of the total source flux.  Even more importantly, as the
     1738image conditions change, the amount lost will change by an even
     1739smaller fraction, at least for a large aperture.  This can be seen by
     1740the fact that the dominant variations in the image quality are in the
     1741focus, tracking and seeing.  All of these errors initially affect the
     1742cores of the stellar images, rather than the wide wings.  The wide
     1743wings are largely dominated by scattering in the optics and scattering
     1744in the atmosphere.  The amplitude and distribution of these two
     1745scattering functions do not change significantly or quickly for a
     1746single telescope and site.
    17221747
    17231748The difficulty for aperture photometry is the need to make an accurate
    17241749measurement of the local background for each source.  As the aperture
    17251750grows, errors in the measurement of the sky flux start to become
    1726 dominant.  If the aperture is too small, then variation in the image
     1751dominant.  If the aperture is too small, then variations in the image
    17271752quality are dominant.  The brighter is the source, the smaller is the
    17281753error introduced by the large size of the aperture.  However, the
    17291754number of very bright stars is limited in any image, and of course the
    17301755brighter stars are more likely to suffer from non-linearity or
    1731 saturation.  PSPhot measures the aperture correction ({\em ApResid})
     1756saturation.  \code{psphot} measures the aperture correction ({\em ApResid})
    17321757for every PSF candidate source and applies this correction to the PSF
    17331758model photometry.
     
    17471772% magnitude}.
    17481773
    1749 %%% PSPhot measures the aperture correction ({\em ApResid}) for every PSF
     1774%%% \code{psphot} measures the aperture correction ({\em ApResid}) for every PSF
    17501775%%% candidate source, then calculates the trend of this correction as a
    17511776%%% function of the magnitude.  This trend is fitted with a line.  The
     
    17621787%%% term.
    17631788
    1764 PSPhot allows a collection of PSF model functions to be tried on all
     1789\code{psphot} allows a collection of PSF model functions to be tried on all
    17651790PSF candidate sources.  For each model test, the above corrected
    17661791ApResid scatter is measured.  The PSF model function with the smallest
    1767 value for the ApResid scatter is then used by PSPhot as the best PSF
     1792value for the ApResid scatter is then used by \code{psphot} as the best PSF
    17681793model for this image.  The number of models to be tested is specified
    17691794by the configuration keyword \code{PSF_MODEL_N}.  The configuration
     
    17721797tested.
    17731798
    1774 Several likely PSF model classes are available within \code{psphot}:
    1775 \begin{itemize}
    1776 \item Gaussian : $f = I_0 e^{-z}$
    1777 \item Pseudo-Gaussian : $f = I_0 (1 + z + \frac{1}{2} z^2 + \frac{1}{6} z^3)^{-1}$ \code{[PGAUSS]}
    1778 \item Variable Power-Law : $f = I_0 (1 + z + z^{\alpha})^{-1}$ \code{[RGAUSS]}
    1779 \item Steep Power-Law : $f = I_0 (1 + \kappa z + z^{2.25})^{-1}$ \code{[QGAUSS]}
    1780 \item PS1 Power-Law : $f = I_0 (1 + \kappa z + z^{1.67})^{-1}$ \code{[PS1_V1]}
    1781 \end{itemize}
    1782 where $z \propto r^2$ ($z = \frac{x^2}{2\sigma_x^2} +
    1783 \frac{y^2}{2\sigma_y^2} + \sigma_{\rm xy} x y $).  The Pseudo-Gaussian
    1784 is a Taylor expansion of the Gaussian and is used by Dophot
    1785 \citep{1993PASP..105.1342S}.  The latter profiles are similar to the
    1786 Moffat profile form \citep{1969AA.....3..455M,1983AA...126..278B},
    1787 with small differences.  For the PS1 GPC1 analysis, we used the
    1788 \code{PS1_V1} model, which we found by experimentation to match well
    1789 to the observed profiles generated by PS1.
    1790 Figure~\ref{fig:radial.profiles} shows example radial profiles for
    1791 moderately bright stars in fairly good (0.9 arcsec) and poor (2.2
    1792 arcsec) seeing.  Using a fixed power-law exponent results in somewhat
    1793 faster profile fitting compared to the variable power-law exponent
    1794 model.
    1795 
    1796 % moffat : 1969A&A.....3..455M
    1797 % buonanno : 1983A&AS...51...83B
    1798 
    1799 \begin{figure}[htbp]
    1800   \begin{center}
    1801   \includegraphics[width=\hsize]{{pics/radial.profiles}.\plotext}
    1802   \caption{\label{fig:radial.profiles} Radial profiles of stellar images from PS1.  These two
    1803     profiles illustrate the radial trend of the PS1 PSFs for a star
    1804     with FWHM 0.9 arcsec (red) and 2.2 arcsec (blue).  The black line
    1805     shows the PSF model with radial trend of the form $(1 + \kappa r^2 + r^{3.33})^{-1}$.}
    1806   \end{center}
    1807 \end{figure}
    1808 
    18091799\subsection{Output Formats}
    18101800
     
    18231813For a difference image, both positive and negative sources will be
    18241814present.  The basic peak detection algorithm will only trigger for the
    1825 positive sources.  One solution is to simply apply PSPhot to both the
     1815positive sources.  One solution is to simply apply \code{psphot} to both the
    18261816difference image and its negative value.  \note{do we want to code in
    18271817an automatic switch to get both positive and negative excursions in
Note: See TracChangeset for help on using the changeset viewer.