Slotphottools contains the algorithms to perform photometry on slotmode data.

TODO– * Change how the region file is read in so you can use different region formats

slottool.calc_optimal(array, xt, yt, xc, yc, rc, br1, br2, gain, rdnoise, naxis1, naxis2)

Calculate the optimal ratio between the two sources based \chi^{2} pixel fit of the comparison star to the object star. For both stars the background will be removed and then the comparison star will be used as a ‘model’ psf for the \chi^{2} fit. To simplify the error calculation, we are assume the errors on the comparison star are much smaller than the errors on the target star

return ratio, ratio_err

slottool.calcdrift(image, x, y, r, naxis1, naxis2)

Given a central x-y, calculate the drift

slottool.calcratio(target_flux, target_flux_err, compar_flux, compar_flux_err)

Calculate the flux ratio

return ratio, ratio_err

slottool.calcstarbackground(array, x, y, br1, br2, gain, rdnoise, naxis1, naxis2)

Determines the sky background around a single star. Using square annulli. Returns the background flux in terms of e/pix.

In the case br1 and br2 are floats, x and y are the center of the annulli and br1 and br2 are floats which give the half-width of the square annulli. If br1 and br2 are lists, then the background rectangles are defined by br1 and br2.

returns bflux, npix

slottool.calcstat(image, sig, iter)

Calculate the image statistics

slottool.capphot(array, xc, yc, rc, br1, br2, gain, rdnoise, naxis1, naxis2)

Perform circular aperture photometry

return flux, flux_err

slottool.checkedge(x, x0, x1)

Determeine if the value x is over the edge of an image

slottool.cogphot(array, xc, yc, rc, br1, br2, gain, rdnoise, naxis1, naxis2)

Perform curve of growth photometry. Will use <rc> square apertures between 2 pix to the br2 radius. rc now gives the number of apertures to use. br1 gives the annulli to use for sky determination. The flux returned is the flux in the aperture with the highest signal to noise

return flux, flux_err

slottool.dophot(phottype, array, x, y, r, br1, br2, gain, rdnoise, naxis1, naxis2)

Routine to perform photometry on the image. It will perform the requested type of photometry (square aperture, circular aperture, curve of growth, psf fit, or optimal). See the help file for descriptions of each.

returns list of photometry parameters for target and companion


Find the centroid of an array where

cx=\frac{\sum f\cdot x}{\sum f}

returns cx,cy.

slottool.finddrift(image, cx, cy, cr, naxis1, naxis2, sigdet, cpix, sigback, driftlimit, iter)

Starting with the initial x-y of the comparison source, search for the comparison star and see how much it has drifted. Expanding the search if no comparison star is found

returns dx,dy

slottool.findneareststar(array, xc, yc, rc, std, dsig, cpix, naxis1, naxis2)

Search an image for all stars and find the nearest one to the given coordinates

returns an x,y

slottool.getobstime(struct, infile)

Return the time since noon the previous day in seconds

slottool.objdetect(image, sigdet, stddev)

Detect all significant pixels in an image returns count


Read in the lightcurve file


Read in the src file and return the parameters extracted from that file

slottool.sqapphot(array, xc, yc, rc, br1, br2, gain, rdnoise, naxis1, naxis2)

Perform square aperture photometry

returns flux, flux_err

slottool.writedataout(lout, index, time, x, y, target_flux, target_flux_err, compar_flux, compar_flux_err, ratio, ratio_err, time0, reltime)

Write the data out to a file

Previous topic


Next topic


This Page