ctestis

The purpose of this ctestis task is to correct signal levels of point-like sources in photometry tables measured from STIS CCD images for charge loss due to imperfect Charge Transfer Efficiency (CTE). The algorithm used to correct for CTE-induced signal loss is based on the equations published in Goudfrooij, Bohlin, Maiz-Apellaniz, & Kimble, PASP, October 2006 edition (astro-ph/0608349). The values of CTE loss derived using this algorithm should be accurate to about 3% RMS (tested for data taken between March 1997 and August 2004). No significant differences in CTE loss were found for different aperture sizes, although this has been verified only for a limited range of aperture sizes (2, 3, and 5 pixel radii). The algorithm was derived from measurements of point sources in a relatively sparse field (the outskirts of a Galactic globular cluster), as detailed in the PASP paper mentioned above.

The function also computes the shift in the Y centroid of point sources due to distortions in the steller PDF cause by CTE trails. the algorithm is taken from the Equation 9 of Goodfrooij et al. (2006). Note, however, that the equation has been multiplied by -1, so that the resulting correction may be ADDED to measured Y centriod of each star.

The code takes inputs of net counts for a source (background subtracted), a sky-background estimate, and the source Y-position on the detector (since CTI effects worsen furthest from the readout). The single-pixel sky-background estimate should be measured from individual cosmic-ray (CR) split, bias- and dark-subtracted, and flat-fielded images (flt.fits) that have not had any sky subtracted. This can determined with random sampling and/or iterative sigma-clipping of sky pixels (e.g., Goudfrooij et al. 2006). The net counts measured from the science images (summed, sky- subtracted exposures) should then be scaled to the exposure time of the CR split FLT image (e.g., if CRSPLIT=5, the net counts are divided by five). Note that not all extensions composing an FLT file necessarily have equal exposure times, so a fractional scaling of the CR split to total exposure time of the CR-combined science image (e.g. CRJ) science image should be used to scale the counts. The magnitude correction (dmagc) measured using single-CR split parameters can be added to the magnitude derived from the total exposure time science image with no further scaling.

If working with CRSPLIT scaled sky and net counts values, the filename (stisimage) should not be provided to avoid pulling incorrect information from the image headers. The following parameters therefore should be set manually: nread=1 (indicating it is just one CRSPLIT exposures), gain, mjd (start date), and ybin (BINAXIS2). If image is an sx2.fits file, set sx2=True.

Examples

ctestis with ycol set to 182, net set to 5,000 and sky set to 150.

>>> from stistools.ctestis import ctestis
>>> fluxc, dmagc, dyc = ctestis(182., 5000., 150., stisimage='o4qp9g010_crj.fits')
mjd: 50893.30
nread: 2
ybin: 1
gain:  1.0
amp: D
tt0: -2.3865942
lcts: -0.67595399
bck: 75.0
lbck: 2.317577
cti: 1.7314006e-05
fluxc: 2536.7133
dmagc: -0.015828427
cti10000: 0.17314006
dy512: 0.0043051192
dyc: 0.007079903
net: 5000.0
sky: 150.0
ycol: 182.0
fluxc: 2536.7133
dmagc: -0.015828427
dyc: 0.007079903
stistools.ctestis.ctestis(ycol, net, sky, stisimage=None, mjd=None, nread=None, ybin=None, gain=None, amp='D', sx2=False)

Calculate the STIS empirical correction to magnitude and astrometric shift, given photometry results.

Parameters:
ycolarr

Y-column # of object

netarr

Net photometric counts (background subtracted) measured from science image and scaled to cosmic-ray split exposure time (from which sky is measured)

skyarr

Single-pixel sky-background estimate measured from individual cosmic-ray split, bias- and dark-subtracted, flat-fielded images (flt.fits) with no sky subtraction

stisimagestr, optional

The name of the SX2 file from which to pull the header keywords.

mjdfloat, optional

Modified julian date corresponding to the start time of the 1st exposure, corresponds to the TEXPSTRT keyword. If stisimage file is defined TEXPSTRT keyword will overwrite any provided mjd value.

nreadint, optional

Number of image sets combined during CR rejection, corresponds to the NCOMBINE keyword. If stisimage file is defined NCOMBINE keyword will overwrite any provided nread value.

ybinint , optional

Axis2 data bin size in unbinned detector pixels, corresponds to the BINAXIS2 keyword. If stisimage file is defined BINAXIS2 keyword will overwrite any provided ybin value.

gainfloat, optional

The image gain, corresponds to the CCDGAIN keyword. If stisimage file is defined the CCDGAIN keyword will overwrite any provided gain value. If the gain is 4.0, it will be upated to 4.08.

ampstr, optional

The amplifier used for the observation (default 'D'). Ignored if stisimage is provided.

sx2bool, optional

Force the procedure to remove the top/bottom 38 rows. This is automatically done if the file in stisname contains '_sx2'. Default values is False

Returns:
fluxcarr

The empirically-corrected flux (counts)

dmagcarr

The empirical photometric correction (delta mag)

dycarr

The empirical astrometric correction (delta pixels)