Sub-exposure planning from your own frames
SubExposureCalculator
A guided PixInsight script that measures your camera and your sky directly from raw frames, then suggests how long your sub-exposures should be, and shows you why.
The idea
Read noise stops mattering at some length
Every sub carries the same read noise, whatever its length. A longer sub lets the sky signal grow until the read noise is a small part of the total. The ratio m tells you where you are. There is no single optimum, and total integration time matters far more than sub length.
m = S / R²S is the sky signal per sub and R the read noise, both in electrons.efficiency = √( m / (m + 1) )Compared with one single long exposure.t = m × R² / PSub length for a chosen m, where P is the sky rate in electrons per second.
What it does
It measures instead of asking you to type numbers
Works for mono cameras and for one-shot-colour cameras, where red, green and blue are measured separately.
Your camera, once
Read noise, bias level and conversion gain, measured from raw bias and flat frames and saved in a camera list. Later runs only read your light frames.
Your sky
The background rate in electrons per second, through each filter, from your own light frames. Exposure time and filter come from the FITS header.
A sub length to use
One suggestion per filter, rounded to a sub length you would actually set. A colour camera gets a single exposure that serves red, green and blue.
| Frames | How many | Notes |
|---|---|---|
| Bias | 2 or more | Single frames at the shortest exposure, sensor covered. Not a master bias. |
| Flats | 2 or more, optional | Taken back to back, through any filters. Used to measure e⁻/ADU. Without flats you type the value. |
| Lights | 1 or more | Ordinary subs of any target. |
All frames must be raw: straight from the camera, not calibrated, not debayered and not stacked, and all at the same gain, offset and binning.
A closer look
It shows what each number rests on
A suggestion is only useful if you can see where it comes from. Three windows do that. The pictures are real captures from PixInsight.
A suggestion, as an honest range
The time depends on the read noise squared, and a sensor has two read noise figures: that of a typical pixel and that of all pixels, noisy ones included. The script works out both and shows the range between them.
- One curve per channel: how much of the ideal signal-to-noise ratio a stack keeps at each sub length.
- The gold band is the suggestion. Where the curves flatten, longer subs stop paying.
- For a colour camera the channel with the weakest sky sets the time.
Where the background was read
The sky background decides everything else, so the script shows it across the frame, tile by tile, with the tile that set the reading outlined.
- By default it finds empty sky on its own, even when a nebula fills much of the frame.
- Or draw a preview on a patch of sky you trust and use that instead. The map then shows your rectangle next to what the tiles would have read.
- You see where the nebula lies and how much the corners darken.
Measure a camera once, from as many frames as you like
Bias level, read noise and gain belong to a camera at one gain, offset and binning, not to a night. Measure them once and pick the camera from a list afterwards.
- Frames are used in pairs and the median is taken, so one bad frame or a cosmic ray hit cannot move the result.
- Flats through any mix of filters count towards one gain, and the gain per filter is shown as a check.
- A camera can be exported to a small file and imported on another computer.
- 12 and 14 bit cameras. Data stored scaled to 16 bit is detected and measured in the camera's own steps, which keeps faint sky rates accurate.
- Moon and Sun. Every frame is logged with the Moon's phase, its altitude and its distance from the target, so you can build your own table of sky brightness.
- CSV export. Every measured value per frame and channel, including how the background was found.
- Nothing leaves your computer. The script makes no network connections. It writes only the files you ask for, and keeps its settings and camera list inside PixInsight.
Install
Add the repository, then check for updates
-
In PixInsight choose RESOURCES > Updates > Manage Repositories, click Add and paste this address, including the final slash:
https://pixinsight.fmsoftware.dev/ - Choose RESOURCES > Updates > Check for Updates and apply the update.
- Restart PixInsight. The script is now at SCRIPT > Utilities > SubExposureCalculator, and later versions arrive through the same update check.
The repository is not signed yet, so PixInsight may show a warning before installing. To run it without the update system, download the script file and use SCRIPT > Execute Script File….
Status
Version 1.0.2: new, and still gathering field testing
The calculations are tested against simulated frames with known read noise, gain and sky rate. The script has been run in PixInsight on macOS with a ZWO ASI2600MC Pro. Other cameras and platforms have had little use so far. If something does not work, please open an issue.