Finally the past function mascara.phot.PhotCore() which performs the photometry for one star, and one aperture.
Though MASCARA doesn’t need to find the stars on the CCD, the mascara.phot.find_stars() function is mainly used when evaluating the accuracy of the astrometric solution. The call of the function is :
>>> import mascara
>>> import numpy
>>> hmin = numpy.nanstd(image) * 4
>>> fwhm = 3.5 # Estimated fwhm at 3.5 pixels
>>> xobs, yobs, sharp, round = mascara.phot.find_stars(image, hmin, fwhm, nsigma=1.5)
All functions are using aperture photometry to evaluate the flux of the star. This means that the user has to define an aperture radius (the red circle in the image below), inside which all the counts of all pixels are added, and two sky radii which shall define a sky annulus (in yellow below). The true flux of the star is then estimated by subtracting the median value of all counts inside the sky annulus to the sum of the counts inside the aperture radius.
Using mascara.phot.GetPhot() is very easy. Let’s continue on the previous example
>>> print 'Number of stars detected on the image: {}'.format(xobs.size)
1543
>>> flux, eflux, sky, esky = mascara.phot.GetPhot(image, xobs, yobs, apr=fwhm, skyrad=[5, 15])
>>> print flux.size
1543
mascara.phot.OnaPhot() deals only with one star at the time, but returns a more complete output about the star. The quality of the sky around the star is analyzed and returned under the form of a integer flag value. For instance, should there be a second bright object in the sky annulus, the flux would be flagged as having an uneven sky background. Similarly, if the star were over exposed resulting in a saturation of the CCD, the measurement would be flagged as overexposed. In addition to the flag, mascara.phot.OnaPhot() returns also the peak value inside the aperture, i.e. the highest pixel value inside the aperture, which can be used as diagnostic tool in further analyses.
find_stars, adapted from the ASTROLIB-routine to find point sources on an image. To do so, the image is convolved with a Gaussian kernel of fwhm as given. Any remaining sources above the background are then potential stars...
Aperture Photometry based on DAOPHOT Aper procedure
Computes concentric aperture photometry for several user specified aperture radii (apr). The sky is evaluated separately using the outer and inner sky radii (skyrad)
OnaPhot is an aperture photometry routine based on the APER or GetPhot routine, but developped for the following cases:
OnaPhot adapt the shape of the aperture to the shape of the star. In addition, it runs a diagnostic of the background. OnaPhot accepts one to 10 different aperture radii.
The output is expressed under the form: [flag, flux0, erflux0, flux1, erflux1, ..., sky, ersky, xm, ym]
Photcore contains just the core of the aperture photometric routine. It is design to work only with one star on one image