New Script: Calculate Sky Limited Exposure

seanhoughton

Active member
Here's my first go at a PixInsight script.  It collects the information from a test image and gives you a suggested sub-exposure length at which point the read noise is low enough relative to sky noise that it makes sense to stop and take another sub-exposure.  The background and calculations are detailed in this paper.

SkyLimitedExposure.png

Currently it doesn't handle DSLR images well I use data from the FITS header that isn't present in converted DSLR raw files.  The script uses the FITS information for most of the calculations with the exception of read noise which comes from the camera presets list.
 

Attachments

  • CalculateSkyLimitedExposure.js
    17.9 KB · Views: 280
Sean,

thank you for this very useful tool!
But it doesn't seem to work for me: see screenshot.
A couple of things:
1. I have an FLI ML8300, which is not present on the list
2. The FITS were captured in Maxim DL v5.09

 

Attachments

  • Screen shot 2010-11-28 at 12.06.16 PM.jpg
    Screen shot 2010-11-28 at 12.06.16 PM.jpg
    100.9 KB · Views: 235
Thanks for the feedback,

It looks like some fields are missing in the FITS header for your image.  I captured most of my images in MaxIm DL 5.x and it worked; I'm using an ST-8300M. It's possible MaxIm is not populating the FITS header the same way for each camera.  Are you using a processed test image?

The fields that need to be present in the FITS header are:

  • CWHITE
  • PEDESTAL
  • EXPOSURE
  • EGAIN
  • XBINNING


I'm going to re-work the script so that you can enter in every value manually if the FITS header or preset list is incomplete.  In the meantime you can manually add them to your test image using the File -> Fits Header dialog.  From what I've read online your camera should use:

CWHITE: 25667 (although it seems like it should be 65535)
PEDESTAL: 0
EGAIN: 0.4

The read noise is 7.59

(source http://www.narrowbandimaging.com/images/u8300_ml8300_ptc_dtc_comparison.pdf)
 
Hi Sean,

Well done on the script, it certainly looks interesting. If you are going to rework the script so you can manually enter certain bits of data...will this mean it can be used by DSLR users? (I'm one of them  ;) ).

Cheers
        Simon
 
Hi Sean

The script doesn't work for me

I'm using a QSI583 with Maxim 5.09

Running PI on Windows7 64-bit

Nigel
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    104.8 KB · Views: 135
Ok, here's version 0.2.  I rely more on the presets now and less on the FITS header so it should work better for everyone who doesn't have the exact same camera as me  ;)

New features:

  • Manual entry of every field
  • Better UI layout
  • Canon DSLR camera presets

Also, please double check my preset numbers for your camera.  I'm using values from various places on the interweb and errors are always possible.

SkyLimitedExposure-0.2.png
 

Attachments

  • CalculateSkyLimitedExposure.js
    20.6 KB · Views: 115
Hi Sean,

good work. This weekend I was thinking on another possibility for this script... It would be a direct measure of bias and light frames.

In the utility script section you have a script for evaluating the noise of one image (NoiseEvaluation). The idea would be:

- Load a bias frame and analyse the noise.
- Load a preview of the light frame containing a background sky area. Then analyse the noise.

From the ratio between noise intensity in the two frames you can calculate the appropriate exposure time.

The main advantage I see here is that maths are very simple: just copy and paste the NoiseEvaluation script. :)


Regards,
Vicent.
 
Hi Sean,

Quick question: Will this script give sensible results if I am giving it a RAW image from a Canon camera taken with an Halpha filter, i.e. so that the green and blue channels are effectively just noise?

Or should I extract just the red channel and use that with the script?

Cheers
        Simon
 
Update: I've just tried the script with an Halpha RAW and then again with only the red channel extracted.....both gave exactly the same results. So that seems cool!  ;)
 
Sorry...its me again!

I have a Canon 400D. I have found that the gain is 2.74 e/ADU at ISO400. ( http://astrosurf.com/buil/eos40d/test.htm ) How do I estimate the gain at ISO1600? Is it 2.74 divided by 4?

I have also found out that the readout noise is 7e at ISO400. Does the readout noise stay roughly constant with ISO? If not, how do I estimate it at ISO1600?

Any help would be really appreciated.

Cheers
        Simon
 
Hi Simon, I think your math is correct for the gain.  You are correct about the gain at different ISO values, to quote another page on the astrosurf site...

http://astrosurf.com/buil/50d/test.htm

Code:
For compute the inverse electronic gain at XXX ISO "sensitivity" use the relation: gain_XXX ISO = (400 ISO/XXX ISO) x gain_400 ISO. For example, the inverse electronic gain of 50D at 100 ISO is 400/100 x 0.57 = 2.28 electrons/ADU.

So basically twice the ISO means half the [inverse electronic] gain.
 
Hi Sean,
I have just downloaded version 0.2 and this is what is happening to the window:
 

Attachments

  • Screen shot 2010-11-29 at 8.53.40 PM.png
    Screen shot 2010-11-29 at 8.53.40 PM.png
    56.6 KB · Views: 141
Just drag the sizer in the lower right corner a bit and it will pop to the correct size.  I'm not sure why this is happening, it happens to me when I use the script on my laptop, but not on a 30" monitor.  It has something to do with the vertical size of the screen.  I left the dialog as "sizable" instead of the convention of preventing resizing to work around this problem.

If any other script developers know what's going on let me know  :-\
 
Thanks Sean. Works fine now  :)

I am not understanding something though: I image from 6800ft, at a location where we have a 21.5SQM skies.
And the ExposureCalculator is telling me that the suggested exposure should be 53 seconds?

How is that possible?
 
Hmmm. Not really. ;)

The ML8300 has so low noise (7.59e) that darks are not necessary. I actually don't know of anyone with an ML8300, who takes darks.
 
Using a dark image will reduce the median background value which will give a more correct value for "sky noise", but this is assuming that the dark noise is big enough to be significant.

You could manually run your numbers through the formulas given in the linked paper and see if you come up with the same results.  It's possible there is an error in the script, but I've never written code with a bug in it before*.



* this statement is completely untrue.
 
Hi Sean,

I'm confused (not for the first time!). If I set the Gain and the Readout Noise at the values I've determined from the literature (see below), then if I decrease the MaxADUCount down to 4096 (I have a 12bit DSLR  :sad: ) then the recommended exposure time goes up. This is what surprises me. If you have a given number of ADU per electron, and you increase the number of ADU, then surely you need longer to fill the available ADU? I couldn't find anything on the maximum ADU count in the paper. Have I missed something or got the wrong of a stick?

Values for Canon 400D ISO 1600: Gain = 0.635, ReadOutNoise = 4.3

And I worked out that for the Canon 400D, ReadOutNoise = (1550/ISO) + 3.3 ....which might be of help or might not.

Cheers
        Simon
 
Hi Simon,

The pixel values that PixInsight gives me are normalized (i.e. a percentage of the max count) so in order to convert them back to ADU values I have to multiply them by the maximum ADU value for your sensor.  If you use an incorrect value it breaks the conversion from ADU to electrons.  You are close, but the max ADU value is (2^bits)-1, or 4095 for a 12 bit device, remember that "0" counts as a number too :).

I'll add some presets for more Canon cameras this evening.
 
Back
Top