Jump to content

Banner.jpg.b83b14cd4142fe10848741bb2a14c66b.jpg

Stacking by addition


Guest

Recommended Posts

For the purpose of photometry suppose I want to limit my exposure time to say 20 seconds in order to minimize trailing but I want an overall exposure time of say 60 seconds. If I take 3 x 20 second subs does it make any difference if I stack them by addition or stack taking the median. Are they equivalent? They'd obviously have to be aligned before stacking.

Cheers

Steve

 

Link to comment
Share on other sites

Median stacking is more robust against outliers such as cosmic ray hits or satellite trails, though you should still reject any which pass within the aperture radius around the target and its comparisons. The benefit comes from getting a better sky estimate.

Average or summing (almost identical) gives a somewhat better SNR than median for an identical set of subs.

I tend to use 30s subs. except for extremely bright stars which saturate the detector at that integration time.  For faint objects there could  be over a hundred subs.

Can give a report about my pipeline going from a set of subs to a report suitable for submission to BAA-VSS if you wish. My code runs under Linux but see no real reason why it should be successful under Windows or MacOS.

Link to comment
Share on other sites

Addition vs average is going to differ only by multiplicative constant. Average / mean is really sum divided by number of samples.

SNR does not change when you multiply everything with a constant since SNR is ratio (A/B = A*C / B*C)

Median should really be used with larger number of samples and even then Kappa-Sigma clip is better way of dealing with outliers.

Link to comment
Share on other sites

1 hour ago, woodblock said:

Thanks, I'd be interested to see your report. How would you send it?

 

An outline here and a tarball of the software attached.  Give me time to get my act together.

Link to comment
Share on other sites

On 23/02/2021 at 14:41, vlaiv said:

Addition vs average is going to differ only by multiplicative constant. Average / mean is really sum divided by number of samples.

Only provided you preserve the  precision in the result.  For example averaging a series of 16 x 8 bit images to produce an 8 bit precision result is not the same as summing them and expressing the result to 12 bit precision

Link to comment
Share on other sites

35 minutes ago, robin_astro said:

Only provided you preserve the  precision in the result.  For example averaging a series of 16 x 8 bit images to produce an 8 bit precision result is not the same as summing them and expressing the result to 12 bit precision

You are right - but selection of the storage / transport format should not be considered part of stacking process.

Link to comment
Share on other sites

1 minute ago, vlaiv said:

You are right - but selection of the storage / transport format should not be considered part of stacking process.

Yup. Saving as 32-bit floating point FITS images is a good trade-off between precision and range in my experience.

Link to comment
Share on other sites

4 minutes ago, Xilman said:

Yup. Saving as 32-bit floating point FITS images is a good trade-off between precision and range in my experience.

Indeed - 32bit floating point is actually quite enough for almost any astro related processing.

I advocate converting to 32bit format as soon as processing starts - early in calibration and keeping that all the way to the end.

At one point, I was afraid that even 32bit format is not going to be enough with modern CMOS sensors and plenty of short exposures - and that would be true for 32bit fixed point format - luckily floating point format, although it uses only 24bits of precision, is more than enough, as it can store vast ranges between numbers (32bit fixed point has more precision bits but dynamic range on set of numbers is also limited to 32bits - not so with floating point).

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

In general taking the median value brings more noise to the signal compared with average (mean).  For photometry average (mean) will be better.

Assuming you want to avoid trailing the median value will ignore a part of the signal especially around the stars because they move around.

Han

  • Like 1
Link to comment
Share on other sites

2 minutes ago, han59 said:

In general taking the median value brings more noise to the signal compared with average (mean).  For photometry average (mean) will be better.

Yes but. It depends. If the SNR is high enough, median can allow for better sky estimates. The median stack is undoubtedly noisier, but not by a huge amount.

If the SNR is very low, perhaps only 3 for bare detection (i.e. astrometry, not photometry) then every last bit of SNR is worth having and so summing or averaging is definitely the way to go.

As long as you keep all the subs it is straightforward to experiment with what does best in various circumstances. Binning or other forms of smoothing, with or without background removal, can also be helpful on occasion when making quantitative measurements.

Link to comment
Share on other sites

A practical test would be interesting.  Just see what the photometric standard deviation is for a reference/check star over a longer period.  Any long image series will do.  I have no problem to measure the standard deviation,  but I don't have a program which can stack median.

Lets say you have 60 images from one night. Create 20 images using median and 20 images using mean from  image 1,2,3 and 4,5,6.... sorted in observation time.

Han

 

Link to comment
Share on other sites

10 minutes ago, han59 said:

A practical test would be interesting.  Just see what the photometric standard deviation is for a reference/check star over a longer period.  Any long image series will do.  I have no problem to measure the standard deviation,  but I don't have a program which can stack median.

I use SWarp, which has a number of different stacking modes.

Link to comment
Share on other sites

3 hours ago, Xilman said:

As long as you keep all the subs it is straightforward to experiment with what does best in various circumstances. Binning or other forms of smoothing, with or without background removal, can also be helpful on occasion when making quantitative measurements.

The problem with binning/smoothing/stacking is you can reduce the contrast of any outliers making them more difficult to spot. In many (most?) measurements it is the systematic errors which limit accuracy and outliers add systematic errors which are much more insidious and difficult to recognise compared with any effect of slightly lower SNR. (A hot/cold pixel moving in and out of the aperture can look a lot like an eclipsing variable!)  Ideally it is better to analyse the subs separately, dealing with any outliers at this stage eg with a sigma clip (or if present in all of them with a bad pixel map)

Cheers

Robin

Edited by robin_astro
  • Like 1
Link to comment
Share on other sites

18 minutes ago, robin_astro said:

systematic errors which are much more insidious and difficult to recognise compared with any effect of slightly lower SNR

A favourite tweet from one of the ASAS-SN team, Though when looking at some of the differences between observers in the variable star databases, I sometimes wonder if it should be an elephant  (as in the room) 

 

Link to comment
Share on other sites

44 minutes ago, robin_astro said:

 Ideally it is better to analyse the subs separately, dealing with any outliers at this stage eg with a sigma clip (or if present in all of them with a bad pixel map)

Seconded!

Link to comment
Share on other sites

For the purpose of photometry one would be looking to improve the output SNR. Your best estimate of the signal in the noise will be the expected value of the signal (please see expected value / statistical expectation) this will be the average value i.e. sum/total. This works because the average value of the noise is zero. The improvement in SNR is sqrt(number of samples averaged) in this case one may expect an improvement of 1.7321. Perhaps you may try 4 exposures of 15s for a 2:1 improvement in SNR.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.