Page 1 of 2
optimising the dull job of image stacking
Posted: Mon Oct 21, 2013 7:48 am
by Nitpicker
A noob question which may have been asked before ...
Assuming I wanted to create a 10-minute exposure, would there be any technical difference between stacking, say, 20x30-second sub-frames and 5x120-second sub-frames? Obviously, it is more convenient to stack less sub-frames, but easier to track a scope accurately with shorter sub-frames. Would there be any difference in the signal-to-noise ratio, or anything else, if the total exposure time was the same?
Re: optimising the dull job of image stacking
Posted: Mon Oct 21, 2013 2:18 pm
by Chris Peterson
Nitpicker wrote:A noob question which may have been asked before ...
Assuming I wanted to create a 10-minute exposure, would there be any technical difference between stacking, say, 20x30-second sub-frames and 5x120-second sub-frames? Obviously, it is more convenient to stack less sub-frames, but easier to track a scope accurately with shorter sub-frames. Would there be any difference in the signal-to-noise ratio, or anything else, if the total exposure time was the same?
The signal component is the same for a single image or a stack of subexposures with the same total exposure time. Most of the noise components are the same, as well, but there is one exception. The noise components are: (1) the photon shot noise, which is just the statistical noise on the signal itself (a Poisson source), and is equal to the square root of the signal; (2) the dark current noise, which is an instrumental noise source which increases with exposure time and is minimized by cooling the sensor; (3) the sky background noise, which is also photon shot noise, but from the sky itself- light pollution and skyglow; (4) readout noise, which is an uncertainty injected when the the sensor is read. All of these noise sources give the same value for single or summed exposures except for readout noise, which increases with each subexposure. This puts a practical limit on how short subexposures can be, with that limit normally determined by the shortest time where sky background is the dominant noise source, not readout noise.
Under bright skies with low focal ratio optics, exposures as short as a minute or so may be sky background limited. Under dark skies, with high focal ratio optics or narrowband filters, exposures may have to be 30 minutes or longer before the sky background dominates.
Readout noise is a purely instrumental error, and can be made arbitrarily small (in theory) by engineering methods. In fact, there is a class of sensors available which has essentially zero readout noise. With these sensors, it is possible to image at video rates and build up an image from very short exposures. This allows imaging without active guiding (just open loop tracking), or allows active guiding directly off the acquired image in real time, and it allows for "lucky imaging", where each frame is tested for star size or other metrics and accepted or rejected dynamically- giving results similar to adaptive optics. I think cameras like this will be the future of astronomical imaging, especially for amateurs, but currently they are priced out of the range of most people.
Re: optimising the dull job of image stacking
Posted: Tue Oct 22, 2013 2:22 am
by Nitpicker
Thank you again Chris. That's very useful information and helps me better understand the jargon too.
Is there an obvious/practical/easy way to determine the point at which the sky background noise dominates the readout noise? I've never considered readout noise before.
On a good night from my backyard, in the darker western side of my sky, I can normally see stars down to about mag 4 with the naked eye, sometimes a touch better if I'm patient and don't dazzle my eyes with the live-view screen on my DSLR. I don't consider myself to be a particularly good visual observer, as I'm pretty new to the hobby. I never photograph through my scope with a ratio faster than f/10, and occasionally push it as slow as f/50 before things become too ridiculous. But I only have a smallish, unguided, alt-az mounted, motorised goto scope, which I would not quite consider to be a "precision instrument" tracking wise. I typically cannot exceed subexposures of 30 seconds before my percentage of streaky, discarded subs becomes too high. And with an alt-az mount, field rotation also becomes an issue near meridian and zenith, for longer subexposures.
So, limited as I am to 20 to 30 second subexposures, on any particular night, I first try a few test shots of my desired deep sky target at different ISO settings, and select the ISO just before the fainter deep sky signals start to get lost in the sky glow. (This is normally an ISO of between 3,200 and 10,000.) Is this the best approach for subsequent stacking of images, given all my other constraints?
From what you have said, it sounds like my setup/technique is probably okay for my suburban skies, but probably not good enough to bother taking into dark skies. That's okay, I've grown quite attached to my simple evening ritual of popping out to the backyard with a beer, after the kids are in bed.
Re: optimising the dull job of image stacking
Posted: Tue Oct 22, 2013 3:39 am
by geckzilla
I was curious about the zero readout noise sensor and how much one costs but apparently you can't just buy one. It's a thing you have to build yourself, I presume?
Re: optimising the dull job of image stacking
Posted: Tue Oct 22, 2013 4:31 am
by Chris Peterson
geckzilla wrote:I was curious about the zero readout noise sensor and how much one costs but apparently you can't just buy one. It's a thing you have to build yourself, I presume?
They are commercially available. They are called EMCCD cameras. I have one I built, and most astronomical instrumentation is custom or semi-custom, but there are lots of applications that can use entire camera systems off-the-shelf. Prices are coming down a bit; I think you can get 512x512 pixel cameras for under $10K now.
Re: optimising the dull job of image stacking
Posted: Tue Oct 22, 2013 4:37 am
by Chris Peterson
Nitpicker wrote:Is there an obvious/practical/easy way to determine the point at which the sky background noise dominates the readout noise? I've never considered readout noise before.
There are a number of exposure calculators out there, like
this one. Google for more. Most describe the math involved, as will any good imaging reference.
Re: optimising the dull job of image stacking
Posted: Tue Oct 22, 2013 5:04 am
by Nitpicker
Chris Peterson wrote:Nitpicker wrote:Is there an obvious/practical/easy way to determine the point at which the sky background noise dominates the readout noise? I've never considered readout noise before.
There are a number of exposure calculators out there, like
this one. Google for more. Most describe the math involved, as will any good imaging reference.
So, the answer is no.
Re: optimising the dull job of image stacking
Posted: Tue Oct 22, 2013 1:10 pm
by geckzilla
That doesn't look that hard. The instructions are pretty straightforward. Easier than trial and error, anyway.
Re: optimising the dull job of image stacking
Posted: Tue Oct 22, 2013 2:20 pm
by Chris Peterson
Nitpicker wrote:So, the answer is no. :ssmile:
Figuring out what to plug into these sorts of calculators isn't all that difficult. You can usually get fairly accurate camera specs- from the manufacturer if it's an astronomical camera, or online for most consumer cameras, already worked out by other imagers. The rest needs just a few test shots.
This may not be of immediate use to you, since with your current setup you are probably tracking limited to exposure times that are too short to maximize your S/N. That just means you need more total exposure time than you otherwise would (since the readout noise increases slower than the signal, so even if the exposure is too short, more of them helps).
If you're serious about imaging, or might get serious, it's worthwhile to study the theory a little, especially with respect to understanding noise. Once your equipment is good enough that you don't have major instrumentation limitations, managing S/N is the most important factor in getting good images.
Willmann-Bell has good
books on astronomical imaging, and I'd especially recommend Berry & Burnell. The standard text for CCD imaging is Howell's
Handbook of CCD Astronomy, which every imager should have on their shelf. Of course, all the important information is available online with a bit of careful searching, as well.
Re: optimising the dull job of image stacking
Posted: Tue Oct 22, 2013 10:33 pm
by Nitpicker
Thanks Chris. Just dipping my toes in for now. Mainly wanting a sanity check at this stage, to ensure I'm not just wasting my time entirely. Thus far, the best tip I've gleaned from this topic is to take more subexposures.
I still don't really know how to look at a series of test shots and say "the readout noise is dominating the sky glow noise at this point", or if that is even feasible. I'm still struggling to understand what readout noise is exactly, and how one can tell it apart from some of the other noise sources. That was more where my question was directed. Whenever I google information on deep sky photography, I am baffled by jargon and perplexed at the apparent contradictions spread by so many. A classic case of too many cooks. If I'm to dive in to this seriously at some point in the future and understand this subject, I shall need to avoid google and software wizards, and start from first principles. Thanks for the book references.
Re: optimising the dull job of image stacking
Posted: Tue Oct 22, 2013 11:54 pm
by Chris Peterson
Nitpicker wrote:Thanks Chris. Just dipping my toes in for now. Mainly wanting a sanity check at this stage, to ensure I'm not just wasting my time entirely. Thus far, the best tip I've gleaned from this topic is to take more subexposures.
I still don't really know how to look at a series of test shots and say "the readout noise is dominating the sky glow noise at this point", or if that is even feasible. I'm still struggling to understand what readout noise is exactly, and how one can tell it apart from some of the other noise sources. That was more where my question was directed. Whenever I google information on deep sky photography, I am baffled by jargon and perplexed at the apparent contradictions spread by so many. A classic case of too many cooks. If I'm to dive in to this seriously at some point in the future and understand this subject, I shall need to avoid google and software wizards, and start from first principles. Thanks for the book references.
Noise is noise. It's an uncertainty on the signal, and there's no way to separate noise sources in a single image. There are all sorts of tests you can do with your camera to isolate and measure individual noise components, though. They are explained in the above references. For instance, if you take an image with the telescope covered, there will be no sky background at all. The only signal will be from the dark current, and the only noise will be the dark current noise and the readout noise.
Re: optimising the dull job of image stacking
Posted: Wed Oct 23, 2013 12:10 am
by Nitpicker
Chris Peterson wrote:Noise is noise. It's an uncertainty on the signal, and there's no way to separate noise sources in a single image. There are all sorts of tests you can do with your camera to isolate and measure individual noise components, though. They are explained in the above references. For instance, if you take an image with the telescope covered, there will be no sky background at all. The only signal will be from the dark current, and the only noise will be the dark current noise and the readout noise.
So, by subtracting a dark frame, I'm subtracting the dark current noise and the readout noise. But I assume the readout noise is random from one sub to the next, whereas the dark current noise should have a more constant pattern if generated under the same conditions as the "light" subs. If so, then subtracting a dark frame is not quite as clean an operation as I had previously imagined, especially if my readout noise is dominating my sky glow, as you suspect.
Furthermore, it occurs to me now that by ramping up my ISO settings, as I described above, I could, in fact, be increasing my readout noise faster than my sky glow. I had previously assumed it was all sky glow. [Sound of penny dropping and forehead slapping, fade to noisy black.]
Re: optimising the dull job of image stacking
Posted: Wed Oct 23, 2013 12:28 am
by Chris Peterson
Nitpicker wrote:So, by subtracting a dark frame, I'm subtracting the dark current noise and the readout noise. But I assume the readout noise is random from one sub to the next, whereas the dark current noise should have a more constant pattern if generated under the same conditions as the "light" subs. If so, then subtracting a dark frame is not quite as clean an operation as I had previously imagined, especially if my readout noise is dominating my sky glow, as you suspect.
You can't subtract noise. In fact, when you subtract a dark frame, you actually increase the noise, since both the light and dark frames contain noise, and that noise adds quadratically. We typically subtract dark frames because removing offsets and fixed pattern artifacts usually improves the image, even at the expense of a little more true noise.
Furthermore, it occurs to me now that by ramping up my ISO settings, as I described above, I could, in fact, be increasing my readout noise faster than my sky glow. I had previously assumed it was all sky glow. [Sound of penny dropping and forehead slapping, fade to noisy black.]
Yes. The choice of ISO setting with a DSLR isn't obvious. Astronomical cameras don't typically have adjustable gain (which is what your ISO settings represent). You can frequently get better S/N using a lower ISO setting. Keep in mind that with a properly exposed image, the primary noise component is just the statistical noise on the signal itself, which is the square root of the number of photons you collect. Changing the gain of the amplifier at the output of the sensor obviously has no impact on the number of electrons you collect. Basically, it cranks up the value for both the signal and the noise the same amount.
Ultimately, you improve S/N by collecting more light. That means a larger aperture or a longer exposure.
Re: optimising the dull job of image stacking
Posted: Wed Oct 23, 2013 1:42 am
by Nitpicker
Chris Peterson wrote:You can't subtract noise. In fact, when you subtract a dark frame, you actually increase the noise, since both the light and dark frames contain noise, and that noise adds quadratically. We typically subtract dark frames because removing offsets and fixed pattern artifacts usually improves the image, even at the expense of a little more true noise.
True, but you can subtract signal, and if that signal exists on both frames, and that signal is considered to be noise, the effect is to remove the more offensive parts of the noise. But I take your point.
Chris Peterson wrote:Yes. The choice of ISO setting with a DSLR isn't obvious. Astronomical cameras don't typically have adjustable gain (which is what your ISO settings represent). You can frequently get better S/N using a lower ISO setting. Keep in mind that with a properly exposed image, the primary noise component is just the statistical noise on the signal itself, which is the square root of the number of photons you collect. Changing the gain of the amplifier at the output of the sensor obviously has no impact on the number of electrons you collect. Basically, it cranks up the value for both the signal and the noise the same amount.
Ultimately, you improve S/N by collecting more light. That means a larger aperture or a longer exposure.
Very useful advice. Thanks.
Re: optimising the dull job of image stacking
Posted: Wed Oct 23, 2013 2:07 pm
by stephen63
In response to your original question, adding(stacking) your exposures does not equal the sum of the exposures. It just makes for a cleaner short exposure. What taking a lot of shorter exposures DOES do is increase your SNR. Here is a link explaining just that.
http://www.astropix.com/HTML/J_DIGIT/COMPEXP1.HTM
This website has a lot of good information on DSLR astrophotography.
Re: optimising the dull job of image stacking
Posted: Wed Oct 23, 2013 2:16 pm
by Chris Peterson
stephen63 wrote:In response to your original question, adding(stacking) your exposures does not equal the sum of the exposures. It just makes for a cleaner short exposure. What taking a lot of shorter exposures DOES do is increase your SNR. Here is a link explaining just that.
http://www.astropix.com/HTML/J_DIGIT/COMPEXP1.HTM
This website has a lot of good information on DSLR astrophotography.
The only reason the summed exposures aren't exactly equivalent to a single exposure is readout noise. Without that one factor, there is absolutely no difference, either theoretically or practically. In practice, a series of stacked exposures always produces a final image with worse S/N than a single image with the same exposure time.
Re: optimising the dull job of image stacking
Posted: Wed Oct 23, 2013 2:30 pm
by stephen63
http://www.astropix.com/HTML/J_DIGIT/COMPEXP1.HTM
The formula for calculating the signal to noise increase when images are composited by averaging (adding the pixels in each image and then dividing by 2) is: n/SQR n... (n divided by the square root of n), where n is the number of negatives to be added.
Averaging two negatives together will increase the signal to noise ratio by 1.414x (2/SQR 2 = 2/1.414 = 1.414). Averaging four negatives together will result in a 2x increase in the signal to noise ratio.
Re: optimising the dull job of image stacking
Posted: Wed Oct 23, 2013 2:37 pm
by Chris Peterson
stephen63 wrote:http://www.astropix.com/HTML/J_DIGIT/COMPEXP1.HTM
The formula for calculating the signal to noise increase when images are composited by averaging (adding the pixels in each image and then dividing by 2) is: n/SQR n... (n divided by the square root of n), where n is the number of negatives to be added.
Averaging two negatives together will increase the signal to noise ratio by 1.414x (2/SQR 2 = 2/1.414 = 1.414). Averaging four negatives together will result in a 2x increase in the signal to noise ratio.
Yes, compared with the individual shorter exposures. But not compared to a single image of the combined exposure time.
In terms of S/N, it is always better to take a single exposure than to break that exposure into shorter subexposures and sum them. There are, of course, good reasons to build an image up from shorter exposures- advantages that often outweigh the reduced S/N that you inevitably get.
Re: optimising the dull job of image stacking
Posted: Wed Oct 23, 2013 3:06 pm
by stephen63
Chris Peterson wrote:In terms of S/N, it is always better to take a single exposure than to break that exposure into shorter subexposures and sum them. There are, of course, good reasons to build an image up from shorter exposures- advantages that often outweigh the reduced S/N that you inevitably get.
I think you have it backwards, Chris. First of all, you don't sum them, you average them. Be it median or mean combining the exposures. Do you normally sum them? That's the whole point of taking multiple exposures! The random noise is reduced by lowering the standard deviation in the final image. The flux of the target in question remains relatively constant so the average remains constant as well. As far as the read noise and dark current, the first step in processing is to calibrate the exposures with the master dark and bias frames. Why are you focused on noise that can be effectively removed with simple procedures? If want to image something that requires a 30 minute exposure to detect, no amount of 30 second exposures are going to capture it!
Re: optimising the dull job of image stacking
Posted: Wed Oct 23, 2013 3:18 pm
by Chris Peterson
stephen63 wrote:Chris Peterson wrote:In terms of S/N, it is always better to take a single exposure than to break that exposure into shorter subexposures and sum them. There are, of course, good reasons to build an image up from shorter exposures- advantages that often outweigh the reduced S/N that you inevitably get.
I think you have it backwards, Chris. First of all, you don't sum them, you average them. Be it median or mean combining the exposures. Do you normally sum them? That's the whole point of taking multiple exposures! The random noise is reduced by lowering the standard deviation in the final image. The flux of the target in question remains relatively constant so the average remains constant as well. As far as the read noise and dark current, the first step in processing is to calibrate the exposures with the master dark and bias frames. Why are you focused on noise that can be effectively removed with simple procedures? If want to image something that requires a 30 minute exposure to detect, no amount of 30 second exposures are going to capture it!
In terms of S/N, there is no difference between summing and averaging. It doesn't matter which you use. The average is just the sum multiplied by a constant, which affects the signal and noise equally. Median averaging results in poorer S/N compared with the sum or mean, but has the advantage that you can eliminate certain artifacts, so the S/N hit may be worthwhile.
The reason for taking multiple exposures has nothing to do with S/N. The reason is to get around poor tracking, to provide a mechanism to eliminate cosmic ray hits, airplanes, satellites, and other transient phenomena, to increase dynamic range in cases where a single long exposure would result in saturation. It does so at the cost of reduced S/N.
Calibration with darks and flats removes absolutely no noise, it only adds noise.
In the absence of readout noise, something that requires 30 minutes to "detect" will be equally captured using 60 30-second exposures summed together. But the readout noise that nearly all cameras have means that the actual number of 30-second subs will be much larger- perhaps impractically large.
Re: optimising the dull job of image stacking
Posted: Wed Oct 23, 2013 3:40 pm
by geckzilla
Coincidentally, I am messing around with four pretty bad exposures from the HLA with low S/N ratio and a crapload of cosmic rays. I'm getting some interesting results by taking four different possible combinations of pairs of them and using minimum which I presume is some kind of floor function and then creating a median stack out of those four combinations. I thought it might be a good way to recover some of the signal loss from using only a minimum stack.
Re: optimising the dull job of image stacking
Posted: Wed Oct 23, 2013 3:50 pm
by Chris Peterson
geckzilla wrote:Coincidentally, I am messing around with four pretty bad exposures from the HLA with low S/N ratio and a crapload of cosmic rays. I'm getting some interesting results by taking four different possible combinations of pairs of them and using minimum which I presume is some kind of floor function and then creating a median stack out of those four combinations. I thought it might be a good way to recover some of the signal loss from using only a minimum stack.
What software are you using? Because median processing increases noise, the method has largely been replaced with more complex stacking algorithms, which do a better job of eliminating single frame artifacts while preserving the overall S/N similar to summing. Sigma mask, sigma clip, and similar algorithms are generally better choices.
Re: optimising the dull job of image stacking
Posted: Wed Oct 23, 2013 3:53 pm
by geckzilla
Just Photoshop. I'm still using version CS4. I have no way of knowing what exactly Photoshop means by "median" exactly since it doesn't get into the actual math of things.
Re: optimising the dull job of image stacking
Posted: Wed Oct 23, 2013 3:56 pm
by stephen63
Chris Peterson wrote:
In terms of S/N, there is no difference between summing and averaging. It doesn't matter which you use. The average is just the sum multiplied by a constant, which affects the signal and noise equally. Median averaging results in poorer S/N compared with the sum or mean, but has the advantage that you can eliminate certain artifacts, so the S/N hit may be worthwhile.
The reason for taking multiple exposures has nothing to do with S/N. The reason is to get around poor tracking, to provide a mechanism to eliminate cosmic ray hits, airplanes, satellites, and other transient phenomena, to increase dynamic range in cases where a single long exposure would result in saturation. It does so at the cost of reduced S/N.
Calibration with darks and flats removes absolutely no noise, it only adds noise.
In the absence of readout noise, something that requires 30 minutes to "detect" will be equally captured using 60 30-second exposures summed together. But the readout noise that nearly all cameras have means that the actual number of 30-second subs will be much larger- perhaps impractically large.
So, that when summing the images, the signal increases linearly with number of exposures, while the noise increases more slowly, sqrt(n).
Correct?
Re: optimising the dull job of image stacking
Posted: Wed Oct 23, 2013 4:32 pm
by Chris Peterson
stephen63 wrote:So, that when summing the images, the signal increases linearly with number of exposures, while the noise increases more slowly, sqrt(n).
Correct?
Assuming the exposures are of equal length, and "n" here refers to the exposure count, yes.
Consider a single 1-minute exposure with a pixel that has a value of 100. The uncertainty of that pixel value is sqrt(100), or 10 counts. Now we could take 10 images and sum them. That pixel will now have a summed value of 1000, and the uncertainty is sqrt(1000), or 32 counts. Both the signal and the noise have increased, but the S/N as gone from 10 to 32, a marked improvement. The latter is also what you would get from a single 10-minute exposure. In terms of S/N, there is no difference, except that we aren't accounting here for readout noise, which will only have one unit in the single image, and ten units in the sum, meaning the sum image ends up with reduced S/N compared with the single image.