Changeset 39948 for trunk/doc/release.2015/ps1.analysis/analysis.tex
- Timestamp:
- Jan 17, 2017, 10:49:05 AM (10 years ago)
- File:
-
- 1 edited
-
trunk/doc/release.2015/ps1.analysis/analysis.tex (modified) (49 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/release.2015/ps1.analysis/analysis.tex
r39946 r39948 237 237 \code{psLib}. Components of the photometry code were integrated into 238 238 the IPP's mid-level astronomy data analysis toolkit called 239 \code{psModules}. The resulting software, ` PSPhot', can be used either239 \code{psModules}. The resulting software, `\code{psphot}', can be used either 240 240 as a stand-alone C program, or as a set of library functions which may 241 241 be integrated into other programs … … 243 243 \note{add refs to the psLib and psModules ADDs} 244 244 245 The main version of PSPhotis a stand-alone program which is run on a245 The main version of \code{psphot} is a stand-alone program which is run on a 246 246 single image, or a group of related images representing the data read 247 247 from a camera in a single exposure. The images are expected to have … … 253 253 integrated library call} 254 254 255 The version called PSPhotStackaccepts a set of images, each255 The version called \code{psphotStack} accepts a set of images, each 256 256 representing the same patch of sky in a different filter, nominally 257 257 the full $grizy$ filter set for the analysis of the PS1 PV3 stack 258 258 images, though where insufficient data were available in a given 259 259 filter, a subset of these filters was processed as a group. As 260 discussed in detail below, the PSPhotStackanalysis includes the260 discussed in detail below, the \code{psphotStack} analysis includes the 261 261 capability of measuring forced PSF photometry in some filter images 262 262 based on the position of sources detected in the other filters. It … … 265 265 photometry. 266 266 267 Another version of PSPhotused in the PV3 analysis is called268 PSPhotFullForce. In this version, a set of image all representing the267 Another version of \code{psphot} used in the PV3 analysis is called 268 \code{psphotFullForce}. In this version, a set of image all representing the 269 269 same pixels are processed together, with the positions of sources to 270 270 be analysed loaded from a supplied file. In this version of the … … 276 276 supplied guess model. 277 277 278 \section{ PSPhotDesign Goals}279 280 PSPhothas a number of important requirements that it must meet, and a278 \section{\code{psphot} Design Goals} 279 280 \code{psphot} has a number of important requirements that it must meet, and a 281 281 number of design goals which we believe will help to make usable in a 282 282 wide range of circumstances. The critical requirements of the 283 Pan-STARRS IPP which drive the requirements for PSPhot:283 Pan-STARRS IPP which drive the requirements for \code{psphot}: 284 284 285 285 \begin{itemize} 286 \item {\bf 10 millimagnitude photometric accuracy}. For PSPhot, this286 \item {\bf 10 millimagnitude photometric accuracy}. For \code{psphot}, this 287 287 implies that the measured photometry of stellar sources must be 288 288 substantially better than this 10 mmag since the photometry error 289 289 per image is combined with an error in the flat-field calibration 290 290 and an error in measuring the atmospheric effects. We have set a 291 goal for PSPhotof 3mmag photometric consistency for bright stars291 goal for \code{psphot} of 3mmag photometric consistency for bright stars 292 292 between pairs of images obtained in photometric conditions at the 293 293 same pointing, ie to remove sensitivity to flat-field errors. This … … 298 298 \item {\bf 10 milliarcsecond astrometric accuracy}. Relative 299 299 astrometric calibration depends on the consistency of the individual 300 measurements. The measurements from PSPhotmust be sufficiently300 measurements. The measurements from \code{psphot} must be sufficiently 301 301 representative of the true source position to enable astrometric 302 302 calibration at the 10mas level. The error in the individual 303 303 measurements will be folded together with the errors introduced by 304 304 the optical system, the effects of seeing, and by the available 305 reference catalogs. We have set a goal for PSPhotof 5mas305 reference catalogs. We have set a goal for \code{psphot} of 5mas 306 306 consistency between the true source postion and the measured 307 307 position given reasonable PSF variations under simulations. This 308 308 level must be reached for images with 250 mas pixels, implying 309 PSPhotmust introduce measurement errors less than 1/50th of a309 \code{psphot} must introduce measurement errors less than 1/50th of a 310 310 pixel. The choice of 32 bit floating point data values for the 311 311 source centroids places a numerical limit of 1e-7 on the accuracy of … … 315 315 \end{itemize} 316 316 317 The design goals for PSPhotare chosen to make the program flexible,317 The design goals for \code{psphot} are chosen to make the program flexible, 318 318 general, and able to meet the unknown usages cases future projects may 319 319 require: … … 328 328 naturally incorporate 2-D variations. 329 329 330 \item {\bf Flexible non-PSF models} PSPhotmust be able to represent330 \item {\bf Flexible non-PSF models} \code{psphot} must be able to represent 331 331 PSF-like sources as well as non-PSF sources (e.g., galaxies). It 332 332 must be easy to add new source models as interesting representations 333 333 of sources are invented. 334 334 335 \item {\bf Clean code base} PSPhotshould incorporate a high-degree of335 \item {\bf Clean code base} \code{psphot} should incorporate a high-degree of 336 336 abstraction and encapsulation so that changes to the code structure 337 337 can be performed without pulling the code apart and starting from scratch. 338 338 339 \item {\bf PSF validity tests} PSPhotshould include the ability to339 \item {\bf PSF validity tests} \code{psphot} should include the ability to 340 340 choose different types of PSF models for diffent situations, or to 341 341 provide the user with methods for assessing the different PSF models. 342 342 343 \item {\bf Careful systematic corrections} PSPhotmust carefully343 \item {\bf Careful systematic corrections} \code{psphot} must carefully 344 344 measure and correct for the photometric and astrometric trends 345 345 introduced by using analytical PSF models. 346 346 347 \item {\bf User Configurable} PSPhotshould allow users to change the347 \item {\bf User Configurable} \code{psphot} should allow users to change the 348 348 options easily and to allow different approaches to the analysis. 349 349 350 350 \end{itemize} 351 351 352 \section{ PSPhotAnalysis Process}352 \section{\code{psphot} Analysis Process} 353 353 354 354 \subsection{Overview} 355 355 356 The PSPhotanalysis is divided into several major stages:356 The \code{psphot} analysis is divided into several major stages: 357 357 358 358 \begin{enumerate} … … 383 383 \end{enumerate} 384 384 385 PSPhotis highly configurable. Users may choose via the configuration385 \code{psphot} is highly configurable. Users may choose via the configuration 386 386 system which of the above analyses are performed. This is useful for 387 387 testing, but also allows for specialized use cases. For example, the … … 405 405 references to the mask and variance are provided in the configuration 406 406 information. As in the stand-alone C-program, the variance and mask may 407 be constructed automatically by PSPhot.407 be constructed automatically by \code{psphot}. 408 408 409 409 The mask is represented as a 16-bit integer image in which a value of … … 445 445 446 446 \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} 448 448 \begin{center} 449 449 \begin{tabular}{lcl} … … 650 650 The peaks detected in the image may correspond to real sources, but 651 651 they may also correspond to noise fluctuations, especially in the 652 wings of bright stars. PSPhotattempts to identify peaks which may be652 wings of bright stars. \code{psphot} attempts to identify peaks which may be 653 653 formally significant, but are not locally significant. It first 654 654 generates a set of ``footprints'', contiguous collections of pixels in … … 830 830 \subsubsection{PSF Model vs Source Model} 831 831 832 The PSF model used by \code{psphot} consists of an analytical function 832 The point-spread-function (PSF) of an image describes the shape of all 833 unresolved sources in the image. In a typical wide-field image, the 834 shape of unresolved sources varies as a function of position in the 835 image. The full PSF thus needs to include a model with parameters 836 which vary across the image. 837 838 The PSF used by \code{psphot} consists of an analytical function 833 839 combined with a pixelized representation of the residual differences 834 840 between the analytical model and the true PSF. Both the shape … … 837 843 838 844 Within \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: 845 describe the smooth portion of the PSF, but all share a few common 846 characteristics. As an example, a simple model consists of a 2-D 847 elliptical Gaussian: 843 848 \begin{eqnarray} 844 849 f(x,y) & = & I_o e^{-z} + S \\ … … 847 852 y & = & y_{\rm ccd} - y_o 848 853 \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 854 Here the model parameters consist of the centroid coordinates ($x_o, 855 y_o$), the elliptical shape parameters ($\sigma_x, \sigma_y, 856 \sigma_{\rm xy}$), the model normalization ($I_o$) and the local value 857 of the background ($S$). 858 859 A specific source will have a particular set of values for the model 860 parameters, some of which depend on the PSF model and the position of 861 the source in the image, while the rest are unique to the individual 862 source. For the case of the elliptical Gaussian model, the PSF 863 parameters would be the shape terms ($\sigma_x, \sigma_y, \sigma_{\rm 864 xy}$) while the independent parameters would be the centroid, 865 normalization and local sky values ($x_o, y_o, I_o, S$). Thus the 866 shape parameters are each a function of the source centroid 869 867 coordinates: 870 868 \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}) \\ 874 872 \end{eqnarray} 875 PSPhotrepresents the variation in the PSF parameters as a function of873 \code{psphot} represents the variation in the PSF parameters as a function of 876 874 position in the image in two possible ways, specified by the 877 875 configuration. The first option is to use a 2-D polynomial which is … … 890 888 some of the observed PSF variations in the images 891 889 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 898 Several analytical functions which are likely candidates to describe 899 the 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} 907 The Pseudo-Gaussian is a Taylor expansion of the Gaussian and is used 908 by Dophot \citep{1993PASP..105.1342S}. The latter profiles are 909 similar to the Moffat profile form 910 \citep{1969AA.....3..455M,1983AA...126..278B}, with small differences. 911 A user may choose to try more than one analytical function for a given 912 image. As discussed below (Section~\ref{sec:psf.model.choice}), 913 \code{psphot} can automatically choose the best model based on the 914 quality of the PSF fits. 915 916 For the PS1 GPC1 analysis, we used the \code{PS1_V1} model, which we 917 found by experimentation to match well to the observed profiles 918 generated by PS1. Figure~\ref{fig:radial.profiles} shows example 919 radial profiles for moderately bright stars in fairly good (0.9 920 arcsec) and poor (2.2 arcsec) seeing. Using a fixed power-law 921 exponent results in somewhat faster profile fitting compared to the 922 variable power-law exponent model. 923 924 The analytical models in \code{psphot} are written with a high degree 925 of code abstraction making it relatively easy to add different 926 analytical models to the software. The same portion of code used to 927 describe the analytical portion of the PSF sources is also used to for 928 galaxy 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} 951 942 952 943 \subsubsection{Candidate PSF Source Selection} … … 955 946 The first stage of determining the PSF model for an image is to 956 947 identify 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. 948 to be unresolved (i.e., stars). \code{psphot} uses the source sizes as 949 estimated from the second moments to make the initial guess at a 950 collection of unresolved sources. At this point, the program has 951 measured the second order moments for all sources identified by their 952 peaks, as well as an approximate signal-to-noise ratio, above the 953 bright threshold. All sources with a S/N ratio greater than a 954 user-defined parameter (\code{PSF_SN_LIM} = 20.0 for PS1 PV3) are 955 selected by \code{psphot}, though sources which have more than a 956 certain number of saturated pixels are excluded at this stage. The 957 program then examines the 2-D plane of $\sigma_x, \sigma_y$ in search 958 of a concentrated clump of sources (see 959 Figure~\ref{fig:moment.class}). To do this, it constructs an 960 artificial 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 962 artificial image. The binned $\sigma_x, \sigma_y$ plane is then 963 examined to find a significant peak. Unless the image is extremely 964 sparse, such a peak will be well-defined and should represent the 965 sources which are all very similar in shape. Other sources in the 966 image will tend to land in very different locations, failing to 967 produce a single peak. To avoid detecting a peak from the unresolved 968 cosmic rays, sources which have second-moments very close to 0 are 969 ignored. 982 970 983 971 Once a peak has been detected in this plane, the centroid and second … … 985 973 $\sigma$ of this centroid are selected as likely PSF-like sources in 986 974 the image. 975 976 \note{work out the logic for selecting the PSF stars} 987 977 988 978 \begin{figure}[htbp] … … 1000 990 1001 991 \subsubsection{Candidate PSF Source Model Fits} 1002 992 \label{sec:psf.model.choice} 1003 993 % \note{link to psLibADD} 994 995 % Madsen: 996 %% http://www2.imm.dtu.dk/pubdb/views/edoc_download.php/3215/pdf/imm3215.pdf 997 % Press 1004 998 1005 999 All candidate PSF sources are then fitted with the selected source 1006 1000 model, allowing all of the parameters (PSF and independent) to vary in 1007 the fit. PSPhot uses the Levenberg-Marquardt minimization technique1008 for the non-linear fitting. Non-linear1001 the fit. The software uses the Levenberg-Marquardt minimization 1002 technique \citep{Press,Madsen} for the non-linear fitting. Non-linear 1009 1003 fitting can be very computationally intensive, particularly for if the 1010 starting parameters are far from the minimization values. PSPhot uses1011 the first and second momentsto make a good guess for the centroid and1004 starting parameters are far from the minimization values. The first 1005 and second moments are used to make a good guess for the centroid and 1012 1006 shape parameters for the PSF models. Any sources which fail to 1013 1007 converge in the fit are flagged as invalid. … … 1015 1009 For the resulting collection of source model parameters, the 1016 1010 PSF-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. 1011 position using either the 2-D polynomial or the gridded superpixel 1012 representation. The maximum order of these fits depends on the number 1013 of PSF sources (see Table~\ref{tab:order}). The fitting process for 1014 these polynomials is iterative, and rejects the $3\sigma$ outliers in 1015 each of three passes. This fitting technique results in a robust 1016 measurement of the variation of the PSF model parameters as a function 1017 of position without being excessively biased by individual sources 1018 which are not well described by the PSF model (e.g., galaxies which 1019 snuck into the sample). Sources whose model parameters are rejected 1020 by this iterative fitting technique are also marked as invalid PSF 1021 sources 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 1026 1030 1027 1031 All 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 s et by the coordinates of the source centroid and fixed (not allowed1032 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 PSPhotto assess the PSF model is the scatter in1032 model to specify the PSF-dependent model parameter values for each 1033 source. For example, in the case of the elliptical Gaussian model, 1034 the shape parameters ($\sigma_x, \sigma_y, \sigma_{xy}$) for each 1035 source are set by the coordinates of the source centroid and fixed 1036 (not allowed to vary) in the fitting procedure. The resulting fitted 1037 models are then used to determine a metric which tests the quality of 1038 the PSF model for this particular image. 1039 1040 The metric used by \code{psphot} to assess the PSF model is the scatter in 1037 1041 the 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. 1042 sources. This difference is a critical parameter for any PSF modeling 1043 software as it is a measurement of how well the PSF model captures the 1044 flux of the star. An approximate correction is measured here, with a 1045 more detailed correction measured after all source analysis is 1046 performed (see Section~\ref{sec:aperture.correction}). The PSF model 1047 with the best consistency of the aperture correction is judged to be 1048 the best model. \note{are we making a decision on the order or 1049 anything based on apresid?} 1045 1050 1046 1051 \subsection{Bright Source Analysis} … … 1076 1081 \subsubsection{Very Bright Stars} 1077 1082 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} 1083 The standard \code{psphot} PSF modeling code fails to fit the wings of 1084 highly saturated stars, especially if the core of the star is too 1085 contaminated by saturated pixels. For stars with more than a single 1086 saturated pixel, we model the radial profile of the logarithmic 1087 instrumental flux in logarithmically spaced radial bins. For each 1088 radial bin, we determine the median of the log-flux. This median 1089 profile is then interpolated to generate the full radial flux 1090 distribution. 1091 1092 % logRdel = 0.1 1093 % logRmax = log(320) 1084 1094 1085 1095 \subsubsection{Fast Ensemble PSF Fitting} … … 1113 1123 diagonal square matrix. The dimension is the number of sources, 1114 1124 likely to be 1000s or 10,000s. Direct inversion of the matrix would 1115 be computationally very slow. However, an i nterative solution quickly1125 be computationally very slow. However, an iterative solution quickly 1116 1126 yields a result with sufficient accuracy. In the iterative solution, 1117 1127 a guess at the solution $\bar{A}$ is made assuming $M_{i,j}$ is purely … … 1119 1129 compared with the observed vector $\bar{F_j}$. The difference is used 1120 1130 to modify the initial guess. This proces is repeated several times to 1121 achieve a good convergence. 1131 achieve a good convergence. Convergence is quick (a few iterations) 1132 because of the highly diagonal matrix with small off-diagonal terms: 1133 the dot product of source $i$ and source $j$ is 1 where $i = j$ and 1134 much less than 1 where $i \noteq j$. 1122 1135 1123 1136 Once 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. 1137 subtracted from the image by applying these values to the unit-flux 1138 PSF. 1125 1139 1126 1140 \subsubsection{Full PSF Model Fitting} … … 1128 1142 % \note{review the discussion below} 1129 1143 1130 Once a PSF model has been selected for an image, PSPhotattempts to1144 Once a PSF model has been selected for an image, \code{psphot} attempts to 1131 1145 fit all of the detected sources, above a user-defined signal-to-noise 1132 1146 ratio with the PSF model. For these fits, the dependent parameters 1133 1147 are fixed by the PSF model and only the 4 independent source model 1134 parameters are allowed to vary in the fit. PSPhotagain uses1148 parameters are allowed to vary in the fit. \code{psphot} again uses 1135 1149 Levenberg-Marquardt minimization for the non-linear fitting. The 1136 1150 sources 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 1151 working down to the user-specified limit, with the other sources 1152 subtracted as discussed above. 1153 1154 \node{code review for the next bit} 1155 1156 Once a solution has been achieved for a source, \code{psphot} attempts to 1140 1157 judge the quality of the PSF model as a representation of the source 1141 1158 shape. To do this, it calculates the next step of the minimization … … 1149 1166 $\sigma_y$. For a generic model, the shape parameters may be defined 1150 1167 differently, but there should always be two parameters which scale the 1151 source size in two dimensions. Currently, PSPhotrequires the two1168 source size in two dimensions. Currently, \code{psphot} requires the two 1152 1169 relevant shape parameters to be the first two dependent parameters in 1153 1170 the list of model parameters (ie, parameters 4 \& 5). … … 1172 1189 as a likely defect. 1173 1190 1174 At this stage of the analysis, PSPhotuses two additional indicators1191 At this stage of the analysis, \code{psphot} uses two additional indicators 1175 1192 to identify good and poor PSF fits. The first of these is the 1176 1193 signal-to-noise ratio. It is possible for the peak finding algorithm … … 1183 1200 smoothed image). The fit can either fail to converge or it can 1184 1201 converge on a fit with very low or negative peak flux / flux 1185 normalization. PSPhotwill flag any non-convergent PSF fit and any1202 normalization. \code{psphot} will flag any non-convergent PSF fit and any 1186 1203 source with PSF S/N ratio lower than a user-defined cutoff. It is 1187 1204 also useful to identify very poor fits by setting a maximum Chi-Square … … 1224 1241 \label{sec:source.size} 1225 1242 1243 \note{is this in the right place?} 1244 1226 1245 After the PSF model has been fitted to all sources, and the Kron flux 1227 has been measured for all sources, PSPhotuses these two measurements,1246 has been measured for all sources, \code{psphot} uses these two measurements, 1228 1247 along with some additional pixel-level analysis, to determine the size class 1229 1248 of the source. If the source is large compared to a PSF, it is … … 1233 1252 PSF, it is considered to be a {\em cosmic ray} and masked. 1234 1253 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. 1254 Extended sources are identified as those for which the Kron magnitude 1255 is significantly brighter than the PSF magnitude when compared to a 1256 PSF star. The value $\delta M_{rm KP} = m_{\rm Kron} - m_{\rm PSF}$, 1257 the difference between the PSF and Kron magnitudes, is calculated for 1258 each source. The median of $\delta M_{rm KP}$ is calculated for the 1259 PSF stars. This median is subtracted from $\delta M_{rm KP}$ for each 1260 star. The result is divided by the quadrature error of the PSF and 1261 Kron magnitudes and called \code{extNsigma}. If \code{extNsigma} is 1262 larger than \code{PSPHOT.EXT.NSIGMA.LIMIT} (3.0), the source is 1263 considered to be extended. 1244 1264 1245 1265 Cosmic Rays are identified by a combination of the Kron magnitude and … … 1254 1274 and the associated pixels are masked. 1255 1275 1276 \note{how are / were these parameters set?} 1277 1256 1278 \subsubsection{Non-PSF Sources} 1257 1279 … … 1263 1285 aperture) and working to a user defined S/N limit. 1264 1286 1265 PSPhotwill use the user-selected galaxy model to attempt the galaxy1287 \code{psphot} will use the user-selected galaxy model to attempt the galaxy 1266 1288 model fits. In the configuration system, the keyword \code{GAL_MODEL} 1267 1289 is set to the model of interest. All suspected extended sources are … … 1294 1316 After a first pass through the image, in which the brighter sources 1295 1317 above a high threshold level have been detected, measured, and 1296 subtracted, PSPhotoptionally begins a second pass at the image. In1318 subtracted, \code{psphot} optionally begins a second pass at the image. In 1297 1319 this stage, the new peaks are detected on the image with the bright 1298 1320 sources subtracted. In this pass, the peak detection process uses the … … 1310 1332 \subsection{Extended Source Analysis} 1311 1333 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. } 1334 After the initial, fast analysis of the image relying primarily on the 1335 PSF model, a complete analysis of the extended source properties may 1336 be performed. For PS1 processing, this step is the nightly (PV0) 1337 analysis of individual exposures and only performed for the stacks. 1317 1338 1318 1339 \subsubsection{Radial Profiles} … … 1326 1347 contour and radial profile. 1327 1348 1328 In order to facilitate the Petrosian photometry analysis below, PSPhot1349 In order to facilitate the Petrosian photometry analysis below, \code{psphot} 1329 1350 generates a radial profile for each suspected galaxy. This analysis 1330 1351 starts by generating a radial profile in 24 azimuthal segments. Near … … 1341 1362 profiles, pairs of radial profiles from opposite sides of the source 1342 1363 are compared. Any masked values are replaced by the corresponding 1343 value in the other profile. The minimum of both profiles is the kept1364 value in the other profile. The minimum of both profiles is then kept 1344 1365 for both profiles. The result of this analysis is a set of profiles 1345 1366 of the form $f_i(r_i)$. In this case, $f_i$ is effectively the 1346 1367 surface brightness for each radius in instrumental counts per pixel. 1347 1368 1348 The surface brightness profiles are then used to define the radial1369 The surface brightness profiles are then used to define the azimuthal 1349 1370 contour at a specific isophotal level. This contour will be used to 1350 1371 rescale the radial profiles into a single set of profiles normalized … … 1366 1387 (\code{RADIAL.ANNULAR.BINS.LOWER} \& 1367 1388 \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}). 1389 surface brightness profile is saved in the output FITS table as a 1390 vector (\code{PROF_SB}). The flux at each radial position and the 1391 fill-factor (fraction of pixels used to the total possible) are also 1392 saved 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 1394 output file FITS header (\code{RMIN_NN}, \code{RMAX_NN}). 1375 1395 1376 1396 % \note{these profiles are not saved in PSPS} … … 1382 1402 aperture which can be determined for galaxies without significant 1383 1403 biases as a function of distance. Since surface brightness in a 1384 resolved source is conserved , using a ratio of surface brightness to1385 define a spatial scale results in a spatial scale which is constant 1386 regardless of galaxy distance.1404 resolved source is conserved as a function of distance, using a ratio 1405 of surface brightness to define a spatial scale results in a spatial 1406 scale which is constant regardless of galaxy distance. 1387 1407 1388 1408 To measure the Petrosian radius and flux, we start by defining a … … 1440 1460 1441 1461 Preliminary 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$. 1462 are calculated soon after sources are detected 1463 (Section~\ref{sec:moments}). However, these preliminary values are 1464 not accurate due to the window-functions applied. After sources have 1465 been characterized and the PSF model is well-determined, the Kron 1466 parameters are re-calculated more carefully. In this version of the 1467 calculation, following the algorithm described by \cite{sextractor}, 1468 the image is first smoothed by Gaussian kernel with $\sigma = 1.7$ 1469 pixels, corresponding to a FWHM of 1.0\arcsec\ in the PS1 stack 1470 images. Next, the Kron radius is determined in an iterative process: 1471 the first radial moment is measured using the pixels in an aperture 1472 6$\times$ the first radial moment from the previous iteration. On the 1473 first iteration, the sky radius is used in place of the first radial 1474 moment. By default, 2 iterations are performed. The Kron radius is 1475 defined the be 2.5$\times$ the first radial moment. The Kron flux is 1476 the sum of pixel fluxes within the Kron radius. We also calculate the 1477 flux in two related annular apertures: the Kron inner flux is the sum 1478 of pixel values for the annulus $R_1 < r < 2.5 R_1$, while the Kron 1479 outer flux is the sum of pixel values for $2.5 R_1 < r < 4 R_1$. 1459 1480 1460 1481 Two details in the calculation above should be noted. First, for … … 1479 1500 effect of reducing the impact of pixels which include flux from near 1480 1501 neighbors. 1502 1503 \note{give a test example} 1481 1504 1482 1505 \subsubsection{Convolved Galaxy Model Fits} … … 1546 1569 a function of the Sersic index. 1547 1570 1548 The PSF-convolved galaxy model fitting analysys uses the 1571 \note{special handling for central pixel} 1572 1573 The PSF-convolved galaxy model fitting analysis uses the 1549 1574 Levenberg-Marquardt minimization method to determine the best fit. In this 1550 1575 process, the $\chi^2$ value to be minimized is: … … 1587 1612 The gradient vector and Hessian matrix are used in the 1588 1613 Levenberg-Marquardt minimization analysis using the standard 1589 tech inique of determining a step from the current set of model1614 technique of determining a step from the current set of model 1590 1615 parameters to a new set by solving the matrix equation: 1591 1616 \[ … … 1611 1636 (galaxy model) image to be convolved before multiplying by the PSF 1612 1637 model profile at that radial coordinate. This approximation reduces 1613 the number of multiplications by a factor of near8 for larger radii.1638 the number of multiplications by a factor of \approx 8 for larger radii. 1614 1639 For the small size of the PSF model used to convolve the galaxy model 1615 1640 images, it was found that this direct convolution was faster than 1616 1641 using an FFT-based convolution. 1617 1642 1618 % \note{(examples?)}1643 \note{examples? show timing comparisons?} 1619 1644 1620 1645 For the Exponential and DeVaucouleur fits, all parameters are fitted … … 1639 1664 previous, values in the grid above. E.g., if the minimum fitted index 1640 1665 value 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 quadrati d1642 interpolation to find the index $n$ which produces the locally mini um1666 The resulting $\chi^2$ values are then used to perform quadratic 1667 interpolation to find the index $n$ which produces the locally minimum 1643 1668 $\chi^2$ value. Finally, this best-fit index value is held constant 1644 1669 while Levenberg-Marquardt minimization is used to find the best fit … … 1653 1678 important than an accurate total magnitude. In the case of PS1, the image 1654 1679 quality variations for stacks of different filters presents a serious 1655 challenge for the determination of precise colors. PSPhotdetermines1680 challenge for the determination of precise colors. \code{psphot} determines 1656 1681 a set of PSF-matched radial aperture flux measurements in order to 1657 1682 minimize the impact of the stack image quality variations. 1658 1683 1659 In PSPhotStack, the stack analysis version of PSPhot, the 5 filter1684 In \code{psphotStack}, the stack analysis version of \code{psphot}, the 5 filter 1660 1685 images are processed together. After the PSF models have been fitted 1661 1686 and a best set of galaxy models have been determined, three sets of … … 1683 1708 1684 1709 \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 image1697 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). The1703 amplitude of the error will by determined by how inconsistently the1704 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 a voids these problems, by trading for other1710 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 ofthe1717 stellar images, rather than the wide wings. The wide wings are1718 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 1712 A PSF model will always fail to describe the flux of the stellar 1713 sources at some level. For high-precision photometry, we need to be 1714 able to correct for the difference between the PSF model fluxes and 1715 the total flux of the sources. In the end, all astronomical 1716 photometry is in some sense a relative measurement between two images. 1717 Whether the goal is calibration of a science image taken at one 1718 location to a standard star image at another location, or the goal is 1719 simply the repetitive photometry of the same star at the same location 1720 in the image, it is always necessary to compare the photometry between 1721 two images. If this measurement is to be consistent, then the 1722 measurement must represent the flux of the stars in the same way 1723 regardless of the conditions under which the images were taken, at 1724 least within some range of normal image conditions. So, for example, 1725 two images with different image quality, or with different tracking 1726 and focus errors, will have different PSF models. Since an analytical 1727 model will always fail to represent the flux of the star at some 1728 level, the measured flux of the same source in the two images will be 1729 different (even assuming all other atmospheric and instrumental 1730 effects have been corrected). The amplitude of the error will by 1731 determined by how inconsistently the models represent the actual 1732 source flux. 1733 1734 Aperture photometry attempts to avoid these problems, but introduces 1735 other difficulties. In aperture photometry, if a large enough 1736 aperture is chosen, the amount of flux which is lost will be a small 1737 fraction of the total source flux. Even more importantly, as the 1738 image conditions change, the amount lost will change by an even 1739 smaller fraction, at least for a large aperture. This can be seen by 1740 the fact that the dominant variations in the image quality are in the 1741 focus, tracking and seeing. All of these errors initially affect the 1742 cores of the stellar images, rather than the wide wings. The wide 1743 wings are largely dominated by scattering in the optics and scattering 1744 in the atmosphere. The amplitude and distribution of these two 1745 scattering functions do not change significantly or quickly for a 1746 single telescope and site. 1722 1747 1723 1748 The difficulty for aperture photometry is the need to make an accurate 1724 1749 measurement of the local background for each source. As the aperture 1725 1750 grows, errors in the measurement of the sky flux start to become 1726 dominant. If the aperture is too small, then variation in the image1751 dominant. If the aperture is too small, then variations in the image 1727 1752 quality are dominant. The brighter is the source, the smaller is the 1728 1753 error introduced by the large size of the aperture. However, the 1729 1754 number of very bright stars is limited in any image, and of course the 1730 1755 brighter stars are more likely to suffer from non-linearity or 1731 saturation. PSPhotmeasures the aperture correction ({\em ApResid})1756 saturation. \code{psphot} measures the aperture correction ({\em ApResid}) 1732 1757 for every PSF candidate source and applies this correction to the PSF 1733 1758 model photometry. … … 1747 1772 % magnitude}. 1748 1773 1749 %%% PSPhotmeasures the aperture correction ({\em ApResid}) for every PSF1774 %%% \code{psphot} measures the aperture correction ({\em ApResid}) for every PSF 1750 1775 %%% candidate source, then calculates the trend of this correction as a 1751 1776 %%% function of the magnitude. This trend is fitted with a line. The … … 1762 1787 %%% term. 1763 1788 1764 PSPhotallows a collection of PSF model functions to be tried on all1789 \code{psphot} allows a collection of PSF model functions to be tried on all 1765 1790 PSF candidate sources. For each model test, the above corrected 1766 1791 ApResid scatter is measured. The PSF model function with the smallest 1767 value for the ApResid scatter is then used by PSPhotas the best PSF1792 value for the ApResid scatter is then used by \code{psphot} as the best PSF 1768 1793 model for this image. The number of models to be tested is specified 1769 1794 by the configuration keyword \code{PSF_MODEL_N}. The configuration … … 1772 1797 tested. 1773 1798 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-Gaussian1784 is a Taylor expansion of the Gaussian and is used by Dophot1785 \citep{1993PASP..105.1342S}. The latter profiles are similar to the1786 Moffat profile form \citep{1969AA.....3..455M,1983AA...126..278B},1787 with small differences. For the PS1 GPC1 analysis, we used the1788 \code{PS1_V1} model, which we found by experimentation to match well1789 to the observed profiles generated by PS1.1790 Figure~\ref{fig:radial.profiles} shows example radial profiles for1791 moderately bright stars in fairly good (0.9 arcsec) and poor (2.21792 arcsec) seeing. Using a fixed power-law exponent results in somewhat1793 faster profile fitting compared to the variable power-law exponent1794 model.1795 1796 % moffat : 1969A&A.....3..455M1797 % buonanno : 1983A&AS...51...83B1798 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 two1803 profiles illustrate the radial trend of the PS1 PSFs for a star1804 with FWHM 0.9 arcsec (red) and 2.2 arcsec (blue). The black line1805 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 1809 1799 \subsection{Output Formats} 1810 1800 … … 1823 1813 For a difference image, both positive and negative sources will be 1824 1814 present. The basic peak detection algorithm will only trigger for the 1825 positive sources. One solution is to simply apply PSPhotto both the1815 positive sources. One solution is to simply apply \code{psphot} to both the 1826 1816 difference image and its negative value. \note{do we want to code in 1827 1817 an automatic switch to get both positive and negative excursions in
Note:
See TracChangeset
for help on using the changeset viewer.
