kepprf -- Fit a PSF model to a specific image within a Target Pixel File
kepprf infile plotfile rownum columns rows fluxes border background focus prfdir xtol ftol imscale colmap plot verbose logfile status
infile = string
The name of a MAST standard format FITS file containing Kepler Target Pixel data within the first data extension.
plotfile = string
Name of an optional output plot file containing the results of kepprf. An example is provided in Figure 1. Typically this is a PNG format file. If no file is required, plotfile can be 'None' or blank, in which case the plot will be generated but the plot will not be saved to a file. Any existing file with this name will be automatically overwritten.
rownum = integer
The row number in the input file data table containing the pixels to plot. If the chosen observation has a non-zero quality flag set or the pixel set contains only NULLs then the task will halt with an error message.
columns = float
A starting guess for the CCD column position(s) of the source(s) that are to be fit. The model is unlikely to converge if the guess is too far away from the correct location. A rule of thumb is to provide a guess within 1 CCD pixel of the true position. If more than one source is being modeled then the column positions of each are separated by a comma. The same number of sources in the columns, rows and fluxes field is a requirement of this task.
rows = float
A starting guess for the CCD row position(s) of the source(s) that are to be fit. The model is unlikely to converge if the guess is too far away from the correct location. A rule of thumb is to provide a guess within 1 CCD pixel of the true position. If more than one source is being modeled then the row positions of each are separated by a comma. The same number of sources in the columns, rows and fluxes field is a requirement of this task.
fluxes = float
A starting guess for the flux(es) of the source(s) that are to be fit. Fit convergence is not particularly reliant on the accuracy of these guesses, but the fit will converge faster the more accurate the guess. If more than one source is being modeled then the row positions of each are separated by a comma. The same number of sources in the columns, rows and fluxes field is a requirement of this task.
border = integer (optional)
If a background is included in the fit then it is modeled as a two-dimensional polynomial. This parameter is the polynomial order. A zero-order polynomial is generally recommended.
background = boolean (optional)
Whether to include a background component in the model. If 'yes' the background will be represented by a two-dimensional polynomial of order border. This functionality is somewhat experimental, with one eye upon potential background gradients across large masks or on those detectors more prone to pattern noise. Generally it is recommended to set background = no.
focus = boolean (optional)
Whether to incude pixel scale and focus rotation with the fit parameters of the model. This is also an experimental function. This approach does not attempt to deal with inter- or intra-pixel variations. The recommended use is currently to set focus = no.
prfdir = string
The full or relative directory path to a folder containing the Kepler PSF calibration. Calibration files can be downloaded from the Kepler focal plane characteristics page at the MAST.
xtol = float
The dimensionless, relative model parameter convergence criterion for the fit algorithm.
ftol = float
The dimensionless, relative model residual convergence criterion for the fit algorithm.
imscale = String
kepprf can plot images with three choices of image scales. The choice is made using this argument. The Options are: linear | logarithmic | squareroot
cmap = string (optional)
Color intensity scheme for the image display. Options:
Accent | Blues | BrBG | BuGn | BuPu | Dark2 | GnBu | Greens | Greys | OrRd | Oranges | PRGn | Paired | Pastel1 | Pastel2 | PiYG | PuBu | PuBuGn | PuOr | PuRd | Purples | RdBu | RdGy | RdPu | RdYlBu | RdYlGn | Reds | Set1 | Set2 | Set3 | Spectral | YlGn | YlGnBu | YlOrBr | YlOrRd | afmhot | autumn | binary | bone | brg | bwr | cool | copper | flag | gist_earth | gist_gray | gist_heat | gist_ncar | gist_rainbow | gist_yarg | gnuplot | gnuplot2 | gray | hot | hsv | jet | ocean | pink | prism | rainbow | seismic | spectral | spring | summer | terrain | winter | browse.
If cmap=browse kepdiffim will plot the choices of color map.
plot = boolean (optional)
Plot fit results to the screen?
verbose = boolean (optional)
Print informative messages and warnings to the shell and logfile?
logfile = string (optional)
Name of the logfile containing error and warning messages.
status = integer
Exit status of the script. It will be non-zero if the task halted with an
error. This parameter is set by the task and should not be modified by the
kepprf fits a PSF model, combined with spacecraft jitter and pixel scale drift (the Pixel Response Function; PRF) to a single observation of Kepler target pixels.
The Kepler PSF calibration is based upon a sequence of dithered commisioning observations performed before the exoplanet survey began. Dithering enables sub-pixel detail of the undersampled PSF to be characterized Anderson and King (2000). Kepler pixel sizes are 3.98x3.98 arcsec and the 95 percent encircled energy is < 7 pixels but varies across the detector. Target masks of 21x21 pixels were selected to capture the majority of the PSF and spacecraft jitter for 19,189 Kp = 11-12 stars over 121 observations. Details of the observations and derivation of the Kepler PSF are provided in Bryson et al. (2010). Unlike the polynomial representations of the PSF descirbed in Bryson et al. (2010) and employed by the pipeline, the publicly archived PSF calibration is stored as a lookup table. It provides the normalized value of the PSF, typically within a 11x11 pixel grid around the target position. Each pixel within the grid is repesented by a 50x50 array representing the value of a pixel for different sub-pixel locations of the taget. The sup-pixel lookup nature of the calibration product naturally provides for the characterization of photon sensitivity and diffusion within individual pixels -- the intra-pixel variability; (Lauer 1999a, Lauer 1999b). An assumption going forward is that all pixels have identical intra-pixel variability within the detector locale of the target. SInce the PSF varies across the field-of-view, five independent lookup tables are provided for each of the 84 detector channels. One at the center of the channel and one in each corner.
The original purposes of the calibration were to enable calculations of the size, shape and location of pixel mask definitions for upload to the spacecraft and, subsequent to observations, calculate centroids for a small number of reference targets in order to measure absolute astrometry and pixel scale. All PSF tables are precise statistically, but a number of systematic features limit their accuracy. i) The stars comprising the PSF calibration are binned coarsely. The PSF model is broadened artificially by combining stars separated by hundreds of detector pixels, and interpolation is required to a target position on the CCD between the sparse lookup table locations. ii) The thermal state of the spacecraft and it's impact upon image focus varies on multiple timescales e.g. with the spacecraft orbit and after Earth-point operations (a href="http://archive.stsci.edu/kepler/manuals/Data_Characteristics.pdf">Christiansen et al. 2013). PSF dithering observations were taken during a relatively short fraction of the spacecraft orbit, close to thermal equilibrium, therefore the PSF calibration has no ability to match the constantly varying \kepler focus. iii) No attempt has been made to investigate the color-dependency on the PSF. Furthermore, applying the calibratiion to survey data requires assumptions that spacecraft jitter on timescales shorter than an exposure remains constant over time and that each source confused spatially with the target star is accounted for.
The PSF model used in the fit is linearly interpolated from the 5 reference models associated with the CCD channel, according to their positions. The model employed can contain any number of sources, with three independent parameters for each. The free parameters are target flux, CCD pixel column location, and CCD pixel row location, \yt. A time-varying background component was calculated within the pipeline from the spatial interpolation of a background reference pixel grid across the detector channel and subtracted from the target pixel data before archiving. In most cases it can be assumed that a secondary direct background subtraction from the target pixels is not required, however the capability is provided in the form or a two-dimension background polynomial that can be added to the source fits. Model fluxes for each pixel in the target mask are extracted directly from the 50x50 sub-sampled PSF calibration. For target pixel positions falling inbetween the subpixels of the calibration product, fluxes are interpolated by 2-dimensional cubic splines. The residual between data and model is minimized by adjusting fit parameters according to the Powell (1964) conjugate direction method. A fit is considered converged once the xtol and ftol criteria are met.
- kepprf infile=kplr008256049-2010174085026_lpd-targ.fits plotfile=q7_kepprf.png rownum=2200 columns=830,831 rows=242,241 fluxes=1.0,0.1 border=0 background=n focus=n prfdir=/Volumes/data/Kepler/PRF xtol=1e-06 ftol=1e-06 imscale=linear colmap=YlOrBr plot=y verbose=y logfile=kepprf.log
Completion upon one observation of target pixels using a 2.66
GHz Intel Core 2 i7 Mac running OS 10.9, takes a few seconds for a fit containing a single source. Run times increase with larger numbers of sources.
BUGS AND LIMITATIONS
The Kepler PyRAF package is made available to the community through the Kepler Science Center at
http://keplerscience.arc.nasa.gov/PyKE.shtml. Please send bug reports and suggestions email@example.com.
Initial software release (MS)