Log in

View Full Version here: : Any Math gurus out there?


Stonius
29-11-2018, 04:06 PM
I'm trying to model the relationship between Gain and e-/ADU of my camera.

I've got the data, and got the solution, I just can't make it work in a spreadsheet without it throwing an error.

For my ASI 1600, the line is exponential.

The formula for the relationship can be seen at the bottom of the second graph Superscript doesn't work so well on here, but it's

y=Ae^Bx

For the life of me I can't get it to work.

I take it the 'e' is for scientific notation, which means *10^n

But in this case, does Bx replace the n?

Can someone tell me how you'd write this so it actually works in a Google Docs Spreadsheet?

Thanks math geniuses (of which I am not one)

Markus

gjr80
29-11-2018, 04:19 PM
I suspect in this case e is the mathematical constant that natural logarithms are based on. Assume you are using an excel compatible spreadsheet, if so have a look at the EXP() function.

Gary

julianh72
29-11-2018, 05:21 PM
As Gary says:

e is the base of natural logarithms = approximately equal to 2.71828
https://en.wikipedia.org/wiki/E_(mathematical_constant)

Spreadsheet packages have an EXP() function, so you should code your expression as follows:

=4.96*EXP(-0.0118*REF)

where "REF" is the cell address of the x value.

Note: you might want to display the curve-fit expression with more significant figures - the 4.96 could be anywhere between 4.955 to 4.9649, and the 0.0118 could be any value between 0.01175 and 0.011849. You might need to carry more than 3 significant figures in your expression to get a good fit. (This may or may not matter with your particular data set.)

Stonius
29-11-2018, 06:00 PM
Thanks for the pointers. Thanks to you I got it working.

For those interested, what you actually put in a spreadsheet to get it working is =a*e^(b*x)

...replacing the terms where necessary.

It will give you the system gain of your camera in e-/ADU based on the driver gain setting (I did something similar for the offset V's gain thing so I could calculate intermediate values, then figured out that it saves you at best 1% of dynamic range).

To do this for your camera, take some measurements as per Craig Stark's instructions (https://www.cloudynights.com/articles/cat/column/fishing-for-photons/signal-to-noise-part-3-measuring-your-camera-r1929)

Once you have the system gain figured out for a number of gain settings, you can model it using the above formula. Or if you like, you can just use the data points they give you; 139 = unity, etc, - but by measuring I've found out that even these are wrong. My true Unity Gain setting is more like 135.

I don't find GoodleDocs spreadsheets are very accurate with the regression, so I used this site (https://keisan.casio.com/exec/system/14059930973581) to get the values for the formula to 11 decimal places. Copy and paste the data series into the site and it will give you the formula above and the values for A and B in the formula.

e, as mentioned is a logaritmic constant equal to 2.71828... and x is the camera driver gain setting.

Hope that helps some interested people and doesn't bore the disinterested people too much.

Cheers
Markus

Stonius
29-11-2018, 06:05 PM
Thanks Gary, just saw your reply.

Not sure why but what I ended up doing seems to be the same as your method up to 5 decimal places, after which they diverge slightly.

But as the math gurus concurr, I'll forge ahead using EXP in the form

=A*EXP(B*x)

Many Thanks, guys, I appreciate it.

Markus

Stonius
30-11-2018, 12:11 AM
I might also add that your best-fit regression line may have a different formula than the above. It depends on the data you feed it.

I added some more data points and now the best fit line is of the form y=ABx

Why? I don't know. The Math Gods declared it to be so.

M