Most broadband imaging sky limited exposure calculators give an exposure time, which depends on setup and observing conditions.
This script works differently. It gives a background exposure target which depends only on detector characteristics. Whatever your optics, filters, and observing conditions, you expose just long enough to ensure that frame mean background is no less than the exposure target. By doing so you guarantee that the loss of background signal to noise ratio due to detector read noise is bounded (typically 5%).
With a fixed exposure target, exposure time depends simply on per pixel flux. Examples: add a narrower bandwidth filter, more time is needed. Add an optical extender, more time is needed. Observe in darker skies, more time is needed.
Here is an example for my camera unbinned. Input is detector read noise, gain, offset (mean of bias frame), and acceptable background SNR loss.
Mike
https://dl.dropboxusercontent.com/u/109232477/PixInsight/Scriptbox/SkyLimitedExposureTarget.0.2.zipHere is the background SNR loss due to read noise curve for my camera. Background exposure needs to be at least 1000 DN to get loss below 10%, below 5% requires about twice the exposure.