MegaCam Direct Imaging Exposure Time Calculator (DIET)

The basics:


Table of contents:


The calculator



Click on this figure to launch the calculator.


Quick MegaCam photometric performance table

Filter u*g'r'i'z'
Point source in dark sky - MagAB - Optimal ap. 25.526.125.624.923.9
Point source in grey sky - MagAB - Optimal ap. 25.225.725.324.923.9
Field galaxy in dark sky - MagAB - 2.2" ap. 24.925.524.924.223.3
Field galaxy in grey sky - MagAB - 2.2" ap. 24.525.024.624.223.3
Transition from AB to Vega magnitude system (mag) -.976+.007-.164-.400-.533

This table summarizes the camera performance for a 1 hour exposure under 0.8 arcsec. seeing with 1 airmass. Those are AB instrumental magnitudes.


1. How DIET works

DIET (Version 2.0) is a calculator allowing the observer to compute the exposure time required to reach a given signal-to-noise ratio in various observing conditions (source type, magnitude, filter, seeing, sky background, airmass, and atmospheric transmission).

DIET's computations are based on actual camera performance derived from the characterization of the instrument during the semester 2003A. The observing conditions (sky brightness, camera zero points, ...) are the values given in the "General Summary" table.

DIET was calibrated and tested using raw images from the camera.

The interactive graphical interface allows the user to experiment with some custom parameters. This iterative process can be time consuming for a single set of parameters: it is recommended to use the keyword "Range" for both parameters "Seeing" and "Sky" to obtain small tables exploring the domain of input conditions.

The magnitude system in DIET for MegaCam is AB. The following link (courtesy of D. Patton) provides information on the various magnitude systems and ways to go from one to another: http://www.astro.utoronto.ca/~patton/astro/mags.html.


2. Information on how DIET computes exposure times vs. magnitudes and SNRs

The following paragraphs propose a tutorial on the magnitude and signal to noise calculation schemes used in DIET.

2.1 Object types

There are three classes of objects considered in DIET:
    • Point sources: stars & QSOs
    • Galaxies: distant compact to sub-compact sources - seeing dominated profile
    • Nearby galaxy: profile dominated by the object itself
    • Extended source: uniform illumination over square arcsecond scales

2.2 Objects profiles

As provided in Iraf's Imexamine function, a Moffat function is used to fit all the profiles:

I = Ic (1 + (r / alpha)^2)^(-beta) [1]

where Ic is the peak value, r is the radius, and the parameters are alpha, and beta. The alpha value is equal to half the FWHM of the object (FWHM = seeing for seeing dominated profiles, and FWHM = object width at half maximum for large nearby galaxies), and beta defines the profile type, say how much energy is distributed in the wings of the profile. Based on a large sample, the median value for beta on MegaCam images, using Iraf's Imexamine, is:

    • Point sources: beta = 3.8
    • Galaxies: beta = 2.5
    • Nearby galaxies: beta = 1.8
    • Extended source: non applicable

2.3 Exposure time and SNR computation

Equation [1] can be integrated over the profile and the flux within an aperture of r=R is: (Mathematica integration)

F(R) = (Pi Ic alpha^2)/(1 - beta) ( (1 + (R / alpha)^2)^(-beta + 1) - 1) [2]

If R is infinite, the flux represents the total flux received from the object:

F(total) = (Pi Ic alpha^2)/(beta - 1) [3]

Equation [2] becomes:

F(R) = F(total) ( 1 - (1 + (R / alpha)^2)^(-beta + 1)) [4]

And F(total) can be computed simply from the magnitude equation, considering flux in electrons per second (Fe):

MagAB = Zero - k(a - 1) - 2.5log10 (Fe) [5]

With Zero the zero photometric point in electron per second, k the airmass term, a the airmass and Fe the total flux in electrons generated per second by the object of magnitude MagAB.

Fe = 10^((Zero - MagAB - k(a - 1)) / 2.5) [6]

Integrated over the exposure time Texp, we have:

F(total) = Fe Texp [7]

Now let us compute the signal to noise ratio over the aperture of radius R (flux considered in electrons):

SNR = F(R) / ( sqrt( F(R) + n Pi R^2 (Se Texp + noiseccd^2)) ) [8]

Where Se is the flux in electrons per second and per pixel coming from the sky background and noiseccd is the CCD readout noise. Pi R^2 represents the circular area of integration of the profile. Since the sky background to be subtracted from underneath the object is more often than not totally noise-free due to some modelling problem or crowding, the factor n is introduced. n can range from 1 for a perfect sky subtraction to 2 for a 1-1 pixel type subtraction. n could be higher than 2 actually in some crowded fields when some earby object flux is subtracted to the object itself. In DIET, a value of n=1.5 is used. Now solving the quadratic equation from [8] for Texp, one gets:

Texp = ( -b + sqrt (b^2 - 4 a c) ) / 2 a [9]
a = Fe^2, b = -SNR^2 (Fe + n Pi R^2 Se), c = -SNR^2 n Pi R^2 noiseccd^2

2.4 Optimal radius of flux integration

Maximizing the SNR over R for point spread functions (beta = 3.8), the relationship Ropt = 1.45 * alpha is obtained. This results in measuring 96% of the flux within the aperture. To integrate 96% of the flux for the galaxies (beta = 2.5) which carry more weight in their wings, the relation becomes Ropt = 2.80 * alpha (which corresponds to a 2.2 arcsec aperture for a 0.8 arcsec seeing). For nearby galaxies (beta = 1.8) which cover around 10 arcsec in diameter (and for which seeing plays little effect for SNR computation over the profile), the relation to get 96% of the flux within the diameter of integration leads to a generous Ropt = 13 * alpha (which corresponds to a 11 arcsec aperture for a 0.8 arcsec seeing).

By picking a radius for all three cases that lead to the integration of 96% of the light, the difference in magnitude between the total magnitude and the magnitude within the aperture is 0.044 mag. This will be of importance when comparing DIET results to real measurement by SExtractor which will have to be corrected for the 0.044 mag (subtraction).

For extended sources, the SNR is computed over a single pixel though the magnitudes have to be provided per square arcsecond.

2.5 Direct relation between the SNR and the error on the magnitude

Let us consider a simplified expression of the magnitude vs. flux measurement: m = -2.5 log(f). The error Em on m can be written Em = |dm/df| Ef where Ef is the error on f. Since |dm/df| = (1 / f)(2.5 / ln(10)), one gets Em = 1.09 (1 / (f / Ef)). Since SNR = f / Ef, the final relation is:

SNR = 1.09 / Em [10]

Where SNR is the signal to noise ratio on the object and Em the error on the magnitude on that object. For example, a error in magnitude of 0.1 mag gives a SNR of ~10, say a ~10% error.

When using a source extraction software like SExtractor (the most commonly used software today for large images) the error on the magnitude is estimated within the defined aperture. SExtractor derives the variance of the background (should it be sky background and/or detector read noise) regardless of its level. Hence it assumes the image is not affected by a convolution and/or resampling. In that regard, all the testing of DIET was done directly on raw data, knowing that further pre-processing and processing should increase the detection performance and the quality of the photometry.

2.6 Relation between SNR and photometry quality

    • SNR = 3 : Detection - Photometry error = 33%
    • SNR = 7 : Fair detection - Photometry error = 15%
    • SNR = 15 : Good detection - Photometry error = 7%
    • SNR = 25 : Quality photometry - Photometry error = 4%
    • SNR = 100 : High quality photometry - Photometry error = 1%


3. Examples of MegaCam photometric performance and image samples

3.1 Camera and site characteristics used in DIET

Magnitude system AB
Instrumental magnitude equation MagAB = Zp[e-/sec] - 2.5log(Flux[ADU])
-2.5log(Gain[e-/ADU]) + 2.5log(ExpTime)
- k(airmass - 1)
Gain (e- / ADU) 1.67 (0.2 dispersion over the 36 CCDs)
Filters u*, g', r', i', z'
Zero points (e-/sec) at 1 airmass (Zp) 25.77, 26.96, 26.47, 26.24, 25.30
Airmass term 0.350, 0.150, 0.100, 0.040, 0.030
Dark sky brightness @ zenith (e-/pix/sec) 1.000, 3.200, 3.500, 7.100, 6.900
Grey sky brightness @ zenith (e-/pix/sec) 2.100, 7.900, 5.800, 7.100, 6.900
Bright sky brightness @ zenith (e-/pix/sec) 3.900, 14.70, 11.20, 7.100, 6.900
Sky brightness airmass dependency offset (e-/airmass) 0.340, 0.340, 2.460, 11.60, 11.90
Transition from AB to Vega magnitude system (mag) -.976, +.007, -.164, -.400, -.533
Pixel scale (arcsec / pixel) 0.187
Read noise (e- / pixel) 5

3.2 Example of performance on point sources

Here is the output from DIET with the given input parameters.

u* filter - MagAB=25.0 - SNR=5

 Seeing   |      Sky(Airmass=1.0)            Sky(Airmass=1.5)      
          |     DARK     GREY   BRIGHT     DARK     GREY   BRIGHT
      |   |------------------------------------------------------------
     0.6  |      202      378      675      299      545      959
     0.8  |      342      669     1216      517      973     1730
     1.0  |      511     1022     1872      781     1492     2667
     1.2  |      710     1438     2643     1092     2103     3769
 

g' filter - MagAB=25.6 - SNR=5

 Seeing   |      Sky(Airmass=1.0)            Sky(Airmass=1.5)      
          |     DARK     GREY   BRIGHT     DARK     GREY   BRIGHT
      |   |------------------------------------------------------------
     0.6  |      197      459      843      231      533      974
     0.8  |      346      828     1530      408      962     1768
     1.0  |      528     1276     2364      623     1483     2732
     1.2  |      742     1803     3345      876     2096     3866
 

r' filter - MagAB=25.1 - SNR=5

 Seeing   |      Sky(Airmass=1.0)            Sky(Airmass=1.5)      
          |     DARK     GREY   BRIGHT     DARK     GREY   BRIGHT
      |   |------------------------------------------------------------
     0.6  |      209      335      634      287      426      754
     0.8  |      370      601     1147      513      767     1367
     1.0  |      565      924     1771      787     1181     2111
     1.2  |      795     1304     2505     1109     1669     2986
 

i' filter - MagAB=24.4 - SNR=5

 Seeing   |      Sky(Airmass=1.0)            Sky(Airmass=1.5)      
          |     DARK     GREY   BRIGHT     DARK     GREY   BRIGHT
      |   |------------------------------------------------------------
     0.6  |      212      212      212      331      331      331
     0.8  |      380      380      380      599      599      599
     1.0  |      584      584      584      923      923      923
     1.2  |      823      823      823     1304     1304     1304
 

z' filter - MagAB=23.5 - SNR=5

 Seeing   |      Sky(Airmass=1.0)            Sky(Airmass=1.5)      
          |     DARK     GREY   BRIGHT     DARK     GREY   BRIGHT
      |   |------------------------------------------------------------
     0.6  |      223      223      223      351      351      351
     0.8  |      399      399      399      634      634      634
     1.0  |      614      614      614      978      978      978
     1.2  |      866      866      866     1383     1383     1383
 

3.3 Example of performance on field galaxies

Here is the output from DIET with the given input parameters.

u* filter - MagAB=24.7 - SNR=5

 Seeing   |      Sky(Airmass=1.0)            Sky(Airmass=1.5)      
          |     DARK     GREY   BRIGHT     DARK     GREY   BRIGHT
      |   |------------------------------------------------------------
     0.6  |      394      780     1424      599     1137     2029
     0.8  |      671     1360     2502     1033     1990     3569
     1.0  |     1033     2118     3910     1599     3104     5580
     1.2  |     1467     3030     5604     2280     4445     7999
 

g' filter - MagAB=24.9 - SNR=5

 Seeing   |      Sky(Airmass=1.0)            Sky(Airmass=1.5)      
          |     DARK     GREY   BRIGHT     DARK     GREY   BRIGHT
      |   |------------------------------------------------------------
     0.6  |      403      971     1798      475     1128     2077
     0.8  |      702     1708     3168      829     1985     3662
     1.0  |     1091     2669     4958     1291     3103     5731
     1.2  |     1560     3827     7111     1846     4449     8220
 

r' filter - MagAB=24.4 - SNR=5

 Seeing   |      Sky(Airmass=1.0)            Sky(Airmass=1.5)      
          |     DARK     GREY   BRIGHT     DARK     GREY   BRIGHT
      |   |------------------------------------------------------------
     0.6  |      360      586     1121      500      749     1336
     0.8  |      627     1028     1974      874     1315     2353
     1.0  |      975     1605     3087     1363     2055     3681
     1.2  |     1394     2298     4427     1951     2945     5279
 

i' filter - MagAB=23.7 - SNR=5

 Seeing   |      Sky(Airmass=1.0)            Sky(Airmass=1.5)      
          |     DARK     GREY   BRIGHT     DARK     GREY   BRIGHT
      |   |------------------------------------------------------------
     0.6  |      444      444      444      702      702      702
     0.8  |      779      779      779     1235     1235     1235
     1.0  |     1217     1217     1217     1931     1931     1931
     1.2  |     1743     1743     1743     2768     2768     2768
 

z' filter - MagAB=22.8 - SNR=5

 Seeing   |      Sky(Airmass=1.0)            Sky(Airmass=1.5)      
          |     DARK     GREY   BRIGHT     DARK     GREY   BRIGHT
      |   |------------------------------------------------------------
     0.6  |      467      467      467      744      744      744
     0.8  |      820      820      820     1309     1309     1309
     1.0  |     1280     1280     1280     2047     2047     2047
     1.2  |     1833     1833     1833     2935     2935     2935
 

3.4 Practical example: point sources

The following image (Figure 1) is a small fraction from the CCD13 originating from the image ID=712976o, a r' 300 seconds exposure taken at 1.08 airmass presenting an image quality of 0.62" and a sky background of 3.5 electron per pixel and per second. The gain of the CCD is 1.7 electron per ADU.



Figure 1. Examples of objects covering a range of SNRs.

The following stars from the frame 712976o were part of the set used to compare DIET predictions with SExtractor measurements. First the diameter for the aperture photometry extraction must be obtained from DIET: run DIET with the 0.6" seeing explicit case (not Range), you will be given "SNR di=4.7pix" in the general parameters feedback in the result area. The SExtractor configuration file is then set with PHOT_APERTURES=4.7 with the following other parameters set to their proper value too: SEEING_FWHM, GAIN, MAG_ZEROPOINT (which must be in ADU, not electron, hence -2.5*log(GAIN) must be added, SExtractor doesn't do it for you). The aperture magnitude (MAG_APER) is then obtained from the generated catalog and corrected by -0.044 mag to account for the missing flux outside the used optimal aperture. The error in magnitude (MAGERR_APER) is converted to a signal-to-noise ratio with the formula [10]. These two values are then entered in the DIET input fields (also setting the precise sky background value in e-/pix/sec). The granulation of the seeing parameter may be a bit limitative but taking values on both sides should give a fairly good idea of the performance (FYI, the following examples were obtained in command line mode where a precise seeing value can be entered).

Star Name Xpox,Ypox Mag. (corrected) SNR DIET output
A 1135, 1814 21.78 87.6 260
B 1183, 1744 23.80 18.1 298
C 1176, 1899 24.53 9.53 302
D 1232, 1878 25.10 5.67 299

Star C may actually well be a compact core galaxy as it seems to have structures further out that the other stars... Anyway, DIET results match the actual exposure time very well for the fainter objects.



Figure 2. Profile and Moffat fit (Iraf) of the star "A" from Figure 1.

3.5 Practical example: field and nearby galaxies

The following image (Figure 3) is a small fraction from the CCD13 originating from the image ID=707909o, a r' 360 seconds exposure taken at 1.27 airmass presenting an image quality of 0.71" and a sky background of 5 electron per pixel and per second. The gain of the CCD is 1.7 electron per ADU.



Figure 3. Examples of galaxies covering a range of SNRs.

The following galaxies from the frame 707909o were part of the set used to compare DIET predictions with SExtractor measurements. First the diameter for the aperture photometry extraction must be obtained from DIET: run DIET with the 0.7" seeing explicit case (not Range), you will be given "SNR di=10.5pix" for the "Galaxy" case, and "SNR di=98.4pix" for the nearby galaxy case, in the general parameters feedback in the result area. The SExtractor configuration file is then set with PHOT_APERTURES to 10.5 or 98.4 with the following other parameters set to their proper value too: SEEING_FWHM, GAIN, MAG_ZEROPOINT (which must be in ADU, not electron, hence -2.5*log(GAIN) must be added, SExtractor doesn't do it for you). The aperture magnitude (MAG_APER) is then obtained from the generated catalog and corrected by -0.044 mag to account for the missing flux outside the used optimal aperture. The error in magnitude (MAGERR_APER) is converted to a signal-to-noise ratio with the formula [10]. These two values are then entered in the DIET input fields (also setting the precise sky background value in e-/pix/sec). The granulation of the seeing parameter may be a bit limitative but taking values on both sides should give a fairly good idea of the performance (FYI, the following examples were obtained in command line mode where a precise seeing value can be entered).

Galaxy Name Xpox,Ypox Mag. (corrected) SNR DIET output
Field Galaxy A 1128, 2458 22.52 24.66 341
Field Galaxy B 1205, 2346 24.47 4.24 351
Nearby Galaxy A 1174, 2486 19.72 35.38 332
Nearby Galaxy B 1118, 2350 21.72 5.71 342

DIET results match the actual exposure time fairly well but seem overall a bit short by about 5%.



Figure 2. Profile and Moffat fit (Iraf) of the nearby galaxy "A" from Figure 3.


4. How to compare DIET results with your way of computing SNRs

First retrieve the two images used to generate the previous examples:
(push on the keyboard key "SHIFT" while clicking on the link to save the BIG (I warned you) FITS image to disk)

Star field: 712976o13O.fits
Galaxy field: 707909o13O.fits

Then run your usual source extraction tool to compute magnitudes and errors and compare it for the objects depicted above. Their Xpos,Ypos coordinates originate from these files.

If you want to reproduce the SExtractor results, you can retrieve both the parameter file and the configuration file for the image 712976o13O.fits (the proper path has to be set in place of the DIRSET keyword).


5. How to optimally fragment the total exposure time

To efficiently remove the cosmic rays and cosmetic defaults of the mosaic (gaps between the CCDs, bad columns), a minimum of 4 dithered exposures per field is required, though 5 is recommended to obtain a more uniform SNR across the gap areas.

Each exposure should however be in sky photon noise regime such that when exposures are later added together, the expected signal to noise ratio will be obtained (i.e. grows as square root of cumulated exposure time). The readout noise is low on MegaCam and is quickly dominated in the broad band filters by the sky photon noise. Taking a typical readout noise of 5 electrons, and using the darker sky brightness (dark time, 1.0 airmass), the minimum exposure time to use in order for the readout noise to be dominated by a factor of 10 by the sky background photon noise (that is: 10 * 5^2 = 250 electrons) is:

  • u* band: 5 mn
  • g' band: 80 sec
  • r' band: 70 sec
  • i' band: 35 sec
  • z' band: 36 sec

The saturation level should also be a consideration: exposing too long will indeed save a couple of minutes by skipping some readouts but will result in high sky background and several objects reaching saturation. Typically, the following exposure times are a good compromise to achieve low overheads while keeping the signal in a reasonable range:

  • u* band: 10 mn (to limit the impact of the atmospheric refraction)
  • g' band: 12 mn
  • r' band: 12 mn
  • i' band: 10 mn
  • z' band: 10 mn

One should consider that taking exposures as short as possible would result in a massive amount of data difficult to handle. In the end, it has to be a compromise between having at least 5 exposures all longer than the minimal time to reach sky photon noise dominated regime and equal or shorter than the recommended exposure times from this last table.