Open Access
Issue
A&A
Volume 667, November 2022
Article Number A62
Number of page(s) 16
Section Numerical methods and codes
DOI https://doi.org/10.1051/0004-6361/202243067
Published online 08 November 2022

© S. J. Brennan and M. Fraser 2022

Licence Creative CommonsOpen Access article, published by EDP Sciences, under the terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

This article is published in open access under the Subscribe-to-Open model. Subscribe to A&A to support open access publication.

1 Introduction

For over three decades, the most commonly used packages for photometry have been part of the Image Reduction and Analysis Facility (IRAF;1 Tody 1986, 1993). Within IRAF, DAOPHOT (Stetson 1987) is a suite of packages designed to perform photometry in crowded fields.

In 2013, the National Optical-Infrared Astronomy Research Laboratory (NOIRLab)2 suspended further development of IRAF, and since then, a community of astronomers has worked on maintaining the packages and adapting the current version (V2.16; March 22, 2012) to work on modern hardware. However, a large portion of IRAF code cannot be compiled as a 64-bit executable, and must be built as a 32-bit program. Recently, several popular operating systems (for example MacOS) have dropped 32-bit support, which is required for IRAF. With continued development, as well as the emergence of new programming languages, IRAF has become more and more difficult to build and maintain on current architectures. Furthermore, PyRAF (Science Software Branch at STScI 2012), the main Python 2.7 wrapper for IRAF, has lost support and, as of January 1, 2020, users have been encouraged to move to the currently supported Python 3 framework. Photometry tools have also been developed as part of Astropy (Astropy Collaboration 2013, 2018), which is a community led project to develop a set of core software tools for astronomy in Python 3.

Besides IRAF and DAOPHOT, there are a number of other photometry packages in use today. SExtractor (Bertin & Arnouts 1996) is a source detection and de-blending tool used extensively for photometric measurements and is the basis for many modern photometric pipelines (for example see Mommert 2017; Merlin et al. 2019). Other stand-alone photometry packages have been developed, such as A-PHOT (Merlin et al. 2019) and PhotometryPipeline (Mommert 2017), that mainly perform aperture photometry on ground-based images.

In this paper, we present the Automated Photometry Of Transients Pipeline (hereafter referred to as AutoPhOT). AutoPhOT was designed to provide a fast, precise, and accurate means to measure the magnitude of astronomical point sources with little human interaction. The software has been built from the ground up, removing any dependence on the commonly used IRAF or any deprecated Python packages (for example, those that rely on python 2).

AutoPhOT is designed to address some of the specific needs of astronomers working on transient phenomena such as supernovae. Observational campaigns for transients often yield heterogeneous datasets, which include images spanning several nights to decades, taken in a variety of photometric bands, and using different telescope and instrument configurations. For precise photometry, careful extraction of photometric data is required. However, the effect of different instruments and slightly different filter throughputs can increase the overall scatter in photometric data. Furthermore, photometry performed by different astronomers may show discrepancies based on the choice of parameters used, for example quality and number of sequence stars used, aperture size, background subtraction.

AutoPhOT can accept astronomical images from most ground-based telescopes and instruments, and will adapt to image quality and/or telescope parameters to provide a homogeneous photometric output. AutoPhOT uses Astropy packages extensively. As Astropy is community driven, widely used, and written in Python 3, AutoPhOT is likely to have support from these packages for the foreseeable future. AutoPhOT is available on Github3 and available for installation though conda4. AutoPhOT will receive continued support, and one should refer to the online documentation for up-to-date information and further implementations5.

The purpose of this paper is to briefly outline the AutoPhOT package6. Most of the parameters mentioned in this work can be easily changed by the user to adjust to their dataset if necessary, although the code will also attempt to self-optimise these. We discuss the automated pre-processing within AutoPhOT in Sect. 2 and how photometric measurements are made in Sect. 3. We provide a brief outline of the photometric calibration in Sect. 4. We outline the limiting magnitude package in Sect. 6. Finally, we discuss the performance of AutoPhOT and its ability to provide science-ready results in Sect. 7.

2 Pre-processing

2.1 image reduction

Due to the specific nuances of various CCDs, it is left to the user or observing facility to correctly reduce the images prior to running AutoPhOT. These steps should typically include bias, flat-field, and bad pixel corrections. For a general overview on these reduction steps, see Howell (2006).

2.2 Image stacking

AutoPhOT does not currently perform image stacking. Often, multiple exposures will be taken in the same bandpass during the night, in particular when long exposures that are susceptible to cosmic rays are used.

It is difficult to produce a universal image stacking procedure, and it is hence left to the user to stack images if they so wish7. AutoPhOT hence treats multiple images taken on the same night independently. The user is cautioned that if they combine images, they should update the header keywords for gain and readout noise where necessary before running AutoPhOT.

2.3 Target identification

AutoPhOT implements the Transient Name Server8 (TNS) Python API to obtain the most up-to-date coordinates of a particular transient. These coordinates are transformed from right ascension (RA) and declination (Dec) into X and Y pixel coordinates using the image World Coordinate System (WCS; see Sect. 2.5).

If a transient is not known to the TNS, then the coordinates can be manually specified by the user.

2.4 Parsing image and instrument metadata

Flexible Image Transport System (FITS) files are commonly used to store astronomical images. These files typically contain a 2D image as well as the image metadata stored as keyword-value pairs in a human-readable ASCII header. While FITS header keywords contain critical information about the observation itself, such as exposure time, filter, telescope, these keywords are often inconsistent between different observatories.

When AutoPhOT is run on an image from a new telescope, the software asks the user to clarify certain keywords. For example, this may involve clarifying whether ‘SDSS-U’ refers to Sloan u or Johnson–Cousins U. This is the only step in running

Listing 1. Example of entry in telescope.yml for the Nordic Optical Telescope (NOT). This entry includes instrument-specific information needed for header keyword translation (FILTER, AIRMASS, GAIN), filter keywords (g_SDSS: g, B_Bes: B, and so on) as well as location information and extinction terms, discussed further in Sect. 4.3.

NOT:
   INSTRUME:
      ALFOSC_FASU:
         Name: NOT+ALFOSC
         AIRMASS: AIRMASS
         GAIN: GAIN
         RDNOISE: READNOISE
         filter_key_0: FILTER
         filter_key_1: FILTER1
         pixel_scale: 0.213
         B_Bes: B
         V_Bes: V
         colour_index:
            B:
               B-V:
                  m: S.S14
                  m_err: S.SS7
            V:
               B-V:
                  m: -S.1S6
                  m_err: S.S12
            .
            .
            .
      NOTCAM:
         Name: NOT+NOTCAM
         AIRMASS: AIRMASS
         GAIN: GAIN
         .
         .
         .
extinction:
      ex_B: S.2S3
      ex_I: S.S19
      ex_R: S.S69
      .
      .
      .
location:
      alt: 2327
      lat: 28.76
      lon:17.88
      name: lapalma

AutoPhOT which requires human intervention, but is necessary due to the ambiguous filter naming conventions used by some telescopes.

After the AutoPhOT telescope check function has executed, the results are saved as a human-readable Yaml file (see example in Listing 1) allowing for easy additions, alterations, or corrections. When AutoPhOT is subsequently run on images from the same telescope and instrument, it will look up the necessary keywords in this Yaml file.

Along with filter names, the Yaml database contains other instrument-specific information necessary for automated execution of AutoPhOT. The nested dictionary structure allows for multiple instruments at the same telescope (in the example shown, information is given for both the alfosc and NOTCam instruments mounted on the Nordic Optical Telescope).

filter_key_0 gives the fits header key which gives the filter names9. To account for instruments with multiple filter wheels, this keyword can be iterated, such as filter_key_0, filter_key_1, and so on. If it finds an incompatible header value, e.. if the filter corresponds to CLEAR or AIR, it is ignored unless requested otherwise by the user10.

AutoPhOT requires at minimum for an image to have the TELESCOPE and INSTRUME keywords. Both keywords are standard fits keywords11 and are virtually ubiquitous across all astronomical images. If not found, an error is raised and the user is asked for their intervention.

A pre-populated Yaml file with information and keywords for several commonly used telescopes is provided as part of AutoPhOT.

2.5 Solving for the world coordinate system

Astronomical images require a World Coordinate System (WCS) to convert sky coordinates to X and Y pixel coordinates. Many images may have WCS values written during the reduction process. However, it is not uncommon for an image to have an offset WCS, or be missing WCS information entirely. AutoPhOT assumes the WCS is unreliable when there is a significant (default is 2 × FWHM) offset between the expected catalogue positions (see Sect. 4.1).

In such cases (and where a WCS is missing entirely), AutoPhOT calls a local instance of Astrometry.net12 (Lang et al. 2010). Source detection is performed on the input image, and asterisms (sets of four or five stars) are geometrically matched to pre-indexed catalogues. Solving for the WCS values typically takes from ~5 s to ~30 s per image13.

2.6 Cosmic ray removal

Cosmic rays (CRs) are high energy particles that impact the CCD detector and can result in bright points or streaks on the CCD image. For images with long exposure times, CRs can be problematic as they may lie on top of regions or sources of interest.

To mask and remove cosmic rays, AutoPhOT uses an instance of Astroscrappy14 (van Dokkum et al. 2012; McCully & Tewes 2019) which is a Python 3 adaptation of the commonly used LACosmic code (van Dokkum et al. 2012).

2.7 Measuring image full width half maximum

The full width half maximum (FWHM) of sources in an image is determined by the astronomical seeing when the image was taken, as well as the telescope and instrument optics.

AutoPhOT measures the FWHM of an image by fitting an analytical model (by default a Moffat function; Moffat 1969) to a few tens of bright isolated sources in the field.

Firstly, AutoPhOT needs to adapt to the number of point sources in an image. A deep image with a large field of view (FoV) will have considerably more sources than a shallow image with a small FoV. Too few sources may lead to poorly sampled (or incorrect) values of the FWHM, while too many sources may indicate the detection threshold is too low (and background noise may be detected as a genuine point source) and needlessly increases the computation time.

Figure 1 illustrates the process for finding the FWHM of an image. AutoPhOT’s FWHM function aims to obtain a well sampled value for the FWHM of the image without any prior knowledge of the number of sources in the field. The process begins with a search for point-like searches using the DAOFIND (Stetson 1987) algorithm, together with an initial guess for the threshold value (defined as the minimum counts above the background level for a source to be considered). The first iteration returns a small set of bright sources, measures their FWHM, and updates the initial guess for the FWHM value.

The process continues to search for sources above the threshold value in the field. If too many sources are detected, the function will rerun the algorithm with a higher threshold value.

This change in threshold value is adaptively set based on the number of sources detected.

Sigma clipping is used to remove extended sources (e.g., faint galaxies and saturated sources) which may have slipped through. In classical sigma clipping, if we have a median value for the FWHM with a standard deviation, σ, then only values with within ±nσ of the median are used, where n is some value, which by default is set to n = 3. AutoPhOT uses a more robust method to determine outliers via the median absolute deviation given by:

(1)

where MAD = median(|Xi − µ|),

where Φ−1(P) is the normal inverse cumulative distribution. function evaluated at probability P = 3/4. Assuming a normal distribution of FWHM values, n = 3 would mean that ~99% of FWHM measurement would fall within this value. Once a FWHM value is found for an image, it is then used henceforth for building the PSF model and photometric measurements.

thumbnail Fig. 1

Flowchart showing the iterative process of finding the FWHM of image using AutoPhOT. We do not show the adaptive threshold step size for purpose of clarity.

3 Photometry

Fundamentally, photometry consists of the measuring the incident photon flux from an astronomical source and calibrating this onto a standard system. We can define the difference in magnitude between two sources m1 and m2 as

(2)

where F1 and F2 are the measured fluxes (counts per second) from two sources. As Eq. (2) describes a relative system, we also need to define some fiducial stars with known magnitudes. One such definition is the “Vega” magnitude system, where the magnitude of the star Vega in any given filter is taken to be 015. In this case, the magnitude of any other star is simply related to the flux ratio of that star and Vega as follows:

(3)

When performing photometry on transients, we typically measure the instrumental magnitude of the transient itself, as well as several reference sources with known magnitudes in the image. Comparing the magnitude offset with the literature values of these reference sources (which can be unique to each image due to varying nightly conditions) and applying it to the transient, we can place the measurement of the transient onto a standard system. We define the apparent magnitude of the transient as

(4)

where mT is the unknown apparent magnitude of the transient with a flux FT. The latter term describes the magnitude offset or zeropoint (ZP) for the image and is found by subtracting the catalogue magnitude, mcat,i, from the measured magnitude, −2.5 · log10(Fi) (see Sect. 4 for further discussion). An average value for the zeropoint is typically calculated using a few tens of sources in the field.

Applying a zeropoint correction will typically result in photometry that is accurate to O ~ 0.1 mag or better. For more precise calibration, and in particular to ensure homogeneous measurements across different instruments, one must apply additional corrections beside the zeropoint. These include colour correction (CCλ) terms and aperture corrections, which we discuss in Sect. 4.

3.1 Aperture photometry

AutoPhOT can perform either aperture or PSF-fitting photometry. Both methods have their advantages and limitations. Aperture photometry is a simple way to measure the number of counts within a defined area around a source. This technique makes no assumption about the shape of the source, and simply involves summing up the counts within an aperture of a certain radius placed at the centroid of a source.

AutoPhOT begins by using aperture photometry as an initial guess to find the approximate magnitude of bright sources. If PSF fitting photometry is not used, for example, if it fails due to a lack of bright isolated sources in the field16, aperture photometry is implemented. Aperture photometry can yield accurate results for bright, isolated sources (flux dominated), but may give measurements with larger uncertainties for faint sources (noise dominated; see Appendix B).

To perform aperture photometry, AutoPhOT first finds the centroid of a point source by fitting an analytical function. To accurately measure the brightness of a source, the background flux must be subtracted. This can be done in several ways in AutoPhOT, including a local median subtraction or fitting a 2D polynomial surface to the background region. Choosing the optimum background subtraction requires some prior knowledge of the FWHM. The median subtraction method is best for a cutout with a flat background, or for a smoothly varying background over the scale of a few FWHMs. For a background with strong variations (such as those on the edge of an extended source) the surface fitting algorithm performs best. For consistency, AutoPhOT retains the same background subtraction method (surface fitting by default) for all point source measurements. We demonstrate the aperture photometry functionality in Fig. 2.

In this case, the background has been removed using a 2D surface. The counts from the source can then be found using

(5)

where countsap is the total counts within the aperture area, 〈countssky〉 is the average counts due to the sky background, and npix is the number of pixels within our aperture.

There is a balance when selecting an optimum aperture size. The aperture should be large such that most of the light from the source is captured. However, it should be small enough so that contamination from the sky background and unrelated sources is minimised. Figure 3 demonstrates a search for optimum aperture size in AutoPhOT17. For a sample of bright sources found from Sect. 2.7, the S/N is measured within a series of apertures of increasing radii. Typically, the S/N will reach a maximum at 1–2 times the FWHM, although this can vary depending on the PSF. The aperture radius at which the S/N is maximised is then multiplied by a factor (default ×1.5) to allow for any error in centroiding and is used as the new aperture radius for the image.

To account for any discrepancy in aperture size (such as missing flux due to finite aperture size), we employ an aperture correction. This also accounts for noise dominated wings of faint sources, where source flux may be missed due to their lower S/N. A smaller aperture will lead to a larger aperture correction and vice versa, with typical corrections being less than ~0.1 mag. This is not necessary if PSF photometry is used.

To calculate the aperture correction, bright sources found in Sect. 2.7 are measured with a large aperture size and the standard aperture size. AutoPhOT uses a large aperture size with r = 2.5 ×FWHM and normal aperture size with r = 1. 5× FWHM18. Using Eq. (2), the ratio of these values gives a magnitude correction which compensates for the flux lost due to a finite aperture size. In Fig. 4, we plot the distribution of aperture corrections for a sample of bright, isolated sources. The average value and standard deviation are taken as the aperture correction, which is applied to all sources measured with standard aperture size during aperture photometry.

Aperture photometry has its drawbacks. It performs poorly in crowded fields, where contamination from neighbouring sources can interfere with measurements of a single point source. Additionally, transients that occur close to their host may have complex backgrounds which may contaminate measurements. Aperture photometry is more susceptible to CCD detector defects such as hot/cold and dead pixels, and CRs. Moreover, aperture photometry assumes a flat weight function across the aperture and is susceptible to centroiding discrepancies.

thumbnail Fig. 2

Aperture photometry of a point source, showing the aperture radius (solid red line) as well as the background surface (green line in right and bottom panels). In this case, we estimate the background by fitting a 2D surface. We also include projections along the X and Y axes.

thumbnail Fig. 3

Measured S/N (enclosed flux) as a function of aperture radius for a set of sources given in upper (lower panel). For the upper panel, the mean of these curves is shown as a black solid line, while the maximum S/N of each source is indicated as per the colour bar. We note that this is consistent with the theoretical expectation from Naylor (1998). Lower panel shows the enclosed flux for a given aperture radius. We note the majority of the flux is enclosed by an aperture radius of ~2.5 × FWHM.

thumbnail Fig. 4

Histogram showing magnitude of the ratio of our large aperture size with r = 2.5 × FWHM and a standard aperture size of r = 1.5 × FWHM for a single image. This is the aperture correction used when aperture photometry is employed.

3.2 Point spread function photometry

PSF-fìtting photometry uses bright sources in the field to build a semi-analytical model, which is then fitted to fainter sources to find their instrumental magnitude. PSF photometry is the method of choice for crowded fields and can give better results for low S/N sources when compared to aperture photometry.

AutoPhOT assumes that the PSF is non-spatially varying across the image, meaning points sources will in theory appear the same regardless of their location on the image. In practice, this may not be the case for images that cover a large FoV (Howell 2006). If AutoPhOT detects a significant variation in PSF shape across the images, it will only perform measurements within a radius around the transient position where the PSF is assumed to be approximately constant.

If a FWHM of an image is comparable to the pixel size, the image is said to be under sampled. In this case, PSF-fìtting photometry is particularly susceptible to centroiding errors (Wildey 1992; Lauer 1999). If AutoPhOT finds a very small FWHM for an image (default is 3 pixels) aperture photometry is used.

The PSF package designed for AutoPhOT is based on the work of Stetson (1987), Massey & Davis (1992), and Heasley (1999). AutoPhOT uses “well-behaved” sources to build the PSF model. These sources must be high S/N, isolated from their neighbours, and have a relatively smooth background. This is done by building a compound model comprised of an analytical component (such as Gaussian or Moffat) along with a numerical residual table obtained during the fitting process. Although sources are selected using the same process described in Sect. 2.7, the user may supply the coordinates of PSF stars.

Figure 5 illustrates the process of building a PSF model in AutoPhOT. Bright isolated sources are located. A small region around each source is then background subtracted (similar to Sect. 3.1) and fitted with an analytical function (first panel). The best fit location is noted, and the analytical model is subtracted to leave a residual image (second panel). The residual image is resampled onto a finer pixel grid and shifted (third panel and fourth panel). The compound (analytical and residual) PSF model is then normalized to unity. This process is repeated for several (typically ~ 10 sources) bright isolated sources, to create an average residual image. The final step is to resample the average residual image back to the original pixel scale. We ensure flux in conserved during this process. Our final PSF model is then simply:

(6)

where M is a 2D Moffat function (or Gaussian function if selected) and R is the residual image. We can fix the FWHM to the value found for the image, as discussed in Sect. 2.7, so the PSF model can be fitted with three parameters, x0 and y0 (the centroid of the sources), and A its amplitude.

Although the PSF model is based on a circular analytical function, with the inclusion of the residual table, AutoPhOT can handle images with elongated PSFs. Further development will include non-circular analytical models, and additionally the ability to perform non-circular aperture photometry, for galactic surface brightness fitting.

Once the PSF model is built, it can then be used to measure sequence stars in the field, as well as for artificial source injection (further discussed in Sect. 6).

For determining the magnitude of sequence stars in the field, we first subtract the background surface, similar to when the PSF model is built. We then fit the pre-constructed PSF model (composed of an analytical model and residual table), while allowing for the PSF model to vary in pixel location and amplitude. Using the fitted PSF model, we then integrate under the analytical model component, and perform aperture photometry on the residual table, both using the same aperture size.

In Fig. 6, we show an example of the residual image after fitting our PSF model to a source and subtracting it off. In this example, the point source is almost symmetric, with a bright source in its vicinity. A signature of a suitable PSF model is that after subtraction, there is little to no evidence of the prior point source.

thumbnail Fig. 5

Demonstration of the steps taken to build residual table for PSF photometry. A cutout is taken around the source, and an analytical function is fitted and subtracted. The image is then resampled to a finer pixel grid (default: ×10). The residual image is then rolled (discretely shifted along x and y) such that the location of best fit is at the image centre. This is repeated for several bright isolated sources to obtain an average residual.

4 Calibrating photometry

A crucial step in photometry is calibrating instrumental magnitudes onto a standard photometric system. Due to the sparsity of photometric nights (nights when there are no clouds or other issues with atmospheric transparency), this zeropoint calibration must be obtained for each image. Furthermore, even on photometric nights, there may be a gradual shift in zeropoint due to the cleanliness/coating of the mirrors over time (for an example of this effect, see Fig. 3 in Harbeck et al. 2018). We discuss the zeropoint calibration in Sect. 4.1. In some cases, it is sufficient to apply the zeropoint correction alone to produce calibrated, publication-ready photometry.

However, in cases where multiple instruments have been used to observe a transient, one must account for differences between telescopes. In particular, we must consider effects due to slight manufacturing differences between filter sets, which may give systematic offsets for the same transients measured using different instruments. These effects typically accounts for ~0.1 mag corrections to photometry.

4.1 Zeropoint calibration

The zeropoint is used to calibrate an instrumental magnitude to a standard magnitude system using Eq. (4). For a given image, the user can specify their desired catalogue, or provide a custom catalogue for the field. Several popular photometric catalogues are built into AutoPhOT, including APASS, SDSS, Pan-STARRS, and 2MASS. AutoPhOT will download a subset of sources covering the approximate field of view of the image. If data is not available for a specific image/filter, an error is raised and the image/filter is skipped.

Figure 7 illustrates how sources are identified in an image to determine the zeropoint as well as build the PSF model. In this example, a local region around the target position is selected and a smaller region around the transient host is excluded (to avoid sources with complex backgrounds).

The zero point calibration for the image presented in Fig. 7 is plotted in Fig. 8. In this example, we include sigma-clipping (see Sect. 2.7) to remove any outliers as well as a S/N cut-off. The result shows a distribution with a well-defined peak, which is used as the zeropoint for this image.

thumbnail Fig. 6

Example of PSF subtraction using AutoPhOT. The main panels show a cutout of the transient location before (left) and after (right) PSF subtraction, while projections along the x- and j/-axis are also shown for each panel. The source is cleanly subtracted and there is no sign of a residual in the subtracted panel.

thumbnail Fig. 7

Demonstration of source detection for catalogue sources. PSF stars (blue circles) are selected on the basis of their brightness and isolation. In this example, we only consider sources close to the transient location and exclude any sources near the host.

thumbnail Fig. 8

Zeropoint diagnostic plot from AutoPhOT. Left panels show zeropoint measurements before (upper left) and after (lower left) a 3σ clipping. Right panel shows zeropoint distribution with a probability density function with a well-defined peak.

4.2 Colour terms

Along with the zeropoint, it is usually necessary to apply colour terms when calibrating instrumental magnitudes. Colour terms are a consequence of filters and CCDs having a non-uniform response over the bandpass of a filter. For example, a z-band filter may transmit light with wavelengths between 8200 and 9200 Å. However, if this filter is used with a CCD that has a much lower quantum efficiency in the red, then we will detect more counts from a blue source than a red, even if they have the same z-band magnitude. This effect, which manifests itself as a colour-dependent shift in zeropoint, can be as much as 0.1 mag. Moreover, due to small differences in the effective pass band of different observatory filter system, we must determine the colour term for each instrument individually to a produce a homogeneous dataset.

We demonstrate the effect of neglecting any colour information when determining the zeropoint of an image in Figs. 9 and 10. A clear discrepancy is seen and is correlated with the colour of the sequence stars used; in this case, the zeropoint under represents blue sources and slightly overestimates redder sources by ~0.1-mag. In Fig. 10, we see a shift of ~0.1-mag in the zeropoint magnitude, as well as smaller scatter among sources in the field.

For transient measurements, observations in two closely spaced filters are required, preferably taken on the same night. Additionally, the colour term of the instrument and telescope must be known. This can be found using stars in the field with standard magnitudes in literature to determine the effect of stellar colour given by the fitted line given in Fig. 9. The slope of this line (CTBV) is then used to correct for the zeropoint for each image where appropriate colour information is available. As we have more unknown variables than known, we can iterate through Eq. (7) to solve for the true, colour corrected magnitude.

(7)

The above equation demonstrates the process of applying a colour correction to two measurements in filters B and V. Both filters have a colour term known a priori, where CTB,BV is the slope of MB–MV vs. MB–MB,inst and similarly for CTB,BA. For convenience and stability, AutoPhOT solves for the colour term corrections using the iterative Jacobi method. We rearrange Eq. (7) into the form Ax = b, which gives:

(8)

This is a quick method to apply a colour correction and typically converges in ~10 iterations.

The colour correction package is separate from the main AutoPhOT pipeline and as such can accept any correctly formatted photometry tables. This is useful if there is missing data (observations in specific band passes) and the user wishes to perform their own interpolation or extrapolation for missing data.

thumbnail Fig. 9

Demonstration of the effect of point source colour on zeropoint calibration. X-axis shows the catalogue colour of sources, while the Y-axis shows the ø-band magnitudes minus their instrumental magnitude and image zeropoint. Red squares are binned magnitudes with error bars equal to the standard deviation of magnitudes in each bin. The solid black line shows the best fit using EMCEE (Foreman-Mackey et al. 2013). The lower panel shows the same points with the colour correction applied.

thumbnail Fig. 10

Discrepancy of zeropoint measurements when ignoring colour correction (black) and including it (red).

4.3 Atmospheric extinction

We can account for the effect of atmospheric extinction using the following;

(9)

where Mλ is the magnitude in a given filter, λ, κλ is the extinction coefficient in magnitudes per unit airmass and sec(z) is simply the secant of the zenith angle z. Taking account of the airmass correction is particularly necessary when calibrating photometry to standard fields (see Landolt 1992). An observer may wish to obtain a more precise set of sequence stars for their transient measurements. This will involve observing a standard field on a night that is photometric, as well as the transient location. The zeropoint measurements of the standard field will be at a different airmass than the transient. Using Eq. (9), and the standard field measurement, an observer can perform photometry on a set of sequence stars around the transient location and place them on a standard system. This can be used for future measurements of the transient.

There is no trivial way to approximate the extinction at a specific telescope site. We provide an approximation which AutoPhOT uses in Appendix A, although for accurate photometry, the user should provide the known extinction curve for a given site.

5 Image subtraction

If a transient is close to its host nucleus, occurs near another point source, or has faded to a level comparable to the background, it may be necessary to perform difference imaging (see Alard & Lupton 1998). Difference imaging involves scaling and subtracting a template images (assumed to have no transient flux) from a science images, removing any bright contamination. Prior to subtraction images must be precisely aligned, to subpixel precision, scaled to a common intensity, and be convolved with a kernel so that their PSFs match.

Currently, AutoPhOT includes HOTPANTS19-20 (Becker 2015) and PYZogy21 (Zackay et al. 2016) for image subtraction. The user can select what package they require, with HOTPANTS set as the default. Prior to template subtraction, AutoPhOT aligns the science and template images using WCS alignment22 or point source alignment23 (Beroiz 2019). Furthermore, both images are cropped to exclude any regions with no flux after alignment.

6 Limiting magnitude

A limiting magnitude is the brightest magnitude a source could have and remain undetected at a given significance level. Even when a transient is not visible in an image, a limiting magnitude can help constrain explosion times in SNe or decay rates of GW merger events.

One way that AutoPhOT can calculate the limiting magnitude is through what we refer to as the “probabilistic limiting magnitude” illustrated in Fig. 11. We assume that the pixels are uncorrelated24, and contain only noise from a uniform background sky. After excising the expected position of the transient, we proceed to select n pixels at random (where n = πr2), and sum together the counts in these n pixels from a background subtracted cutout of the transient location. Repeating this many times for different random sets of n pixels, we obtain a distribution of summed counts (shown in the upper panel in Fig. 11). We can then ask the question of what the probability is that we would obtain this number of counts or greater by chance. Setting the threshold to 3σ, in the example shown, we can see that we are unlikely to find a source with more than ~1250 counts, and we hence adopt this as our limiting magnitude.

A second and more rigorous limiting magnitude is determined though injecting and recovering artificial sources. Using an initial guess from the probabilistic limiting magnitude described above, artificial sources built from the PSF model (see Sect. 3.2) and with realistic noise are injected in set positions (default 3 × FWHM) around the target location25. The recovery of the artificial sources is done using PSF photometry (described in Sect. 3.2) and the magnitudes of the injected sources are then gradually adjusted until they are no longer recovered by AutoPhOT above 3σ (or some other criteria, see Appendix D for further details).

Figure 12 demonstrates the artificial source injection package. In this example, the image has gone through the AutoPhOT pipeline, and we perform our limiting magnitude tests on the template subtracted image. We use the β′ detection criteria (see Appendix D). Starting with an initial guess from the probabilistic limiting magnitude, the injected magnitude is adjusted incrementally until it meets our detection criteria, which it will typically overshoot (due to the initially large step size). The magnitude increment is then reversed, using a smaller step size, until the detection criteria is again fulfilled. Sources are deemed lost when where their individual recovered measurements give a β < 0.75. We take the limiting magnitude to be the magnitude at which 80% of sources are lost.

thumbnail Fig. 11

Demonstration of probabilistic limiting magnitude measurement. The upper panel shows the distribution of summed counts for a random set of pixels close to the expected source location. Bottom left panel shows a cutout of the transient location; pixels marked in red are excluded when creating the distribution; note the source off-centre is masked. Bottom right panel is the same image with injected PSF sources (marked with red circles) with magnitude equal to the Ful,β=0.75 limiting magnitude (see Appendix D).

7 Testing and validation

7.1 Testing of photometry packages

In this section, we demonstrate AutoPhOT’s ability to recover the magnitude of sequence stars in the field. As this is a novel PSF-fitting package, we compare against the aperture photometry package available in AutoPhOT, as well as from the well established photometry packages such as DAOPHOT (Stetson 1987), PSFex (Bertin 2011), and SExtractor Bertin & Arnouts (1996).

Figure 13 shows both aperture and PSF photometry can accurately determine the magnitude of relatively bright sources ( mag). However, at fainter magnitudes, aperture photometry no longer performs as well, as seen from the larger scatter. Using aperture photometry, more pixels are being used to measure the source flux, thereby increasing the noise as each pixel contributes additional read, dark and sky noise. As the source flux becomes comparable to the background flux, this terms dominate in Eq. (B.3). Centroiding errors may also result in poor measurements. PSF photometry can perform much better at fainter magnitudes. Unlike aperture photometry, the PSF model attempts to measure shape of a point-like source using more information on the shape of the PSF. Figure 13 shows that aperture photometry is equivalent to PSF until ~ 19.5 mag.

Figure 14 compares the PSF and aperture photometry from AutoPhOT, PSFex, SExtractor, and DAOPHOT (Bertin & Arnouts 1996; Stetson 1987; Bertin 2011). The PSF fitting package from AutoPhOT can match the recovered instrumental magnitude from both DAOPHOT and PSFex, even at faint magnitudes. Aperture photometry can result in similar magnitudes at bright magnitudes, but suffers from centroiding errors at fainter magnitudes, shown by the large scatter in Fig. 14. However, for such low fluxes, PSF-fitting photometry should be used.

Figure 15 demonstrates the effectiveness of flux recovery for AutoPhOT’s PSF and aperture packages. In general, PSF photometry excels at recovering the injected magnitude, showing less scatter at fainter magnitudes, as well as being less susceptible to irregular backgrounds. Aperture photometry agrees well with the PSF photometry until ~19.5 mag, but shows large scatter at fainter magnitudes, likely due to sky dominated flux and/or centroiding errors.

We test the effectiveness of the AutoPhOT limiting magnitude packages in Fig. 16. We use a relatively shallow image, and a reference catalogue containing fainter sources. We see that below the computed upper limit of ~21 mag, sources are not detected. Brighter than ~21 mag, we recover sources at magnitudes consistent with their catalogue values.

thumbnail Fig. 12

Diagnostic plot from AutoPhOT’s artificial source injection package. Top panel shows the change in the detection probability (1 − β′) for artificially injected sources. In this example, the sources are considered lost at β = 0.75 and the detection cutoff is reached when 80% of sources are lost (black line with circles). The leftmost image cutouts illustrate locations around the target location before (upper) and after (lower) sources were injected randomly at the limiting magnitude. The remaining four panels demonstrate closes up of these injected sources.

thumbnail Fig. 13

Demonstration of recovered magnitude using aperture photometry (upper panel) and the PSF-fitting package (middle panel) from AutoPhOT. The F-axis shoes the derived zeropoint magnitude for each source. The bottom panel shows the difference between aperture and PSF-fitting photometry for this particular image. Solid lines show a moving mean value, with dashed lines indicating the standard deviation in each bin. Horizontal error bars show the uncertainty on catalogue magnitudes, vertical error bars are uncertainties on recovered magnitudes from AutoPhOT.

7.2 Performance

Figure 17 shows a comparison of AutoPhOT photometry against published light curves in the literature for three transients found in three different environments, namely AT 2018cow (Perley et al. 2018; Prentice et al. 2018b), SN 2016coi (Prentice et al. 2018a) and 2016iae (Prentice & Mazzali 2017). AutoPhOT was run on the same data as used in the referenced publications, and while a combination of techniques was used for each transient (template subtraction, PSF-fitting and aperture photometry) as detailed in the caption, in all cases this was run without human intervention.

We report several diagnostic parameters for these three transients in Table 1, including execution time. The most time-consuming step is matching and fitting sequence stars to determine the zeropoint. This can be addressed by limiting the region where sequence sources are measured or providing AutoPhOT with a list of sources to use.

thumbnail Fig. 14

Comparison of measured instrumental magnitude and error using AutoPhOT, PSFex, SExtractor, and DAOPHOT. The upper two panels show the difference in recovered magnitude (left) using PSF-fìtting photometry, and the difference in error (right). Note, left and right panels have different y scales. The lower two panels show the same, but for aperture photometry. In each case, the x-axis gives the instrumental magnitude from AutoPhOT. The same aperture radius was used in the PSF and aperture cases. Error bars are the combination of uncertainties from both pipelines added in quadrature.

thumbnail Fig. 15

Magnitude recovery effectiveness for PSF (aperture) photometry packages given the upper (lower) panels. F-axis is recovered magnitude minus the injected magnitude of a fake PSF model positioned randomly across the image used in Fig. 7, with multiple iterations, including sub pixel jittering and the addition of random noise. We plot the limiting magnitude found via artificial source injection on an empty patch of sky as the red vertical line.

8 Conclusions and future development

We present our photometry pipeline, Automated Photometry of Transients (AutoPhOT), a new publicly available code for performing PSF-fitting, aperture and template-subtraction photometry on astronomical images, as well as photometric calibration. This code is based on Python 3 and associated packages such as Astropy. With the deprecation of Python 2 and popular photometry packages within IRAF, AutoPhOT provides accurate photometry with little user setup or monitoring. AutoPhOT has already been used in several scientific publications (Chen et al. 2021; Fraser et al. 2021; Brennan et al. 2022a,b; Elias-Rosa et al., in prep.; Engrave Collaboration, in prep.) at the time of writing.

Future work includes adapting to a wider range of images with irregularities, such as satellite trails, saturated sources, and CCD imperfections. The AutoPhOT project will also ultimately include a user-friendly web interface as well as an Application Programming Interface (API). This will allow for both fast and simple photometry without the need to maintain local software, as well as easy command line access. Additional functionality will allow for calibrated photometry using standard fields observations, as well as the inclusion of spatially varying PSF models and S-corrections (Stritzinger et al. 2002).

The pipeline is publicly available and detailed installation and execution instructions can be found online26.

thumbnail Fig. 16

Comparison of the probable limiting magnitude and that found from artificial source injection. Upper panel: magnitude of recovered source versus its catalogue magnitude. If a source is recovered, it is plotted as the red marker. If the source is not recovered, we plot the limiting magnitude at the source’s position as the green marker (probable limiting magnitude) and blue marker (artificial source injection). Lower panel: S/N at the position of the source.

thumbnail Fig. 17

r-band light curves produced by AutoPhOT compared to those found in literature. AutoPhOT points are given as points with error bars, and literature values given as a shaded band with a width equal to the error at each point. In descending order, we compare the output from AutoPhOT for AT 2018cow (Perley et al. 2018; Prentice et al. 2018b) using template subtraction and aperture photometry, SN 2016coi (Prentice et al. 2018a) and SN 2016iae (Prentice & Mazzali 2017) without subtraction using both PSF and aperture photometry. We also compare the results using PyZogy for template subtraction in the case of AT 2018cow. Centre panels compare both cases, with the upper panel showing the difference between measurements (∆ Mag = AutoPhOTliterature) and lower panel showing the difference in error (∆ Magerr = AutoPhOTerrliteratureerr) for each transient. Right panels highlight the site of the transient event.

Table 1

Performance of AutoPhOT computing r-band light curves from Fig. 17.

Acknowledgements

We thank the anonymous referee for their comments and suggestions which helped improve this paper. SJB would like to acknowledge the support of Science Foundation Ireland and the Royal Society (RS-EA/3471). MF is supported by a Royal Society – Science Foundation Ireland University Research Fellowship. We thank Simon Prentice for sharing data for AT 2018cow, SN 2016coi, and SN 2016iae, and comments on AutoPhOT during its early phase of development. We thank Emma Callis, Robert Byrne, Beth Fitzpatrick, Shane Moran, Kate Maguire, Máxime Deckers, and Lluís Galbany for their comments and feedback while AutoPhOT was under development. We thank the Transient Name Server and their open source sample codes (https://www.wis-tns.org/content/tns-getting-started). This research made use of Astropy (http://www.astropy.org), a community-developed core Python package for Astronomy (Astropy Collaboration 2013, 2018). This research made use of data provided by Astrometry.net (https://astrometry.net/use.html).

Appendix A Atmospheric extinction calculation

To deduce the extinction parameters across a range of photometric filters, one may observe a series of stars throughout a night at different airmasses. Fitting a slope to the data should show a clear trend of zeropoint magnitude versus airmass, being more extreme in the bluer bands than in the red. AutoPhOT can accept these values as shown in Code. 1.

If unknown, AutoPhOT makes a rough approximation of the extinction due to airmass that relies on the altitude of the telescope site and the wavelength being observed. There are three main contributors to atmospheric extinction; Rayleigh scattering of light by molecules smaller than the wavelength of the scattered light, absorption due to ozone in the upper atmosphere, and aerosol extinction by scattering and absorption by particles with diameters of the order of the wavelength or larger such as dust and ash particles.

Absorption/scattering by Rayleigh scattering is described by Hayes & Latham (1975) and is given by:

where

where λ is the effective wavelength of the observation in µm and h is the altitude above sea level in km. ns(λ) describes the refractive index of thin incoming light.

Molecular absorption, mainly due to atmospheric ozone and water, can be described by;

(A.1)

where TOzone is the thickness of the ozone layer above the telescope scope taken at 0 °C and 1 atm, and is assumed to be 0.3 cm. κOzone(λ) is the absorption coefficient for ozone taken from Inn & Tanaka (1953).

By default, AutoPhOT will assume the total atmospheric extinction is αλ = αλ,Rayleigh + αλ,Ozone. This can be a suitable approximation for many telescope sites, as demonstrated for La Silla and Roque de los Muchachos, Fig. A.1. In practice, high particulate levels in the air can account for large discrepancies, especially in the redder bands, forr example Paranal and Mauna Kea. This can be accounted for by including the atmospheric extinction due to aerosols. This is given by:

(A.2)

where A0 is the same extinction for λ=1 µm and b is a coefficient dependent on the size of aerosol particles and their size distribution and H0 is the scale height. The aerosol extinction is the most variable and problematic. It is left to the user to include this correction however with a priori knowledge, it can produce good results (as demonstrated for Paranal in Fig. A.1).

thumbnail Fig. A.1

Theoretical atmospheric extinction curves for several sites including La Silla27, Roque de los Muchachos28, Paranal (Patat et al. 2011), and Muana Kea29. We include a match to the Paranal extinction curve using αλ = αλ,Rayleigh + αλ,Ozone + αλ,Aerosol with b = −2, A0 = 0.05 and H0 = 1.5. It is difficult to fit the extinction curve as found at Muana Kea, likely due to high levels of volcanic dust.

Appendix B Error calculations

The uncertainty on the calibrated magnitude of a source is calculated as:

(B.1)

We take the error from the zeropoint calibration (δZP) to be the standard deviation from measurements of sources in the field. Prior to this, appropriate sigma clipping and S/N cutoffs are applied. The error associated with the measurement of the transient itself (δminst) requires more attention. The uncertainty in magnitude of a source is related to the S/N as follows:

(B.2)

Where S is the signal from the source and N is the noise associated with it. We find the error associated with the S/N is using a Taylor expansion. In AutoPhOT, we define the Signal to Noise Ratio (S/N) using the CCD equation (Mortara & Fowler 1981; Howell 2006):

(B.3)

Listing C.2. Example of AutoPhOT execution used to produce the light curve for SN 2016iae in Fig.17.

# Import AutoPhoT package
import autophot
# Load command dictionary
from autophot.prep_input import load
autophot_input = load()
# location of work directory
autophot_input[‘wdir’] = ‘/Users/seanbrennan/Desktop/autophot_db’
# Location of fits images for SN2016iae
autophot_input[‘fits_dir’] = ‘/Users/seanbrennan/Desktop/SN2S16iae’
# IAU name of target for TNS retrieval
autophot_input[‘target_name’] = ‘216iae’
# Name of catalogue for zeropoint calibration
autophot_input[‘catalog’][‘use_catalog’] = ‘apass’
# Import automatic photometry package
from autophot.autophot_main import run_automatic_autophot
# Run automatic phototmetry with input dictionary
run_automatic_autophot(autophot_input)

here F* is the count rate from the star in e/s, texp is the exposure time in seconds, Fsky is the background counts in e/s/pixel, n is the number of pixels within an aperture, R is the read noise e, D is the dark current in e/s and G is the Gain in e. R, G, texp, and D are taken from the image header, if available, while the remaining terms are calculated during the photometric reduction.

Additionally, we must consider the error associated with the fitting process itself. If PSF photometry is performed, we include an error estimate from artificial star experiments similar to those in SNOoPY. If the user desires this additional error analysis, an artificial source with the same magnitude as the target star, is placed in the PSF-subtracted residual image in a position close to the real source (giiven in the lower left panel of Fig. 12). The injected sources are then recovered using an identical fitting procedure. The standard deviation of measurements is taken as an estimate of the instrumental magnitude error. This is combined (in quadrature) with the PSF-fit error returned by LMFIT to give δ minst.

At the time of writing, AutoPhOT is only concerned with these terms given in Eq. B.1 as these terms are expected to dominate.

Appendix C Execution example

In listing. 2 we provide a snippet of code that will execute AutoPhOT on a dataset30.

Appendix D Computing flux upper limits

As a transient fades to a magnitude which is comparable to the background brightness, it is necessary to compute detection criteria to determine whether a measured flux can be confidently associated with the transient. Detection significance is usually defined in terms of the maximum probability of a false positive (a spurious detection of background noise), which we define as α. Alpha can also be related to σ. For example, a 3σ upper limit will correspond to a 0.135% probability of a false positive.

As part of AutoPhOT, we include a false negative criterion, β, which signifies the fraction of real sources that go undetected. This β value can be defined in terms of a flux upper limit, fUL, which indicates the maximum incompleteness of a sample of sources with fsource = fUL. In other words, 100(1 − β)% of the sources with flux fUL will have flux measurements with a S/N > nσ. We follow the discussion of FUL in Masci (2011) and further detailed in Kashyap et al. (2010). We describe the probability of detection as β′ = 1 − β, which we want to maximise. The probability of detecting a source with a fsource = ful can be written as:

(D.1)

where erf is the error function, n is a set detection limit (default to 3 in AutoPhOT) and fUL is a flux upper-limit. Rearranging Eq. D.1 gives probabilistic criteria for detection limits:

(D.2)

Using Eq. D.2, we see that using the common fUL = 3σbkg gives a β’ of 50%, which means that roughly half of the sources injected at fsource = 3σbkg will go undetected. For 95% percent confidence that a source is genuine for S/N = 3, Eq. D.2 gives a value for fUL ≈ 5σbkg.

We demonstrate the applicability of this β criteria in Fig. D.1. We inject artificial sources in an empty part of the sky, and while noting the injected source parameters, we assess whether the sources can be recovered to an appropriated S/N, see caption of Fig. D.1 for further details.

AutoPhOT defaults to β = 0.75 to provide a conservative upper limit to any reported limiting magnitudes. The user may also opt for a more traditional detection criteria of using the S/N > n where n is the level above σbkg.

thumbnail Fig. D.1

Demonstration of Eq. D.1. We perform artificial source injection on an empty patch of sky. Sources are injected uniformly throughout the image, including sub-pixel placements, with random Poisson noise added to the PSF prior to injection. In the upper panel, we plot Eq. D.1 versus maximum pixel flux in units of the standard deviation of the background noise, as the red curve. The green points show the binned S/N ratio using Eq. B.3. In the lower panel, we plot the S/N ratio using Eq. B.3 with the same x-axis as the upper panel. The points are coloured blue if S/N > 3 and red if S/N < 3. For the sample of sources incrementally injected, Eq. D.1 can reproduce the recovered fraction of sources. In other words, for sources measured with a fsource ≈ ~3σbkg, roughly half of these are recovered with a S/N > 3; for injected sources with fsource ≈ 3.7σbkg we detect roughly 75 %; while virtually all sources are confidently recovered at fsource ≈ 4.5σbkg

References

  1. Alard, C., & Lupton, R. H. 1998, ApJ, 503, 325 [Google Scholar]
  2. Astropy Collaboration (Robitaille, T. P., et al.) 2013, A&A, 558, A33 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  3. Astropy Collaboration (Price-Whelan, A. M., et al.) 2018, AJ, 156, 123 [Google Scholar]
  4. Becker, A. 2015, HOTPANTS: High Order Transform of PSF ANd Template Subtraction Astrophysics Source Code Library [record ascl:1504.004] [Google Scholar]
  5. Beroiz, M. I. 2019, Astrophysics Source Code Library [record ascl:1906.001] [Google Scholar]
  6. Bertin, E. 2011, in Astronomical Data Analysis Software and Systems XX, eds. I. N. Evans, A. Accomazzi, D. J. Mink, & A. H. Rots, Astronomical Society of the Pacific Conference Series, 442, 435 [NASA ADS] [Google Scholar]
  7. Bertin, E., & Arnouts, S. 1996, A&AS, 117, 393 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  8. Brennan, S. J., Fraser, M., Johansson, J., et al. 2022a, MNRAS, 513, 5642 [NASA ADS] [Google Scholar]
  9. Brennan, S. J., Fraser, M., Johansson, J., et al. 2022b, MNRAS, 513, 5666 [NASA ADS] [Google Scholar]
  10. Chen, T. W., Brennan, S. J., Wesson, R., et al. 2021, ArXiv e-prints, [arXiv:2109.07942] [Google Scholar]
  11. Craig, M., Crawford, S., Seifert, M., et al. 2017, https://doi.org/10.5281/zenodo.1069648 [Google Scholar]
  12. Foreman-Mackey, D., Hogg, D. W., Lang, D., & Goodman, J. 2013, PASP, 125, 306 [Google Scholar]
  13. Fraser, M., Stritzinger, M. D., Brennan, S. J., et al. 2021, ArXiv e-prints, [arXiv:2108.07278] [Google Scholar]
  14. Harbeck, D.-R., McCully, C., Pickles, A., et al. 2018, Long-Term Monitoring of Throughput in Las Cumbres Observatory’s Fleet of Telescopes, Proceedings of the SPIE, 10704, 1070401 [Google Scholar]
  15. Hayes, D. S., & Latham, D. W. 1975, ApJ, 197, 593 [NASA ADS] [CrossRef] [Google Scholar]
  16. Heasley, J. N. 1999, in Precision CCD Photometry, eds. E. R. Craine, D. L. Crawford, & R. A. Tucker, Astronomical Society of the Pacific Conference Series, 189, 56 [NASA ADS] [Google Scholar]
  17. Howell, S. B. 2006, Handbook of CCD Astronomy, 2nd edn., Cambridge Observing Handbooks for Research Astronomers (Cambridge University Press) [Google Scholar]
  18. Inn, E. C. Y., & Tanaka, Y. 1953, J. Opt. Soc. Am., 43, 870 [NASA ADS] [CrossRef] [Google Scholar]
  19. Kashyap, V. L., van Dyk, D. A., Connors, A., et al. 2010, ApJ, 719, 900 [NASA ADS] [CrossRef] [Google Scholar]
  20. Landolt, A. U. 1992, AJ, 104, 340 [Google Scholar]
  21. Lang, D., Hogg, D. W., Mierle, K., Blanton, M., & Roweis, S. 2010, AJ, 139, 1782 [Google Scholar]
  22. Lauer, T. R. 1999, PASP, 111, 1434 [NASA ADS] [CrossRef] [Google Scholar]
  23. Masci, F. 2011, WISE Internal Memorandum “Computing Flux Upper-limits for Non-detections” [Google Scholar]
  24. Massey, P., & Davis, L. E. 1992, A User’s Guide to Stellar CCD Photometry with IRAF, NOAO, Tucson, Arizona [Google Scholar]
  25. McCully, C., & Tewes, M. 2019, Astro-SCRAPPY: Speedy Cosmic Ray Annihilation Package in Python, Astrophysics Source Code Library [record ascl:1907.032] [Google Scholar]
  26. Merlin, E., Pilo, S., Fontana, A., et al. 2019, A&A, 622, A169 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  27. Moffat, A. F. J. 1969, A&A, 3, 455 [NASA ADS] [Google Scholar]
  28. Mommert, M. 2017, Astron. Comput., 18, 47 [NASA ADS] [CrossRef] [Google Scholar]
  29. Mortara, L., & Fowler, A. 1981, SPIE Conf. Ser., 290, 28 [NASA ADS] [Google Scholar]
  30. Naylor, T. 1998, MNRAS, 296, 339 [NASA ADS] [CrossRef] [Google Scholar]
  31. Patat, F., Moehler, S., OBrien, K., et al. 2011, A&A, 527, A91 [NASA ADS] [CrossRef] [EDP Sciences] [Google Scholar]
  32. Perley, D. A., Mazzali, P. A., Yan, L., et al. 2018, MNRAS, 484, 1031 [Google Scholar]
  33. Prentice, S. J., & Mazzali, P. A. 2017, MNRAS, 469, 2672 [Google Scholar]
  34. Prentice, S. J., Ashall, C., Mazzali, P. A., et al. 2018a, MNRAS, 478, 4162 [NASA ADS] [CrossRef] [Google Scholar]
  35. Prentice, S. J., Maguire, K., Smartt, S. J., et al. 2018b, ApJ, 865, L3 [NASA ADS] [CrossRef] [Google Scholar]
  36. Science Software Branch at STScI 2012, PyRAF: Python alternative for IRAF, Astrophysics Source Code Library [record ascl:1207.011] [Google Scholar]
  37. Stetson, P. B. 1987, PASP, 99, 191 [Google Scholar]
  38. Stritzinger, M., Hamuy, M., Suntzeff, N. B., et al. 2002, AJ, 124, 2100 [NASA ADS] [CrossRef] [Google Scholar]
  39. Tody, D. 1986, SPIE Conf. Ser., 627, 733 [Google Scholar]
  40. Tody, D. 1993, in Astronomical Data Analysis Software and Systems II, eds. R. J. Hanisch, R. J. V. Brissenden, & J. Barnes, Astronomical Society of the Pacific Conference Series, 52, 173 [NASA ADS] [Google Scholar]
  41. van Dokkum, P. G., Bloom, J., & Tewes, M. 2012, L.A. Cosmic: Laplacian Cosmic Ray Identification, Astrophysics Source Code Library [record ascl:1207.005] [Google Scholar]
  42. Wildey, R. L. 1992, PASP, 104, 285 [NASA ADS] [CrossRef] [Google Scholar]
  43. Zackay, B., Ofek, E. O., & Gal-Yam, A. 2016, ApJ, 830, 27 [NASA ADS] [CrossRef] [Google Scholar]

1

IRAF is distributed by the National Optical Astronomy Observatory, which is operated by the Association of universities for Research in Astronomy (AURA) under cooperative agreement with the National Science Foundation.

2

Specifically the National Optical Astronomy Observatories (NOAO), which was merged with NOIRLAb in 2019.

6

Version 1.0.2.

7

For example with CCDPROC (Craig et al. 2017).

9

At the time of writing these filters are Johnson-Cousins U, B, V, R, I, Sloan- u, g, r, i, z and NIR- J, H, K.

10

This is necessary in the case of unfiltered observations.

13

Using a 2017 MacBook Pro, with a 2.5 GHz Intel Core i7 processor with 8 Gb DDR3 RAM.

15

In practice, the modern definition of the Vega magnitude system implies that Vega itself has a magnitude of 0.03.

16

Sources must have a signal-to-noise ratio (S/N) of greater than 25 to be used in the PSF model by default.

17

Alternatively, the aperture size can be specified by the user, in which case the default aperture is 1.5 × FWHM.

18

Both values are adjusted if an optimum aperture size is determined from the data, as in Fig. 3.

19

High Order Transform of PSF and Template Subtraction.

24

This is not the case if template subtraction is preformed; however, it can still be used as an initial guess for artificial source injection.

25

Alternatively, the user can inject sources directly atop the transient site, following the same process, user discretion is advised as some underlying transient flux may be present and may skew results.

30

Example of AUTOPHOT’s execution can be found at https://github.com/Astro-Sean/autophot

All Tables

Table 1

Performance of AutoPhOT computing r-band light curves from Fig. 17.

All Figures

thumbnail Fig. 1

Flowchart showing the iterative process of finding the FWHM of image using AutoPhOT. We do not show the adaptive threshold step size for purpose of clarity.

In the text
thumbnail Fig. 2

Aperture photometry of a point source, showing the aperture radius (solid red line) as well as the background surface (green line in right and bottom panels). In this case, we estimate the background by fitting a 2D surface. We also include projections along the X and Y axes.

In the text
thumbnail Fig. 3

Measured S/N (enclosed flux) as a function of aperture radius for a set of sources given in upper (lower panel). For the upper panel, the mean of these curves is shown as a black solid line, while the maximum S/N of each source is indicated as per the colour bar. We note that this is consistent with the theoretical expectation from Naylor (1998). Lower panel shows the enclosed flux for a given aperture radius. We note the majority of the flux is enclosed by an aperture radius of ~2.5 × FWHM.

In the text
thumbnail Fig. 4

Histogram showing magnitude of the ratio of our large aperture size with r = 2.5 × FWHM and a standard aperture size of r = 1.5 × FWHM for a single image. This is the aperture correction used when aperture photometry is employed.

In the text
thumbnail Fig. 5

Demonstration of the steps taken to build residual table for PSF photometry. A cutout is taken around the source, and an analytical function is fitted and subtracted. The image is then resampled to a finer pixel grid (default: ×10). The residual image is then rolled (discretely shifted along x and y) such that the location of best fit is at the image centre. This is repeated for several bright isolated sources to obtain an average residual.

In the text
thumbnail Fig. 6

Example of PSF subtraction using AutoPhOT. The main panels show a cutout of the transient location before (left) and after (right) PSF subtraction, while projections along the x- and j/-axis are also shown for each panel. The source is cleanly subtracted and there is no sign of a residual in the subtracted panel.

In the text
thumbnail Fig. 7

Demonstration of source detection for catalogue sources. PSF stars (blue circles) are selected on the basis of their brightness and isolation. In this example, we only consider sources close to the transient location and exclude any sources near the host.

In the text
thumbnail Fig. 8

Zeropoint diagnostic plot from AutoPhOT. Left panels show zeropoint measurements before (upper left) and after (lower left) a 3σ clipping. Right panel shows zeropoint distribution with a probability density function with a well-defined peak.

In the text
thumbnail Fig. 9

Demonstration of the effect of point source colour on zeropoint calibration. X-axis shows the catalogue colour of sources, while the Y-axis shows the ø-band magnitudes minus their instrumental magnitude and image zeropoint. Red squares are binned magnitudes with error bars equal to the standard deviation of magnitudes in each bin. The solid black line shows the best fit using EMCEE (Foreman-Mackey et al. 2013). The lower panel shows the same points with the colour correction applied.

In the text
thumbnail Fig. 10

Discrepancy of zeropoint measurements when ignoring colour correction (black) and including it (red).

In the text
thumbnail Fig. 11

Demonstration of probabilistic limiting magnitude measurement. The upper panel shows the distribution of summed counts for a random set of pixels close to the expected source location. Bottom left panel shows a cutout of the transient location; pixels marked in red are excluded when creating the distribution; note the source off-centre is masked. Bottom right panel is the same image with injected PSF sources (marked with red circles) with magnitude equal to the Ful,β=0.75 limiting magnitude (see Appendix D).

In the text
thumbnail Fig. 12

Diagnostic plot from AutoPhOT’s artificial source injection package. Top panel shows the change in the detection probability (1 − β′) for artificially injected sources. In this example, the sources are considered lost at β = 0.75 and the detection cutoff is reached when 80% of sources are lost (black line with circles). The leftmost image cutouts illustrate locations around the target location before (upper) and after (lower) sources were injected randomly at the limiting magnitude. The remaining four panels demonstrate closes up of these injected sources.

In the text
thumbnail Fig. 13

Demonstration of recovered magnitude using aperture photometry (upper panel) and the PSF-fitting package (middle panel) from AutoPhOT. The F-axis shoes the derived zeropoint magnitude for each source. The bottom panel shows the difference between aperture and PSF-fitting photometry for this particular image. Solid lines show a moving mean value, with dashed lines indicating the standard deviation in each bin. Horizontal error bars show the uncertainty on catalogue magnitudes, vertical error bars are uncertainties on recovered magnitudes from AutoPhOT.

In the text
thumbnail Fig. 14

Comparison of measured instrumental magnitude and error using AutoPhOT, PSFex, SExtractor, and DAOPHOT. The upper two panels show the difference in recovered magnitude (left) using PSF-fìtting photometry, and the difference in error (right). Note, left and right panels have different y scales. The lower two panels show the same, but for aperture photometry. In each case, the x-axis gives the instrumental magnitude from AutoPhOT. The same aperture radius was used in the PSF and aperture cases. Error bars are the combination of uncertainties from both pipelines added in quadrature.

In the text
thumbnail Fig. 15

Magnitude recovery effectiveness for PSF (aperture) photometry packages given the upper (lower) panels. F-axis is recovered magnitude minus the injected magnitude of a fake PSF model positioned randomly across the image used in Fig. 7, with multiple iterations, including sub pixel jittering and the addition of random noise. We plot the limiting magnitude found via artificial source injection on an empty patch of sky as the red vertical line.

In the text
thumbnail Fig. 16

Comparison of the probable limiting magnitude and that found from artificial source injection. Upper panel: magnitude of recovered source versus its catalogue magnitude. If a source is recovered, it is plotted as the red marker. If the source is not recovered, we plot the limiting magnitude at the source’s position as the green marker (probable limiting magnitude) and blue marker (artificial source injection). Lower panel: S/N at the position of the source.

In the text
thumbnail Fig. 17

r-band light curves produced by AutoPhOT compared to those found in literature. AutoPhOT points are given as points with error bars, and literature values given as a shaded band with a width equal to the error at each point. In descending order, we compare the output from AutoPhOT for AT 2018cow (Perley et al. 2018; Prentice et al. 2018b) using template subtraction and aperture photometry, SN 2016coi (Prentice et al. 2018a) and SN 2016iae (Prentice & Mazzali 2017) without subtraction using both PSF and aperture photometry. We also compare the results using PyZogy for template subtraction in the case of AT 2018cow. Centre panels compare both cases, with the upper panel showing the difference between measurements (∆ Mag = AutoPhOTliterature) and lower panel showing the difference in error (∆ Magerr = AutoPhOTerrliteratureerr) for each transient. Right panels highlight the site of the transient event.

In the text
thumbnail Fig. A.1

Theoretical atmospheric extinction curves for several sites including La Silla27, Roque de los Muchachos28, Paranal (Patat et al. 2011), and Muana Kea29. We include a match to the Paranal extinction curve using αλ = αλ,Rayleigh + αλ,Ozone + αλ,Aerosol with b = −2, A0 = 0.05 and H0 = 1.5. It is difficult to fit the extinction curve as found at Muana Kea, likely due to high levels of volcanic dust.

In the text
thumbnail Fig. D.1

Demonstration of Eq. D.1. We perform artificial source injection on an empty patch of sky. Sources are injected uniformly throughout the image, including sub-pixel placements, with random Poisson noise added to the PSF prior to injection. In the upper panel, we plot Eq. D.1 versus maximum pixel flux in units of the standard deviation of the background noise, as the red curve. The green points show the binned S/N ratio using Eq. B.3. In the lower panel, we plot the S/N ratio using Eq. B.3 with the same x-axis as the upper panel. The points are coloured blue if S/N > 3 and red if S/N < 3. For the sample of sources incrementally injected, Eq. D.1 can reproduce the recovered fraction of sources. In other words, for sources measured with a fsource ≈ ~3σbkg, roughly half of these are recovered with a S/N > 3; for injected sources with fsource ≈ 3.7σbkg we detect roughly 75 %; while virtually all sources are confidently recovered at fsource ≈ 4.5σbkg

In the text

Current usage metrics show cumulative count of Article Views (full-text article views including HTML views, PDF and ePub downloads, according to the available data) and Abstracts Views on Vision4Press platform.

Data correspond to usage on the plateform after 2015. The current usage metrics is available 48-96 hours after online publication and is updated daily on week days.

Initial download of the metrics may take a while.