IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40705


Ignore:
Timestamp:
May 1, 2019, 11:52:08 AM (7 years ago)
Author:
eugene
Message:

adding figures for galaxy fitting

Location:
trunk/doc/release.2015/ps1.analysis
Files:
6 added
3 edited

Legend:

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

    r40700 r40705  
    417417\end{itemize}
    418418
    419 \section{\nocode{psphot} Analysis Process}
     419\section{Basic Analysis}
    420420
    421421\subsection{Overview}
    422422
    423 The \ippprog{psphot} analysis is divided into several major stages, as
    424 listed below. 
     423The basic \ippprog{psphot} analysis is divided into several major
     424stages, as listed below.
    425425
    426426\begin{enumerate}
     
    441441  properties (aperture or PSF)
    442442
    443 \item {\bf Extended Source Analysis} Detailed measurements relevant to
    444   galaxies and/or other extended (non-PSF) sources.
    445 
    446443\item {\bf Aperture corrections} Measure the curve-of-growth, spatial
    447444  aperture variations, and background-error corrections. 
     
    450447  difference image, variance image, etc, as selected.
    451448\end{enumerate}
     449
     450In addition to this basic sequence, additional analysis steps may be
     451performed.  An ``extended source'' analysis mode is available to
     452measure photometry and morphology of galaxies and other resolved
     453sources.  Forced photometry may be performed for both point-like and
     454extended sources.  A special mode is available for the photometry of
     455sources detected in difference images.  These different modes are
     456discussed in their own sections below.
    452457
    453458Table~\ref{tab:measurements} lists the types of
     
    19381943\code{PM_SOURCE_MODE2_MATCHED} set.
    19391944
    1940 \subsection{Extended Source Analysis}
     1945\subsection{Aperture Correction and Total Aperture Fluxes}
     1946\label{sec:aperture.correction}
     1947
     1948A PSF model will always fail to describe the flux of the stellar
     1949sources at some level.  For high-precision photometry, we need to be
     1950able to correct for the difference between the PSF model fluxes and
     1951the total flux of the sources.  In the end, all astronomical
     1952photometry is in some sense a relative measurement between two images.
     1953Whether the goal is calibration of a science image taken at one
     1954location to a standard star image at another location, or the goal is
     1955simply the repetitive photometry of the same star at the same location
     1956in the image, it is always necessary to compare the photometry between
     1957two images.  If this measurement is to be consistent, then the
     1958measurement must represent the flux of the stars in the same way
     1959regardless of the conditions under which the images were taken, at
     1960least within some range of normal image conditions.  So, for example,
     1961two images with different image quality, or with different tracking
     1962and focus errors, will have different PSF models.  To the extent the
     1963PSF model is inaccurate, the measured flux of the same source in the
     1964two images will be different (even assuming all other atmospheric and
     1965instrumental effects have been corrected).  The amplitude of the error
     1966will by determined by how inconsistently the models represent the
     1967actual source flux.
     1968
     1969Aperture photometry attempts to avoid these problems, but introduces
     1970other difficulties.  In aperture photometry, if a large enough
     1971aperture is chosen, the amount of flux which is lost will be a small
     1972fraction of the total source flux.  Even more importantly, as the
     1973image conditions change, the amount lost will change by an even
     1974smaller fraction, at least for a large aperture.  This can be seen by
     1975the fact that the dominant variations in the image quality are in the
     1976focus, tracking and seeing.  All of these errors initially affect the
     1977cores of the stellar images, rather than the wide wings.  The wide
     1978wings are largely dominated by scattering in the optics and scattering
     1979in the atmosphere.  The amplitude and distribution of these two
     1980scattering functions do not change significantly or quickly for a
     1981single telescope and site.  Aperture photometry can then be used to
     1982correct the PSF photometry.
     1983
     1984The difficulty for aperture photometry is the need to make an accurate
     1985measurement of the local background for each source.  As the aperture
     1986grows, errors in the measurement of the sky flux start to become
     1987dominant.  If the aperture is too small, then variations in the image
     1988quality are dominant.  The brighter is the source, the smaller is the
     1989error introduced by the large size of the aperture.  However, the
     1990number of very bright stars is limited in any image, and of course the
     1991brighter stars are more likely to suffer from non-linearity or
     1992saturation. 
     1993
     1994\begin{figure*}[htbp]
     1995  \begin{center}
     1996 \includegraphics[width=\hsize,clip]{pics/{mag.resid.psf}.png}
     1997  \caption{\label{fig:mag.resid.psf} PSF Photometry demonstration.
     1998    The bottom panel shows the difference of the measured PSF
     1999    photometry for stars in the first image of the STS sequence
     2000    compared to the next 17 images, after correction for a relative
     2001    zero point.  Black dots are from stars for which both measurements
     2002    have {\tt PSF\_QF} $> 0.95$, while grey dots have lower {\tt
     2003      PSF\_QF} values.  The top three panels show histograms in three
     2004    instrumental magnitude ranges for the magnitude difference divided
     2005    by the reported measurement error: $N\sigma = (m_0 - m_1) /
     2006    \sqrt{\sigma_0^2 + \sigma_1^2}$.  The red curves are Gaussian fits
     2007    to these histograms, with the measured standard deviations in the
     2008    upper-right corners of the plots.  The instrumental magnitude
     2009    ranges are listed in the upper-left corners of the three plots and
     2010    the boundaries are marked as vertical red lines in the lower plot.
     2011  }
     2012  \end{center}
     2013\end{figure*}
     2014
     2015\begin{figure*}[htbp]
     2016  \begin{center}
     2017 \includegraphics[width=\hsize,clip]{pics/{mag.resid.aper}.png}
     2018  \caption{\label{fig:mag.resid.aper} Aperture Photometry
     2019    demonstration.  The plots show identical measurements to those in
     2020    Figure~\ref{fig:mag.resid.psf}, but for aperture photometry, as discussed in
     2021    Section~\ref{sec:aperture.correction}, rather than PSF photometry.}
     2022  \end{center}
     2023\end{figure*}
     2024
     2025In order to thread the needle between these effects, \ippprog{psphot}
     2026measures the aperture photometry on a modest-sized aperture, and then
     2027uses the PSF model to extrapolate to a large aperture.  When the PSF
     2028fluxes are calculated, the aperture flux for the modest-sized aperture
     2029is also determined.  The aperture is a circular aperture with radius
     2030set to a fixed multiple (\code{PSF_APERTURE_SCALE}) of $\sigma_w$, the
     2031width of the Gaussian window function determined based on the analysis
     2032of the second moments (see Section~\ref{sec:moments}).  For the PV3
     2033$3\pi$ analysis, the aperture window radius is $4.5 \times \sigma_w$,
     2034while the large reference aperture radius is set to 25 pixels
     2035(\code{PSF_REF_RADIUS} = 6\farcs4).  These corrected aperture
     2036magnitudes are saved in the output catalogs as \code{AP_MAG}, the
     2037uncorrected aperture magnitudes are saved as \code{AP_MAG_RAW}, and
     2038the radius used to measure the raw aperture flux is saved as
     2039\code{AP_MAG_RADIUS}.  The corresponding flux and the flux error are
     2040saved as \code{AP_FLUX} and \code{AP_FLUX_SIG}.
     2041
     2042With these aperture magnitudes in hand, it is now possible to make an
     2043average correction to the PSF magnitudes to bring the PSF and aperture
     2044magnitudes to the same system.  This correction is measured using the
     2045same stars from which the PSF model is measured, as long as the PSF
     2046magnitude error for the star is less than 0.03 mag.  The correction is
     2047calculated using the weighted average of the values $m_{\rm AP} -
     2048m_{\rm PSF}$.  Since the PSF may vary across the image, the correction
     2049is determined as a function of position in the image.  Like the PSF
     2050model, the 2D variations of the aperture correction may be modeled as
     2051a polynomial or via interpolation in a grid.  For the $3\pi$ PV3
     2052analysis, a grid with a maximum of $6\times 6$ samples per GPC1 chip
     2053image was used.  The reported PSF magnitudes for all objects have this
     2054aperture correction applied.
     2055
     2056% growth curve analysis in psphot:
     2057% in psphotChoosePSF : call psphotMakeGrowthCurve
     2058% in psphotMakeGrowthCurve : boolean GROWTH_FROM_SOURCES, use
     2059%% pmGrowthCurveGenerateFromSources or
     2060%% pmGrowthCurveGenerate (uses PSF model only)
     2061%% GROWTH_FROM_SOURCES is set to TRUE for default recipe
     2062
     2063%% ApTrend:
     2064%% in psphotApResid, called by psphotReadout near the end of the
     2065%% analysis
     2066%% ApTrend = f(x,y) for (apMag - psfMag) for psfMagErr <= 0.03
     2067%% apMag is growth curve corrected
     2068%% psfMag is raw
     2069
     2070%% raw psfMag and raw apMag are measured
     2071%% apMag = apMagRaw + growth curve correction (from apRadius to 25 pix
     2072%% = PSF_REF_RADIUS)
     2073%% psfMag = psfMagRaw + aperture trend (<ap - psf> + growth curve)
     2074
     2075% How important is this effect?  Consider a typical bright source with a
     2076% flux of (say) 40,000 counts in an image of background 1000 counts per
     2077% pixel, with FWHM of 4 pixels.  In principle, the flux of this source
     2078% should be measurable with an accuracy of roughly 0.57\%
     2079% ($\frac{\sqrt{40000 + 1000 \times 12}}{40000}$).  However, the
     2080% measurement of the sky is limited at some finite level by Poisson
     2081% statistics.  If we are required to use an aperture of (say) 25 pixels
     2082% in radius (eg, 5 arcseconds for an 0.2 arcsec / pixel detector), and
     2083% we have an annulus of twice this radius to measure the local sky, then
     2084% we will have an error of XXX.
     2085%
     2086% \note{outline the variation of {\em ApResid} as a function of
     2087% magnitude}.
     2088
     2089%%% \ippprog{psphot} measures the aperture correction ({\em ApResid}) for every PSF
     2090%%% candidate source, then calculates the trend of this correction as a
     2091%%% function of the magnitude.  This trend is fitted with a line.  The
     2092%%% resulting function can be used to determine the effective aperture
     2093%%% correction for an infinite flux source and the average bias inherent
     2094%%% in the sky measurement for the image.  The scatter of the
     2095%%% PSF-candidate source measurements about this trend is a measure of how
     2096%%% well we can measure photometry from the image by applying the specific
     2097%%% PSF model.  The slope of this trend is a measure of the bias in the
     2098%%% local sky measurment for each source.  In principal, the measured sky
     2099%%% levels could be modified by this bias.  More generally, the measured
     2100%%% bias in a collection of images could be used to improve the model
     2101%%% fitting or sky fitting portion of the software the remove the bias
     2102%%% term.
     2103
     2104\ippprog{psphot} allows a collection of PSF model functions to be tried on all
     2105PSF candidate sources.  For each model test, the above corrected
     2106ApResid scatter is measured.  The PSF model function with the smallest
     2107value for the ApResid scatter is then used by \ippprog{psphot} as the best PSF
     2108model for this image.  The number of models to be tested is specified
     2109by the configuration keyword \code{PSF_MODEL_N}.  The configuration
     2110variables \code{PSF_MODEL_0}, \code{PSF_MODEL_1}, through
     2111\code{PSF_MODEL_N - 1} specify the names of the models which should be
     2112tested.
     2113
     2114\subsection{Stellar Photometry Example}
     2115
     2116To illustrate the quality of the stellar photometry as measured with
     2117PSF and aperture magnitudes, we show the results of an analysis of a
     2118set of 18 images obtained by PS1 19 February 2010.  These images were
     2119obtained for the stellar transit survey ``Pan-Planets''
     2120\citep{2016A&A...587A..49O} and thus target a relatively dense
     2121Galactic plane field.  The observations were obtained with
     2122approximately consistent pointing, reducing our sensitivity to
     2123small-scale variations in the flat-field structures.
     2124
     2125Figures~\ref{fig:mag.resid.psf} and ~\ref{fig:mag.resid.aper} show
     2126comparisons of the PSF and aperture photometry measured for these 18
     2127images.  In these figures, the photometry has been measured using the
     2128configuration for \ippprog{psphot} as used for the full PV3
     2129\ippstage{chip} analysis.  The first image of the sequence is compared
     2130to the remaining 17 images.  A relative zero point correction is
     2131applied, measured as the median of the photometry difference for stars
     2132with signal-to-noise greater than 50.  The combined error is reported
     2133and used to generate the histograms shows in the figures.  From these
     2134two figures, one can observe the trade-off between PSF and aperture
     2135photometry.  For the brightest instrumental magnitudes, corresponding
     2136to signal-to-noise ratios greater than roughly 300, aperture
     2137magnitudes provide a more consistent measurement of the stellar
     2138fluxes, while the PSF magnitudes are more reliable for fainter
     2139sources.  Catastophic failures or extreme outliers are also reduced
     2140for the PSF photometry.
     2141
     2142We largely attribute the behavior on the bright end to systematic
     2143errors in the photometry due to our inability to perfectly represent
     2144the shape of the PSF.  The PSF of stars at the bright end will depend
     2145on the brightness because of the ``Brighter-Fatter'' effect
     2146\citep[][]{2014JInst...9C3048A,2015JInst..10C5032G}, in which the
     2147charge already present in the pixels will force the newly arriving
     2148photoeletrons to be systematically pushed away from the accumulating
     2149stellar image, but we do not include a brightness term in our PSF
     2150model.  Detector or electronic non-linearity may also affect the PSF
     2151shape and thus the PSF photometry, though non-linearity will affect
     2152the reported photometry for both PSF and aperture magnitudes.
     2153
     2154We believe the observed behavior at the faint end is primarily a
     2155result of the increased crowding.  Aperture photometry is more
     2156adversely affected by close neighbors than PSF photometry.  Compared
     2157to the formal errors, the faint PSF photometry is the most reliable,
     2158with the aperture photometry degrading rapidly as the flux of the star
     2159decreases. 
     2160
     2161\section{Extended Source Analysis}
     2162\label{sec:extended.source}
    19412163
    19422164After the initial, fast analysis of the image relying primarily on the
     
    20132235% if |b| > 20.0 + 15.0 exp(-long^2 / (2 * 50^2))
    20142236
    2015 \subsubsection{Radial Profiles}
     2237\subsection{Radial Profiles}
    20162238\label{sec:radial.profile.v2}
    20172239
     
    20822304% \note{these profiles are not saved in PSPS}
    20832305
    2084 \subsubsection{Petrosian Radii and Magnitudes}
     2306\subsection{Petrosian Radii and Magnitudes}
    20852307\label{sec:petrosian}
    20862308
     
    21412363
    21422364
    2143 \subsubsection{Convolved Galaxy Model Fits}
     2365\subsection{Convolved Galaxy Model Fits}
    21442366\label{sec:galaxy.conv.fit}
    21452367
     
    23472569any of the parameters.
    23482570
    2349 \subsubsection{Fixed Aperture Photometry}
     2571\subsection{Fixed Aperture Photometry}
    23502572\label{sec:fixed.aperture.photom}
    23512573
     
    23972619% last bin is first with inner radius >= skyRadius
    23982620
    2399 \subsection{Aperture Correction and Total Aperture Fluxes}
    2400 \label{sec:aperture.correction}
    2401 
    2402 A PSF model will always fail to describe the flux of the stellar
    2403 sources at some level.  For high-precision photometry, we need to be
    2404 able to correct for the difference between the PSF model fluxes and
    2405 the total flux of the sources.  In the end, all astronomical
    2406 photometry is in some sense a relative measurement between two images.
    2407 Whether the goal is calibration of a science image taken at one
    2408 location to a standard star image at another location, or the goal is
    2409 simply the repetitive photometry of the same star at the same location
    2410 in the image, it is always necessary to compare the photometry between
    2411 two images.  If this measurement is to be consistent, then the
    2412 measurement must represent the flux of the stars in the same way
    2413 regardless of the conditions under which the images were taken, at
    2414 least within some range of normal image conditions.  So, for example,
    2415 two images with different image quality, or with different tracking
    2416 and focus errors, will have different PSF models.  To the extent the
    2417 PSF model is inaccurate, the measured flux of the same source in the
    2418 two images will be different (even assuming all other atmospheric and
    2419 instrumental effects have been corrected).  The amplitude of the error
    2420 will by determined by how inconsistently the models represent the
    2421 actual source flux.
    2422 
    2423 Aperture photometry attempts to avoid these problems, but introduces
    2424 other difficulties.  In aperture photometry, if a large enough
    2425 aperture is chosen, the amount of flux which is lost will be a small
    2426 fraction of the total source flux.  Even more importantly, as the
    2427 image conditions change, the amount lost will change by an even
    2428 smaller fraction, at least for a large aperture.  This can be seen by
    2429 the fact that the dominant variations in the image quality are in the
    2430 focus, tracking and seeing.  All of these errors initially affect the
    2431 cores of the stellar images, rather than the wide wings.  The wide
    2432 wings are largely dominated by scattering in the optics and scattering
    2433 in the atmosphere.  The amplitude and distribution of these two
    2434 scattering functions do not change significantly or quickly for a
    2435 single telescope and site.  Aperture photometry can then be used to
    2436 correct the PSF photometry.
    2437 
    2438 The difficulty for aperture photometry is the need to make an accurate
    2439 measurement of the local background for each source.  As the aperture
    2440 grows, errors in the measurement of the sky flux start to become
    2441 dominant.  If the aperture is too small, then variations in the image
    2442 quality are dominant.  The brighter is the source, the smaller is the
    2443 error introduced by the large size of the aperture.  However, the
    2444 number of very bright stars is limited in any image, and of course the
    2445 brighter stars are more likely to suffer from non-linearity or
    2446 saturation. 
    2447 
    2448 In order to thread the needle between these effects, \ippprog{psphot}
    2449 measures the aperture photometry on a modest-sized aperture, and then
    2450 uses the PSF model to extrapolate to a large aperture.  When the PSF
    2451 fluxes are calculated, the aperture flux for the modest-sized aperture
    2452 is also determined.  The aperture is a circular aperture with radius
    2453 set to a fixed multiple (\code{PSF_APERTURE_SCALE}) of $\sigma_w$, the
    2454 width of the Gaussian window function determined based on the analysis
    2455 of the second moments (see Section~\ref{sec:moments}).  For the PV3
    2456 $3\pi$ analysis, the aperture window radius is $4.5 \times \sigma_w$,
    2457 while the large reference aperture radius is set to 25 pixels
    2458 (\code{PSF_REF_RADIUS} = 6\farcs4).  These corrected aperture
    2459 magnitudes are saved in the output catalogs as \code{AP_MAG}, the
    2460 uncorrected aperture magnitudes are saved as \code{AP_MAG_RAW}, and
    2461 the radius used to measure the raw aperture flux is saved as
    2462 \code{AP_MAG_RADIUS}.  The corresponding flux and the flux error are
    2463 saved as \code{AP_FLUX} and \code{AP_FLUX_SIG}.
    2464 
    2465 With these aperture magnitudes in hand, it is now possible to make an
    2466 average correction to the PSF magnitudes to bring the PSF and aperture
    2467 magnitudes to the same system.  This correction is measured using the
    2468 same stars from which the PSF model is measured, as long as the PSF
    2469 magnitude error for the star is less than 0.03 mag.  The correction is
    2470 calculated using the weighted average of the values $m_{\rm AP} -
    2471 m_{\rm PSF}$.  Since the PSF may vary across the image, the correction
    2472 is determined as a function of position in the image.  Like the PSF
    2473 model, the 2D variations of the aperture correction may be modeled as
    2474 a polynomial or via interpolation in a grid.  For the $3\pi$ PV3
    2475 analysis, a grid with a maximum of $6\times 6$ samples per GPC1 chip
    2476 image was used.  The reported PSF magnitudes for all objects have this
    2477 aperture correction applied.
    2478 
    2479 % growth curve analysis in psphot:
    2480 % in psphotChoosePSF : call psphotMakeGrowthCurve
    2481 % in psphotMakeGrowthCurve : boolean GROWTH_FROM_SOURCES, use
    2482 %% pmGrowthCurveGenerateFromSources or
    2483 %% pmGrowthCurveGenerate (uses PSF model only)
    2484 %% GROWTH_FROM_SOURCES is set to TRUE for default recipe
    2485 
    2486 %% ApTrend:
    2487 %% in psphotApResid, called by psphotReadout near the end of the
    2488 %% analysis
    2489 %% ApTrend = f(x,y) for (apMag - psfMag) for psfMagErr <= 0.03
    2490 %% apMag is growth curve corrected
    2491 %% psfMag is raw
    2492 
    2493 %% raw psfMag and raw apMag are measured
    2494 %% apMag = apMagRaw + growth curve correction (from apRadius to 25 pix
    2495 %% = PSF_REF_RADIUS)
    2496 %% psfMag = psfMagRaw + aperture trend (<ap - psf> + growth curve)
    2497 
    2498 % How important is this effect?  Consider a typical bright source with a
    2499 % flux of (say) 40,000 counts in an image of background 1000 counts per
    2500 % pixel, with FWHM of 4 pixels.  In principle, the flux of this source
    2501 % should be measurable with an accuracy of roughly 0.57\%
    2502 % ($\frac{\sqrt{40000 + 1000 \times 12}}{40000}$).  However, the
    2503 % measurement of the sky is limited at some finite level by Poisson
    2504 % statistics.  If we are required to use an aperture of (say) 25 pixels
    2505 % in radius (eg, 5 arcseconds for an 0.2 arcsec / pixel detector), and
    2506 % we have an annulus of twice this radius to measure the local sky, then
    2507 % we will have an error of XXX.
    2508 %
    2509 % \note{outline the variation of {\em ApResid} as a function of
    2510 % magnitude}.
    2511 
    2512 %%% \ippprog{psphot} measures the aperture correction ({\em ApResid}) for every PSF
    2513 %%% candidate source, then calculates the trend of this correction as a
    2514 %%% function of the magnitude.  This trend is fitted with a line.  The
    2515 %%% resulting function can be used to determine the effective aperture
    2516 %%% correction for an infinite flux source and the average bias inherent
    2517 %%% in the sky measurement for the image.  The scatter of the
    2518 %%% PSF-candidate source measurements about this trend is a measure of how
    2519 %%% well we can measure photometry from the image by applying the specific
    2520 %%% PSF model.  The slope of this trend is a measure of the bias in the
    2521 %%% local sky measurment for each source.  In principal, the measured sky
    2522 %%% levels could be modified by this bias.  More generally, the measured
    2523 %%% bias in a collection of images could be used to improve the model
    2524 %%% fitting or sky fitting portion of the software the remove the bias
    2525 %%% term.
    2526 
    2527 \ippprog{psphot} allows a collection of PSF model functions to be tried on all
    2528 PSF candidate sources.  For each model test, the above corrected
    2529 ApResid scatter is measured.  The PSF model function with the smallest
    2530 value for the ApResid scatter is then used by \ippprog{psphot} as the best PSF
    2531 model for this image.  The number of models to be tested is specified
    2532 by the configuration keyword \code{PSF_MODEL_N}.  The configuration
    2533 variables \code{PSF_MODEL_0}, \code{PSF_MODEL_1}, through
    2534 \code{PSF_MODEL_N - 1} specify the names of the models which should be
    2535 tested.
     2621\subsection{Galaxy Model Simulations}
     2622
     2623To test the galaxy model analysis, we have generated a series of
     2624simulated images containing both stars and galaxies on which we have
     2625run the \ippprog{psphot} PSF-convolved galaxy model fitting analysis.
     2626The images generated for this analysis have dimensions of $4000 \times
     26274000$ pixels with a spatial scale of 0.25 arcseconds per pixel.  The
     2628images are generated using an effective exposure time of 30 seconds,
     2629with zero points matching the PS1 \rps-filter, and a realistic sky
     2630brightness of 20.86 magnitudes per square arcsecond.  The stars are
     2631injected into these images with fluxes drawn from a realistic stellar
     2632luminosity function and random spatial locations.  For each image, the
     2633same underlying simulated stellar population was used.  Galaxies are
     2634injected into the image with positions on a regularly spaced grid with
     2635separation of 120 pixels.  The galaxies are injected using Exponential
     2636and DeVaucouleur profiles in separate simulation runs.  The major axis
     2637values are randomly distributed between 1 and 10 pixels (0.25 - 2.5
     2638arcseconds) while the aspect ratios are randomly chosen in a range
     2639from 0.25 to 1.0.  The position angles are set by the sequence in the
     2640image and allowed to vary from 0 to 180 degrees.  The images are then
     2641convolved with a PSF model using the \code{PS1_V1} profile ($\kappa =
     26420.2$) and noise is added using Poisson statistics for the detected photons.
     2643
     2644For the figures below, we present results as a function of the (input)
     2645instrumental magnitude of the galaxy minus the instrumental magnitude
     2646corresponding to the stellar $5 \sigma$ detection limit.  We make the
     2647simplifying assumption that the stellar detection threshold
     2648encapsulates enough information about the sensitivity of the images
     2649that this magnitude difference may be used to compare the results
     2650shown here to images with other depths.  Thus this and subsequent
     2651figures may be compared with the reported detection limits from the
     2652PS1 $3\pi$ survey.  Note for reference that the typical stellar
     2653detection limits in the PS1 $3\pi$ stack images are (\grizy) = (23.3,
     265423.2, 23.1, 22.3, 21.4).  The minimum Kron magnitudes for which galaxy
     2655model fits were performed for the PV3 analysis
     2656(Section~\ref{sec:extended.source}) thus correspond to -1.6 to -1.8 in
     2657these plots.
     2658
     2659Figure~\ref{fig:galaxy.complete} shows completeness for the detection
     2660of the Exponential and DeVaucouleur model galaxies.  This analysis
     2661does not indicate if the galaxy was detected {\em as a galaxy} (\ie,
     2662was the extended nature of the source sufficiently clear), only if
     2663the source was detected by the peak-finding algorithm.  As expected,
     2664the more compact galaxies are more likely to be detected; Exponential
     2665profile galaxies, with a broader light distribution for the same
     2666effective radius, are less likely to be detected for the same
     2667magnitude than DeVaucouleur profile galaxies.
     2668
     2669\begin{figure}[htbp]
     2670  \begin{center}
     2671 \includegraphics[width=\hsize,clip]{pics/{galaxy.exp.complete}.png}
     2672 \includegraphics[width=\hsize,clip]{pics/{galaxy.dev.complete}.png}
     2673  \caption{\label{fig:galaxy.complete} Top: Completeness curves for
     2674    simulated galaxies with Exponential profiles.  Bottom:
     2675    Completeness curves for simulated galaxies with DeVaucouleur
     2676    profiles.  The curves are shown as a function of the difference
     2677    between the injected instrumental magnitude of the galaxy and the
     2678    magnitude corresponding to the $5\sigma$ detection threshold for a
     2679    PSF-like source.  The black curves shows the compleness for all
     2680    galaxies.  The three colored curves show the completeness for
     2681    three major axis ranges. Compact galaxies are more likely to be
     2682    detected since peaks are detected after convolution with the
     2683    PSF. }
     2684  \end{center}
     2685\end{figure}
     2686
     2687\begin{figure*}[htbp]
     2688  \begin{center}
     2689 \includegraphics[width=\hsize,clip]{pics/{galaxy.exp.params}.png}
     2690  \caption{\label{fig:exp.complete} Parameter recovery for simulated
     2691    galaxies with Exponential profiles.  }
     2692  \end{center}
     2693\end{figure*}
     2694
     2695\begin{figure*}[htbp]
     2696  \begin{center}
     2697 \includegraphics[width=\hsize,clip]{pics/{galaxy.dev.params}.png}
     2698  \caption{\label{fig:dev.complete} Parameter recovery for simulated
     2699    galaxies with DeVaucouleur profiles.  }
     2700  \end{center}
     2701\end{figure*}
    25362702
    25372703\section{Forced Photometry Modes}
     
    26792845\label{sec:lensing.params}
    26802846
    2681 \begin{verbatim}
    2682 * background : KSB, related (mention Deacon et al here or at the end?)
    2683 * second moments are discussed above (same values, including window function as given)
    2684 * write out the KSB formalism
    2685 * stellar parameters using PSF stars
    2686 * output parameters
    2687 * this is only done on warp -- move to ForceWarp section?
    2688 \end {verbatim}
    2689 
    26902847Weak-lensing studies frequently use non-parametric measurements of the
    26912848ellipticities of galaxies to quantify the strength of gravitational
     
    27062863applied the techinique to PTF data to search for binary stars and
    27072864\cite{2017MNRAS.468.3499D} used the same technique to search for
    2708 binary companions to known ultracool dwarfs using Pan-STARRS $\3pi$
     2865binary companions to known ultracool dwarfs using Pan-STARRS $3\pi$
    27092866data.  The work by \cite{2017MNRAS.468.3499D} used images and their
    27102867own analysis of the pixels with the program Sextractor
    27112868\citep{Bertin.ref}.
    27122869
    2713 For the Pan-STARRS $\3pi$ PV3 analysis, we have measured the full set
    2714 of KSB lensing parameters for \note{which subset?} of the data to
    2715 enable both lensing studies and binary / multiple star searches.  Here
    2716 we describe the measurements as performed within \ippprog{psphot},
    2717 reviewing the mathematical framework as described by
    2718 \cite{1995ApJ...449..460K} and \cite{1998ApJ...504..636H}.
     2870For the Pan-STARRS $3\pi$ PV3 analysis, we have measured the full set
     2871of KSB lensing parameters for all objects with measured second moments
     2872(i.e.,, excluding saturated stars, suspected cosmic rays, and other
     2873likely defects) of the data to enable both lensing studies and binary
     2874/ multiple star searches.  Here we describe the measurements as
     2875performed within \ippprog{psphot}, reviewing the mathematical
     2876framework as described by \cite{1995ApJ...449..460K} and
     2877\cite{1998ApJ...504..636H}.
    27192878
    27202879The goal of the KSB technique is to measure the intrinsic ellipticity
    27212880of objects (i.e., galaxies, in the case of weak lensing studies) as
    2722 would be observed sky on the without instrumental effects.  The
    2723 analysis starts with the observed ellipticity of the object as
    2724 represented by the two polarization components derived from the second
    2725 moments (see Section~\ref{sec:moments}):
     2881would be observed sky on the without instrumental effects and to
     2882determine the impact weak graviational lensing would have on the
     2883observed shapes, after correction for the instrumental effects.  The
     2884analysis starts with the observed ellipticity of objects as represented
     2885by the two polarization components derived from the second moments
     2886(see Section~\ref{sec:moments}):
    27262887\begin{eqnarray}
     2888\label{eqn:polarization}
    27272889  e_1 = \frac{M_{xx} - M_{yy}}{M_{xx} + M_{yy}} \\
    27282890  e_2 = \frac{2 M_{xy}}{M_{xx} + M_{yy}}. \\
     
    27382900$e_2$ and low absoluate values of $e_1$.
    27392901
    2740 \note{need for the window function}.
    2741 
    2742 The observed ellipticity of an object observed in a real instrument
     2902Note that in our analysis of the second moments, we are applying a
     2903Gaussian window function to down-weight the noise contributions from
     2904pixels at high radii and low flux (see Section~\ref{sec:moments}).
     2905This type of window function is also assumed in the KSB formalism, and
     2906is represented in the equations below as $W$.
     2907
     2908The measured ellipticity of an object observed in a real instrument
    27432909will be affected by the point spread function of the instrument.  To
    27442910first order, the effect on the polarization components can be
    2745 described as a combination of ``smear'', in which the observed shape
    2746 is more circularized (driving $e_1,e_2$ to low absolute values) and
    2747 ``shear'', in which the observed shape is stretched in one direction
     2911described as a combination of the circularly symmetric seeing disc,
     2912which smears the observed shapes (driving $e_1,e_2$ to low absolute
     2913values) and the shearing effect of the anisotropic component of the
     2914PSF, in which the observed shape is stretched in one direction
    27482915relative to the others (driving $e_1,e_2$ to larger absolute values).
    2749 With sufficient understanding of the image PSF, both shear and smear
    2750 terms can be corrected. 
    2751 
    2752 The change in the observed polarization of an object due to the
    2753 
     2916
     2917KSB and HFK quantify the change in the observed polarization due to
     2918the smearing effect of the PSF with
     2919\begin{equation}
     2920  \delta e^{\rm sm}_\alpha = P^{\rm sm}_{\alpha, \beta} p_{\beta}
     2921\end{equation}
     2922$p_\beta$ is a measurement of the
     2923anisotropy of the PSF (see below), and $P^{\rm sm}_{\alpha,\beta}$ is
     2924the ``Smear Polarizability'' of the object, defined as 
    27542925\begin{eqnarray}
    2755 X^{sh}_{1,1} = T^{-1} \sum f \left[ 2W(x^2 + y^2) + 2W^\prime (x^2 - y^2)^2 \\
    2756 X^{sh}_{1,2} = T^{-1} \sum f \left[ 4W^\prime(x^2 - y^2) x y \\
    2757 X^{sh}_{2,2} = T^{-1} \sum f \left[ 2W(x^2 + y^2) + 8W^\prime x^2 y^2 \\
     2926  P^{\rm sm}_{\alpha \beta} = X^{\rm sm}_{\alpha \beta} - e_\alpha e^{\rm sm}_\beta
     2927\end{eqnarray} 
     2928where
     2929\begin{eqnarray}
     2930X^{\rm sm}_{1,1} &=& \frac{1}{T} \sum f \left[ W + 2W^\prime r^2 + W^{\prime \prime} (x^2 - y^2)^2 \right] \\
     2931X^{\rm sm}_{1,2} &=& \frac{1}{T} \sum f \left[ 2W^{\prime\prime} (x^2 - y^2) x y \right] \\
     2932X^{\rm sm}_{2,2} &=& \frac{1}{T} \sum f \left[ W + 2W^\prime r^2 + 4W^{\prime \prime} x^2 y^2 \right]
    27582933\end{eqnarray}
    2759 
     2934and 
    27602935\begin{eqnarray}
    2761 e^{sh}_1 = 2 e_1 + 2 T^{-1} \sum f W^\prime (x^2 + y^2) (x^2 - y^2) \\
    2762 e^{sh}_2 = 2 e_2 + 2 T^{-1} \sum f W^\prime (x^2 + y^2) 2 x y \\
     2936e^{\rm sm}_1 &=& \frac{1}{T} \sum f \left[ 2W^\prime + W^{\prime \prime} (x^2 + y^2) \right] (x^2 - y^2) \\
     2937e^{\rm sm}_2 &=& \frac{1}{T} \sum f \left[ 2W^\prime + W^{\prime \prime} (x^2 + y^2) \right] 2 x y.
    27632938\end{eqnarray}
    2764 
     2939In these equations, $T = M_{xx} + M_{yy}$ and $W$ is the window
     2940function applied when measuring the second moments.  The terms
     2941$W^\prime$ and $W^{\prime \prime}$ are the derivatives of the window
     2942function with respect to $r^2 = x^2 + y^2$.  Since the window function
     2943is a circularly-symmetric Gaussian with width $\sigma_w$, the
     2944derivatives are simply $W^\prime = -\frac{1}{2\sigma^2_w} W$ and
     2945$W^{\prime \prime} = \frac{1}{4\sigma^4_w} W$.
     2946
     2947The elements of the equations above can be written in terms of the second and higher-order
     2948moments calculated in Section~\ref{sec:moments}:
    27652949\begin{eqnarray}
    2766 X^{sm}_{1,1} = T^{-1} \sum f \left[ W + 2W^\prime (x^2 + y^2) + W^{\prime \prime} (x^2 - y^2)^2 \\
    2767 X^{sm}_{1,2} = T^{-1} \sum f \left[ 2W^{\prime\prime} (x^2 - y^2) x y \\
    2768 X^{sm}_{2,2} = T^{-1} \sum f \left[ W + 2W^\prime (x^2 + y^2) + 4W^{\prime \prime} x^2 y^2 \\
     2950X^{\rm sm}_{1,1} &=& \frac{1}{T} \left[ 1 - \frac{R_2}{\sigma^{2}} + \frac{(M_{xxxx} - 2 M_{xxyy} + M_{yyyy})}{4 \sigma^{4}} \right] \\[0.1in]
     2951X^{\rm sm}_{1,2} &=& \frac{1}{T} \left[ \frac{(M_{xyyy} - M_{xxxy})}{2 \sigma^{4}} \right] \\[0.1in]
     2952X^{\rm sm}_{2,2} &=& \frac{1}{T} \left[ 1 - \frac{R_2}{\sigma^{2}} + \frac{ M_{xxyy}}{\sigma^{4}} \right]
    27692953\end{eqnarray}
    2770  
     2954and 
    27712955\begin{eqnarray}
    2772 e^{sm}_1 = T^{-1} \sum f \left[ 2W^\prime + W^{\prime \prime} (x^2 + y^2) \right] (x^2 - y^2) \\
    2773 e^{sm}_2 = T^{-1} \sum f \left[ 2W^\prime + W^{\prime \prime} (x^2 + y^2) \right] 2 x y \\
     2956e^{\rm sm}_1 &=& \frac{1}{T} \left[ \frac{M_{xx} - M_{yy}}{\sigma^{2}} + \frac{M_{xxxx} - M_{yyyy}}{4 \sigma^{4}} \right] \\[0.1in]
     2957e^{\rm sm}_2 &=& \frac{1}{T} \left[ \frac{(M_{xxxy} + M_{xyyy})}{2\sigma^{4}} - \frac{2 M_{xy}}{\sigma^{2}} \right]
    27742958\end{eqnarray}
    2775  
    2776 
    2777 @ARTICLE{2017MNRAS.468.3499D,
    2778    author = {{Deacon}, N.~R. and {Magnier}, E.~A. and {Best}, W.~M.~J. and
    2779         {Liu}, M.~C. and {Dupuy}, T.~J. and {Chambers}, K.~C. and {Draper}, P.~W. and
    2780         {Flewelling}, H. and {Metcalfe}, N. and {Tonry}, J.~L. and {Wainscoat}, R.~J. and
    2781         {Waters}, C.},
    2782     title = "{Identification of partially resolved binaries in Pan-STARRS 1 data}",
    2783   journal = {\mnras},
    2784 archivePrefix = "arXiv",
    2785    eprint = {1702.05491},
    2786  primaryClass = "astro-ph.SR",
    2787  keywords = {binaries: visual, brown dwarfs},
    2788      year = 2017,
    2789     month = jul,
    2790    volume = 468,
    2791     pages = {3499-3515},
    2792       doi = {10.1093/mnras/stx440},
    2793    adsurl = {http://adsabs.harvard.edu/abs/2017MNRAS.468.3499D},
    2794   adsnote = {Provided by the SAO/NASA Astrophysics Data System}
    2795 }
    2796 
    2797 @ARTICLE{1995ApJ...449..460K,
    2798    author = {{Kaiser}, N. and {Squires}, G. and {Broadhurst}, T.},
    2799     title = "{A Method for Weak Lensing Observations}",
    2800   journal = {\apj},
    2801    eprint = {astro-ph/9411005},
    2802  keywords = {COSMOLOGY: OBSERVATIONS, COSMOLOGY: DARK MATTER, GALAXIES: FORMATION, COSMOLOGY: GRAVITATIONAL LENSING, COSMOLOGY: LARGE-SCALE STRUCTURE OF UNIVERSE},
    2803      year = 1995,
    2804     month = aug,
    2805    volume = 449,
    2806     pages = {460},
    2807       doi = {10.1086/176071},
    2808    adsurl = {http://adsabs.harvard.edu/abs/1995ApJ...449..460K},
    2809   adsnote = {Provided by the SAO/NASA Astrophysics Data System}
    2810 }
    2811 @ARTICLE{1998ApJ...504..636H,
    2812    author = {{Hoekstra}, H. and {Franx}, M. and {Kuijken}, K. and {Squires}, G.
    2813         },
    2814     title = "{Weak Lensing Analysis of CL 1358+62 Using Hubble Space Telescope Observations}",
    2815   journal = {\apj},
    2816  keywords = {GALAXIES: CLUSTERS: INDIVIDUAL ALPHANUMERIC: CL 1358+62, GALAXIES: FUNDAMENTAL PARAMETERS, COSMOLOGY: GRAVITATIONAL LENSING, galaxies: clusters: individual (Cl 1358 + 62), Galaxies: Fundamental Parameters, Cosmology: Gravitational Lensing},
    2817      year = 1998,
    2818     month = sep,
    2819    volume = 504,
    2820     pages = {636-660},
    2821       doi = {10.1086/306102},
    2822    adsurl = {http://adsabs.harvard.edu/abs/1998ApJ...504..636H},
    2823   adsnote = {Provided by the SAO/NASA Astrophysics Data System}
    2824 }
    2825 @ARTICLE{2005ApJ...626.1070H,
    2826    author = {{Hoekstra}, H. and {Wu}, Y. and {Udalski}, A.},
    2827     title = "{An Algorithm to Detect Blends with Eclipsing Binaries in Planet Transit Searches}",
    2828   journal = {\apj},
    2829    eprint = {astro-ph/0501353},
    2830  keywords = {Stars: Binaries: Eclipsing, Stars: Planetary Systems},
    2831      year = 2005,
    2832     month = jun,
    2833    volume = 626,
    2834     pages = {1070-1078},
    2835       doi = {10.1086/430299},
    2836    adsurl = {http://adsabs.harvard.edu/abs/2005ApJ...626.1070H},
    2837   adsnote = {Provided by the SAO/NASA Astrophysics Data System}
    2838 }
    2839 @ARTICLE{2013ApJS..206...18T,
    2840    author = {{Terziev}, E. and {Law}, N.~M. and {Arcavi}, I. and {Baranec}, C. and
    2841         {Bloom}, J.~S. and {Bui}, K. and {Burse}, M.~P. and {Chorida}, P. and
    2842         {Das}, H.~K. and {Dekany}, R.~G. and {Kraus}, A.~L. and {Kulkarni}, S.~R. and
    2843         {Nugent}, P. and {Ofek}, E.~O. and {Punnadi}, S. and {Ramaprakash}, A.~N. and
    2844         {Riddle}, R. and {Sullivan}, M. and {Tendulkar}, S.~P.},
    2845     title = "{Millions of Multiples: Detecting and Characterizing Close-separation Binary Systems in Synoptic Sky Surveys}",
    2846   journal = {\apjs},
    2847 archivePrefix = "arXiv",
    2848    eprint = {1210.4550},
    2849  primaryClass = "astro-ph.SR",
    2850  keywords = {binaries: close, methods: data analysis, stars: statistics, surveys, techniques: image processing },
    2851      year = 2013,
    2852     month = jun,
    2853    volume = 206,
    2854       eid = {18},
    2855     pages = {18},
    2856       doi = {10.1088/0067-0049/206/2/18},
    2857    adsurl = {http://adsabs.harvard.edu/abs/2013ApJS..206...18T},
    2858   adsnote = {Provided by the SAO/NASA Astrophysics Data System}
    2859 }
     2959where $R_2 = M_{xx} + M_{yy}$.
     2960
     2961KSB and HFK use the observed ellipticities of stars and the smear
     2962polarizability of the stars to estimate the anisotropy due to the PSF:
     2963\begin{eqnarray}
     2964p_\alpha = \frac{e^*_{\alpha}}{P^{{\rm sm},*}_{\alpha \alpha}}
     2965\end{eqnarray}
     2966where the terms with the $*$ represent parameters measured on stars.
     2967
     2968%% \begin{eqnarray}
     2969%%   p_1 &=& M_{xx} - M_{yy} \\
     2970%%   p_2 &=& 2 M_{xy}
     2971%% \end{eqnarray}
     2972
     2973Similarly, the impact of shear can be quantified by the ``Shear
     2974Polarizabilty'' in a similar fashion:
     2975\begin{equation}
     2976  \delta e^{\rm sh}_\alpha = P^{\rm sh}_{\alpha, \beta} p_{\beta}
     2977\end{equation}
     2978where now the shear polarizability $P^{\rm sh}_{\alpha \beta}$ is
     2979defined as
     2980\begin{eqnarray}
     2981  P^{\rm sh}_{\alpha \beta} = X^{\rm sh}_{\alpha \beta} - e_\alpha e^{\rm sh}_\beta
     2982\end{eqnarray} 
     2983where
     2984\begin{eqnarray}
     2985X^{\rm sh}_{1,1} &=& \frac{1}{T} \sum f \left[ 2W(x^2 + y^2) + 2W^\prime (x^2 - y^2)^2 \right] \\
     2986X^{\rm sh}_{1,2} &=& \frac{1}{T} \sum f \left[ 4W^\prime(x^2 - y^2) x y \right] \\
     2987X^{\rm sh}_{2,2} &=& \frac{1}{T} \sum f \left[ 2W(x^2 + y^2) + 8W^\prime x^2 y^2 \right]
     2988\end{eqnarray}
     2989and
     2990\begin{eqnarray}
     2991e^{\rm sh}_1 &=& 2 e_1 + \frac{2}{T} \sum f W^\prime (x^2 + y^2) (x^2 - y^2) \\
     2992e^{\rm sh}_2 &=& 2 e_2 + \frac{2}{T} \sum f W^\prime (x^2 + y^2) 2 x y.
     2993\end{eqnarray}
     2994
     2995Re-writing in terms of the second and higher-order moments calculated
     2996in Section~\ref{sec:moments}, we find:
     2997\begin{eqnarray}
     2998X^{\rm sh}_{1,1} &=& \frac{1}{T} \left[ 2 R_2 - \frac{(M_{xxxx} - 2 M_{xxyy} + M_{yyyy})}{\sigma^{2}} \right] \\
     2999X^{\rm sh}_{1,2} &=& \frac{1}{T} \left[ \frac{2(M_{xyyy} - M_{xxxy})}{\sigma^{2}} \right] \\
     3000X^{\rm sh}_{2,2} &=& \frac{1}{T} \left[ 2 R_2 - \frac{4 M_{xxyy}}{\sigma^{2}} \right]
     3001\end{eqnarray}
     3002and 
     3003\begin{eqnarray}
     3004e^{\rm sh}_1 &=& \frac{1}{T} \left[ 2 (M_{xx} - M_{yy}) + \frac{( M_{yyyy} - M_{xxxx})}{\sigma^{2}} \right] \\
     3005e^{\rm sh}_2 &=& \frac{1}{T} \left[ 4 M_{xy} - \frac{2 (M_{xxxy} + M_{xyyy})}{\sigma^{2}} \right]
     3006\end{eqnarray}
     3007
     3008In the Pan-STARRS PV3 analysis, we have measured the elements of the
     3009smear polarizability ($X^{\rm sm}_{\alpha \beta}$, $e^{\rm
     3010  sm}_\alpha$) and the shear polarizability ($X^{\rm sh}_{\alpha
     3011  \beta}$, $e^{\rm sh}_\alpha$) for all objects on each of the warp
     3012images.  We have also selected only the PSF stars from the images and
     3013interpolated a smoothed version of these parameters to the location of
     3014the objects, using the grid described above to interpolate the PSF
     3015parameters.  We also determine the interpolated PSF ellipticities
     3016($e^*_1, e^*_2$) from the equivalent smooth grid.  Thus, for every
     3017object in the $3\pi$ survey, we are able to report the PSF and object
     3018elements of the KSB analysis.  These lensing parameters are measured
     3019for each of the warps, and then averaged over all warps for each of
     3020the filters.  The average values are calculated by including only
     3021measurements from the same warp detection used in the average
     3022photometry (nominally, the primary skycell; see Paper V, Section
     30235.4.4) and excluding any measurements for which the \code{PSF_QF} or
     3024\code{PSF_QF_PERFECT} is less than 0.85.
     3025
     3026\note{example of using the lensing elements for binaries?}
    28603027
    28613028\section{Difference Image Photometry}
  • trunk/doc/release.2015/ps1.analysis/examples/.mana

    r40693 r40705  
    197197set dMxy = Mxy_s - Mxy_o
    198198lim -n 2 theta dMxy; clear; box; plot theta dMxy; line -c red 0 $Mxy_p to 360 $Mxy_p
     199input moments.sh
     200test.convolve
     201test.convolve 1
     202lim theta Mxx_s; clear; box; plot theta Mxx_s
     203lim theta Mxx_s; clear; box; plot theta Mxx_s; plot -c red theta Mxx_o
     204set dMxx = Mxx_s - Mxx_o
     205lim -n 1 theta dMxx; clear; box; plot theta dMxx
     206line 0 $Mxx_p to 360 $Mxx_p -c red
     207set dMyy = Myy_s - Myy_o
     208lim theta Myy_s; clear; box; plot theta Myy_s; plot -c red theta Myy_o
     209lim -n 0 theta 0 110; clear; box; plot theta Myy_s; plot -c red theta Myy_o
     210lim -n 0 theta 0 160; clear; box; plot theta Myy_s; plot -c red theta Myy_o
     211lim -n 0 theta 0 150; clear; box; plot theta Myy_s; plot -c red theta Myy_o
     212lim -n 1 theta dMyy; clear; box; plot theta dMyy
     213line 0 $Myy_p to 360 $Myy_p -c red
     214lim -n 1 theta 30 40; clear; box; plot theta dMyy; line 0 $Myy_p to 360 $Myy_p -c red
     215lim -n 1 theta 35 37; clear; box; plot theta dMyy; line 0 $Myy_p to 360 $Myy_p -c red
     216lim -n 1 theta 35.9 36.1; clear; box; plot theta dMyy; line 0 $Myy_p to 360 $Myy_p -c red
     217lim -n 1 theta 35.99 36.01; clear; box; plot theta dMyy; line 0 $Myy_p to 360 $Myy_p -c red
     218lim -n 0 theta -10 10; clear; box; plot theta Mxy_s; plot -c red theta Mxy_o
     219lim -n 0 theta Mxy_s; clear; box; plot theta Mxy_s; plot -c red theta Mxy_o
     220lim -n 0 theta Mxy_o; clear; box; plot theta Mxy_s; plot -c red theta Mxy_o
     221lim -n 0 theta Mxy_o; clear; box; plot theta Mxy_s; plot -c red theta Mxy_o -pt ocir -sz 2
     222input moments.sh
     223test.convolve
     224test.convolve 0
     225lim -n 0 theta 0 150; clear; box; plot theta Myy_s; plot -c red theta Myy_o
     226set dMyy = Myy_s - Myy_o
     227set dMxy = Mxy_s - Mxy_o
     228set dMxx = Mxx_s - Mxx_o
     229lim -n 1 theta dMxx; clear; box; plot theta dMxx
     230lim -n 1 theta dMxx; clear; box; plot theta dMxx; line 0 $Mxx_p to 360 $Mxx_p -c red
     231lim -n 0 theta 0 150; clear; box; plot theta Mxx_s; plot -c red theta Mxx_o
     232lim -n 0 theta 0 120; clear; box; plot theta Mxx_s; plot -c red theta Mxx_o
     233lim -n 0 theta 0 150; clear; box; plot theta Myy_s; plot -c red theta Myy_o
     234lim -n 1 theta dMyy; clear; box; plot theta dMyy; line 0 $Myy_p to 360 $Myy_p -c red
     235echo $Mxx_p $Myy_p
     236lim -n 0 theta Mxy_s; clear; box; plot theta Mxy_s; plot -c red theta Mxy_o
     237lim -n 1 theta dMxy; clear; box; plot theta dMxy; line 0 $Mxy_p to 360 $Mxy_p -c red
     238pwd
  • trunk/doc/release.2015/ps1.analysis/examples/moments.sh

    r40693 r40705  
    151151  rotate fr 2
    152152end
     153
     154
     155macro test.convolve
     156  if ($0 != 2)
     157    echo "USAGE: show.smear (sigma)"
     158    break
     159  end
     160
     161  mcreate z 512 512
     162  set x = xramp(z) - z[][0]/2
     163  set y = yramp(z) - z[0][]/2
     164
     165  # convolve psf (oriented along yy axis) with object (rotating)
     166  # object 1:
     167  set f0 = exp(-0.5*((x/2)^2 + (y/10)^2))
     168
     169  set psf_r = exp(-0.5*((x/2)^2 + (y/6)^2))
     170  rotate psf_r 30.0
     171  extract psf_r psf {psf_r[][0]/2 - 256} {psf_r[0][]/2 - 256} 512 512 0 0 512 512
     172
     173  # set psf = exp(-0.5*((x/2)^2 + (y/6)^2))
     174  star -q psf {psf[][0]/2} {psf[0][]/2} 128
     175  $Mxx_p = ($SXg/2.355)^2
     176  $Myy_p = ($SYg/2.355)^2
     177  $Mxy_p = $SXYg
     178
     179  delete -q e1_s e2_s e1_o e2_o theta Mxx_s Mxy_s Myy_s Mxx_o Mxy_o Myy_o
     180  for rot 0 360 5
     181    set fr = f0
     182    rotate fr $rot
     183    concat $rot theta
     184
     185    delete -q frs
     186    extract fr frs {fr[][0]/2 - 256} {fr[0][]/2 - 256} 512 512 0 0 512 512
     187
     188    imconvolve frs psf fs
     189
     190    star -q fs {fs[][0]/2} {fs[0][]/2} 128
     191
     192    $Mxx = ($SXg/2.355)^2
     193    $Myy = ($SYg/2.355)^2
     194    $Mxy = $SXYg
     195
     196    concat $Mxx Mxx_s
     197    concat $Mxy Mxy_s
     198    concat $Myy Myy_s
     199
     200    # fr is the rotated version of f0
     201    star -q fr {fr[][0]/2} {fr[0][]/2} 128
     202
     203    $Mxx = ($SXg/2.355)^2
     204    $Myy = ($SYg/2.355)^2
     205    $Mxy = $SXYg
     206
     207    concat $Mxx Mxx_o
     208    concat $Mxy Mxy_o
     209    concat $Myy Myy_o
     210  end
     211end
Note: See TracChangeset for help on using the changeset viewer.