Optimum Exposures Calculator
Astrophotography can seem like a fair bit of guess-work. In general the process of capturing images involves doing so at a certain exposure length and multiple times for the same target, using the same filter. The idea here being to combine the images captured during calibration in order to reduce the pronunciation of noise and increase the pronunciation of signal, i.e. to increase the Signal-to-Noise Ratio (SNR) of your target. Guessing how much time to spend on a target however can be hard to do.
There has been a good amount of mathematical analysis done on this problem by astrophotographers over the years. John Smith sparked off a good analysis, suggesting as a conclusion that one should calculate his/her exposure time required to overwhelm the CCD camera's readout noise with light pollution noise and aim to capture 2N+1 exposures of half this exposure time (where N is the number of exposures needed to reach a certain SNR). Though this seemed like a good idea, Charles Anstey was later motivated on making some adjustments to this theory based on his own empirical results. Charles noted that John's method was recommending extremely short exposures that were not giving the CCD sensor enough time to acquire faint signal from targets. A mathematical development followed that aimed to adjust this and come up with an updated theory. The end result was an equation that was a function of both ideal exposure time and total imaging time (number of exposures). Unfortunately this meant that you needed to make an assumption on one to work out the other. There were also some red flags in terms of quantities with unknown units and the final equation being dimensionally inconsistent.
Thankfully Steve Cannistra had made his own mathematical framework that was more closed-ended. Approaching the problem by determining an asymptotic SNR (theoretical maximum you can reach given photon noise contribution overwhelming the CCD camera's readout noise), Steve derived a simple equation to give one's optimum exposure time. There was however no framework for the optimum number of exposures needed. In general, if you capture too few exposures, you end up with lower SNR than desired. If you capture too many exposures, you are wasting time because of diminishing returns during stacking. There is no real set number of exposures one must capture as the more, the better (with diminishing returns). However, empirical work on increasing SNR boost of a stack of calibrated images over a single calibrated image has been done by Kayron Mercieca in order to determine how with dithered images, Kappa-Sigma Clipping in DeepSkyStacker (a common robust, statistically-weighted combination method) behaves with increasing number of images in the stack. The user may then determine how far they wish to improve a single image's SNR by stacking numerous (typically between 50% and 150% improvement is recommended) and the calculator determines about how many exposures are required for such an improvement. The assumption however goes that the user is dithering between images (very important!) and is using robust, statistically-weighted combination methods such as Kappa-Sigma Clipping in DeepSkyStacker.
This calculator has been created based on the aforementioned mathematical framework. Credit for the theoretical maximum SNR framework used goes to Steve Cannistra and to Kayron Mercieca for the empirical work on SNR boost during stacking with Kappa-Sigma Clipping. You will need a program capable of opening Microsoft Excel XLSX spreadsheets in order to use the calculator. Please click the button to download. Some instructions for using this calculator are provided below.
Current Version: 2.2
Date of Release: 17 / 09 / 2014
Instructions for Use
You will need to make accurate determinations of your CCD camera's Gain in e/ADU, Readout Noise in e, Dark Current Noise in e/minute and Full Well Capacity in e. CCD camera manufacturers normally provide these but they are an average specification for your CCD sensor. It is best to determine for your particular CCD camera with your particular equipment (operating voltage makes a difference). Craig Stark provides an excellent guide (click link) in determining these parameters for your CCD camera from a handful of bias, dark and flat frames. Once determined, enter these parameters into the CCD Camera section of the calculator.
Steve Cannistra worked out from first principles (and demonstrated by graphing actual data) that as you capture longer and longer exposures, you approach a certain SNR more and more closely (asymptotic SNR behaviour). This happens because though longer exposures build target signal brightness, they also build noise (including that from light pollution). SNR only rises to a certain point beyond which there is no point exposing for longer. Since the behaviour is asymptotic, one can never realistically reach this point but we can settle extremely closely to it. The parameter for Desired Percentage of Asymptotic SNR defines how close we wish to get to this theoretical maximum SNR. Good values range between 90% and 95%. Minor tweaking of this parameter can drastically change the optimum exposure times calculated. Enter a desired value in the Signal-to-Noise Ratio section of the calculator.
Empirical work by Kayron Mercieca was carried out to determine how the SNR of a stack of images is boosted above a single image when the images are captured with dithering and are combined using a robust, statistically-weighted combination method such as Kappa-Sigma Clipping in DeepSkyStacker. The relationship determined for SNR boost is embedded into the calculator's calculation of optimum number of exposures. However, the user is free to go as far as they like. The more exposures, the better, with accepted diminishing returns on SNR boost. The parameter for Desired SNR Boost by Stacking defines how much the SNR should improve over a single calibrated image once stacking takes place. Good values range between 1.5 and 2.5 (50% and 150% improvement, respectively). Enter a desired value in the Signal-to-Noise Ratio section of the calculator.
You will now need to capture some test exposures at your imaging location. Do this on a night of average conditions. Image a part of the night sky that is near the Meridian and around the regions of the night sky you usually prefer imaging in (consider that different parts of the night sky will have different levels of light pollution and transparency). You may even wish to do this in multiple areas of the night sky on multiple nights and average your results. Say we wish to capture 5 minute test exposures. If imaging with a monochrome CCD camera, for each of your filters (and your usual binning settings), capture a single 5 minute test exposure of an area that has nothing but some stars (nothing special should be present, such as nebulosity or galaxies). You may for example wish to capture Luminance unbinned at 1x1 and RGB binned at 2x2. Do it as you normally would as these test exposures will then take everything into account. If you use multiple cameras and telescopes, you will need to repeat this process for each imaging rig (telescope-camera pair). You will need to capture some bias, dark and flat frames to calibrate all your images. Using statistically-weighted combination techniques such as Kappa-Sigma Clipping in DeepSkyStacker, calibrate all your test exposures.
Open a calibrated test exposure in your choice of software (e.g. MaxIm DL, ImageJ, PixInsight, etc) and create a preview box over a decently-sized area of the image that is purely background (no stars, no nebulosity, no galaxies, etc - just background). You may want to create a number of these preview boxes to average your results. Determine the Median 16-bit pixel value (ADU) of the preview box region of your image. This is your background ADU and should be entered into Background Flux Median in the Base Image Statistics section of the calculator. Next, enter the exposure length of your test exposure in minutes (in this example, 5).
Finally, it is important to note that some image capture software (e.g. MaxIm DL) add a pedestal value to images. This is a specific amount of ADU (pixel value) added to the entire image to ensure that no negative numbers arise later. Image capture software that do this tend to add 100 ADU but it could very well vary - you will need to check online or with the software developer. Nebulosity, for example, adds nothing (0 ADU). Once you determine this, enter it for Image Capture Software Pedestal in the Base Image Statistics section of the calculator.
Automatically, your calculations will have been made at this point. In the Calculated Results section of the calculator, you will first see the determined e/minute value of your background (light pollution). Optimum exposure time is then calculated based on your entered parameters, using Steve Cannistra's mathematical framework. The optimum number of exposures to capture (for later stacking) is calculated based on your entered parameters, using Kayron Mercieca's empirical framework. A total imaging time is then provided from multiplying these. You can edit your entered parameters to increase or decrease this to your liking. Generally the parameters to alter for tweaking are the Desired Percentage of Asymptotic SNR and Desired SNR Boost by Stacking in the Signal-to-Noise Ratio section of the calculator.
The end result is one where you now know how long to expose for and how many images you need for stacking for each of your filters with your chosen imaging rig (telescope-camera pair). This takes everything into account, including the filter attenuation, the binning setting used and the optical system focal ratio as it is an evidence-based calculation. Since this is pretty much fixed, it helps to build a good library of dark frames for use with these specific exposure times.
A few words of advice here. When capturing light frames of a desired target, use dithering. This is a technique whereby the telescope is slewed a number of pixels between light frames. This is done in order to ensure the target falls on a different part of the CCD sensor each time and therefore imperfections in the CCD sensor are averaged out later during stacking. When calibrating and stacking, ensure you use statistically-weighted combination techniques, particularly for the light frames. Kappa-Sigma Clipping in DeepSkyStacker is one example. Blind methods such as Median lead to a large loss of SNR no matter how many images are stacked.
During imaging of your desired target, you may wish to make use of the Full Well Capacity Limit feature of the calculator. As your CCD sensor captures photons in its pixels, the electrons it gathers over time pile up in each pixel (to generate a stronger and stronger signal over time). Eventually of course, due to the size of the pixels, the electrons completely fill up a pixel. At this point, anti-blooming CCD sensors will drain electrons to avoid them spilling over to adjacent pixels (causing ugly blooming over bright areas of the image). When a pixel is filled, we say it has reached Full Well Capacity. The Full Well Capacity of your CCD sensor depends on both the CCD sensor itself (e.g. physical pixel size) and the binning mode used (e.g. 2x2 approximately quadruples Full Well Capacity over 1x1).
Reaching Full Well Capacity in areas of an image essentially saturates those pixels. If many surrounding pixels saturate, you lose the detail in that region (this is common in the cores of M31 Andromeda Galaxy and of the M42 Orion Nebula with very long exposures). To avoid this, knowing the Full Well Capacity of your CCD sensor and having it inputted into the calculator, capture a test exposure of your intended target. Use an exposure time that does not saturate the region of interest. Use your choice of software (e.g. MaxIm DL, ImageJ, PixInsight, etc) and create a preview box over your region of interest (normally the core of a galaxy or the brightest areas of nebulosity). Avoid including stars unless those stars are the ones you want to avoid saturating. Once you create the preview box, determine the Maximum 16-bit pixel value (ADU) of the preview box in your region of interest. Enter this together with the exposure time you used under the Target Object Image section of the calculator. This will determine your Full Well Capacity limited exposure time - the maximum amount of time you should expose for before that region of interest you chose starts saturating.
You may use this feature to give an upper limit to your exposure time, whether or not it is above or below the optimum exposure time calculated by the calculator for your chosen parameters and CCD camera. Do remember that because different regions of your images will have different brightness, you may still encounter some saturation (particularly common in stars, especially bright ones) when exposing under the Full Well Capacity limited exposure time.
After you have completed your imaging run and wish to capture flats, the calculator uses your CCD camera parameters to determine the Maximum 16-bit pixel value (ADU) you should aim for in your flat calibration frame acquisition. This is generally recommended to be about 70% of the full well capacity of your CCD sensor. Please note that the value provided is not critical, but it is recommended. It will generally be almost impossible to get exactly on the mark, but a thereabouts value suffices. To check which exposure time and/or light source brightness gives you optimum flats, simply capture one test flat and open the raw FITS file. Look at the Maximum value across the entire image. This should be as close as possible to the one provided by the calculator. The flat should also of course characterise your optical system's vignetting and dust motes (as this is the point of using flats).