calculation of sub exposure - formula

Anything that doesn't fit into any of the other forums
GSchreider
Posts: 18
Joined: Mon Sep 20, 2021 10:37 am

calculation of sub exposure - formula

#1

Post by GSchreider »

Hi Robin,

I was working through your presentation about astrophotography and the resp. formulas for calculating sub exposure length.
I want to thank your for providing some clarity and explanations how to do this calculation. I have still some loose ends, which i would like to understand.

The final formula is basically

sub exp. length = C * RN^2 / LPR.

In this formula there is no consideration of sensor offset. Now I know of a well known discussion in cloudy nights, where Jon Rista posted a similar formula, with C fixed to 3 and 10 resp., calling it the "swamp" factor, where he added the offset value, see
https://www.cloudynights.com/topic/5976 ... try8200280

and thus the formula is

DN = C * RN^2/LPR + offset
DN is the background signal, which is apparently proportional to the exposure length

offset has to be in e
According to my understanding, if I set my sensor driver to a certain offset value, say 160, I need to find the corresponding value of e from the e/ADU curve as function of gain, since offset is a bias to gain.
Is this understanding correct ?

He has an additional factor in the formula to take the bit-depth into account 2^16/2^bit-depth,
sub exp length = ( C * RN^2/LPR + offset ) * 2^16/2^bit-depth
which I do not understand where this comes from.


Sorry to be a pain but I would appreciate if you can shed some light on this.

CS
Gernot
User avatar
admin
Site Admin
Posts: 13173
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: calculation of sub exposure - formula

#2

Post by admin »

Hi,

it looks like the formula on CN is taking a slightly different approach to the same problem - rather than calculating the required exposure directly (as my formula does), it calculates the image background level that will give you the correct exposure.

There are advantages either way - my way requires the sky brightness to be measured in units of e/pixel/second (fortunately SharpCap will do that for you). The other way doesn't require that, but it does mean that you have to take account of the offset, since the offset contributes to the background brightness, but *does not* represent electrons being captured, so you have to add it to the brightness level calculated based on electrons/read noise/gain.

The 2^16 / 2^ bit depth factor comes because the DN output of the formula from cloudy nights is in 16 bit ADU (even if the camera only has a 12 bit sensor for instance), but the e/ADU gain measurement is conventionally quoted agains true ADU (ie 12 bit ADU values for a 12 bit sensor).

The 'swamp' number is basically the 'C' in the SharpCap formula - it's worked out from how much additional noise you want to accept - 10% gives a C / Swamp number of about 10, 5% gives ~20, etc.

Of course, to me the biggest problem with the CN formula is that once you have calculated the DN needed, you have to apply a certain amount of trial-and-error to get the sub length that meets that target. If you change the gain then you have to do the same again. With SharpCap's method, once you have the sky brightness, all the exposure times can be worked out directly with no trial and error.

cheers,

Robin
GSchreider
Posts: 18
Joined: Mon Sep 20, 2021 10:37 am

Re: calculation of sub exposure - formula

#3

Post by GSchreider »

Hi Robin,

are you saying that your formula does not require the offset to be taken into account since the sky brightness is measured?
ok, that means that if the sky brightness is measured it is done with a given offset.
Then I would expect that the calculation of the sky brightness does somehow take the offset into account.
The calculation tool http://tools.sharpcap.co.uk/ seems not to do that.
What am I missing here ?

Alternatively the offset needs to be taken into account in the formula to consider the raised brightness from the chosen offset, shouldn't it ?

Cheers
Gernot
User avatar
admin
Site Admin
Posts: 13173
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: calculation of sub exposure - formula

#4

Post by admin »

Hi,

the offset needs to be taken into account when measuring the sky brightness by looking at pixel values. SharpCap does that in the Smart Histogram 'Brain' measurement function - behind the scenes it subtracts the offset level from the image data then divides by the e/ADU to get electron counts for each pixel. When you are coming at the sky brightness from the other direction (estimating from light pollution etc, like tools.sharpcap.co.uk), the offset doesn't come into it, so isn't needed.

cheers,

Robin
GSchreider
Posts: 18
Joined: Mon Sep 20, 2021 10:37 am

Re: calculation of sub exposure - formula

#5

Post by GSchreider »

Thanks for your explanations
I think I need to get my head around units to understand this better.

Cheers
Gernot
TDS
Posts: 1
Joined: Sat Apr 09, 2022 3:23 pm

Re: calculation of sub exposure - formula

#6

Post by TDS »

Can you check my math here? I want to make sure I am doing this correct:

Where I live is in a rural area. According to clearoutside.com, my sky is 20.58 Magnitude Class 4 Bortal 0.63 mcd/m^2 brightness 462.07 mcd/M^2 artificial brightness. I will be using the magnitude # cor my calculations

My camera is a ZWO ASI6200MM (mono), according to their site, these are the specs:

Gain: 100
Read noise: 1.2e
QE: 91%
Pixel size: 3.76

Telescope: f/4.9

Filter: R/G/B

When I plug those numbers into the tools.sharpcap.co.uk site, I get 1.04 e/pixel/s

C= 10 (5% extra noise)

10 * ((1.2 * 1.2) / 1.04) = 13.8 does this mean that ~14sec is the ideal sub for my set up?

When I do the same for a luminance configuration in the online tool, I get 3.11 e/pixel/s
10 * ((1.2 * 1.2) / 3.11) = 4.63 Is that really correct? 4.6 sec?

Both of those times seem REALLY short. I feel like I am doing something wrong.
User avatar
admin
Site Admin
Posts: 13173
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: calculation of sub exposure - formula

#7

Post by admin »

Hi,

yes, those numbers look right - if you work backwards from your answers, you can see that in the colour filter case, you will get about 15 electrons of sky background in each pixel (1.04 * 14s), so the noise in the sky background will be about 3.9e. Combine that with the 1.2e read noise (remember to combine noise by squaring both, adding, square root of sum), you get total noise of 4.05e, so very little effect from the read noise.

Now, that doesn't mean that you have to take 14s (or 4.6s) exposures - it just means that exposures longer than that will not help reveal more faint detail in the final stacked image. You may want to take longer exposures to keep the number of images under control!

cheers,

Robin
Cuervo
Posts: 1
Joined: Fri May 13, 2022 11:09 am

Re: calculation of sub exposure - formula

#8

Post by Cuervo »

Hi Robin,
thanks a lot for the great tools in Sharp Cap and, and for the nice explanation on the optimal sub-sexposure time.

I till have a question about this formula (sub exp. length = C * RN^2 / LPR), which I have not been able clarify my self.

The sky glow rate is given in electrons per pixel per second, and the read noise in electrons (and I guess is also measured for a pixel). Somehow I am not seeing the dimension of right-hand- and left-hand sides of the equation to match. Is there a proportionality constant that is not dimensionless, which I am overlooking?

When I follow the derivation, I am already a bit confused where one adds the sigma^2 from read noise and sky ... because of the way the Poisson noise variance contributes. For the Poisson distribution, variance and average are the same (sigma-squared = average). While this relation is ok for numbers, I find it a bit unconfortable for non-dimensionles quantities. Is there a normalizing factor somewhere hidden?

sorry for the bother, and thanks in advance,
Eduardo
User avatar
admin
Site Admin
Posts: 13173
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: calculation of sub exposure - formula

#9

Post by admin »

Hi Eduardo,

yes, it's a bit confusing - I had to think about it a lot...

Basically it comes down to the fact that anything that you apply a poisson distribution to has to be essentially dimensionless. That's because the poisson is measuring discrete events rather than a continuous scale. The quantity is just a number that happens to be counting electrons in this case. That's the only way that you can deal with the fact that the variance of the possion is equal to the mean.

As an alternative, you can fictionally assign 'units squared' to the variance of the poissson wherever it is used - ie mean = 100 electrons, variance = 100 electrons^2 - to maintain dimensional integrity when you take the square root to get the standard deviation (10 electrons in this case). If you do that, all the units work.

cheers,

Robin
JMcGee
Posts: 2
Joined: Wed Apr 12, 2023 6:25 pm

Re: calculation of sub exposure - formula

#10

Post by JMcGee »

Hi Dr Glover,

Years ago I watched presentations of your process for calculating an optimal sub-exposure. But my computing platform of choice for astronomy is Linux (on a Raspberry Pi-4), so the use of SharpCap is not an option for me. Instead I use the free and open source tool KStars. I recently developed an exposure calculator based upon your work and I'm hoping that it can be included in a future release of KStars, with full credit to you for the computation and process.

My understanding is that the N.I.N.A application has similar optimal exposure calculation based upon your work.

Please let me know if this is acceptable to you, and if so, specifically how I should acknowledge your work on this topic.

Thank you.
Post Reply