SGP 2.6.0.13: ASI1600 gain return to 0

Ken, many (most?) of us do set the gain and offset together. Therefore, its easier to set this in the ASCOM driver. Having just the gain setting in SGP not only makes things more complicated but when forgotten it overrides the gain setting in the ASCOM driver with zero and can ruin a night of imaging.

If you believe adding the gain in SGP is positive in some cases - fine - just give us the solution that Jared suggested and allow us to use “not set”.

1 Like

I don’t think anyone was disputing the usefulness of setting Gain. Rather it was the possibility that the new feature would change Gain silently to zero. People where discussing offset in the context of the forced gain setting because if SGP was going to force a gain change it was not synchronized with offset which is an additional argument for having a default gain value (or setting).

I understand offset is also depending on gain, in order to optimize the dynamic range and to avoid negative value.

1 Like

This is the solution to this whole discussion, A default of “Not Set” means those that those of us that set both gain and offset together can continue to use the ASCOM driver without fear of anything being overridden while those that just want to modify gain alone can take advantage of it being in SGP.

AIUI offset is set so that the black point of the CCD is sufficiently high to avoid negative values in the ADC. That being so I don’t see a reason why offset needs to be set by the user. I would expect the hardware to be able to set an appropriate offset for the gain that’s being used, or apply the offset after the gain so it isn’t affected. My Altair GPCAM works like this. I understand that the manufacturers provide offset but does the black point vary significantly with gain?

I don’t know, however, with my QHY cameras setting gain and offset is an iterative process. When you change one you have to check the other. So it does not appear to be a simple matter of setting an offset and forgetting it.

Same with the ASI1600.

My Altair GPCAM only has gain - from 100 to 1000. The black point doesn’t seem to change significantly.

With the ASI1600 they have a low, medium (unity) and high gain settings that I believe set the offset automatically. However, many of us have been testing using different gain settings than these and adjusting the offset. I think QHY cameras are the same.Here is the QHY10 manual that describes how to correctly supply the offset and gain to that camera - I think around page 22.

http://www.qhyccd.co…user manual.pdf

Luckily I had 2.6.05 still on my download file so I am back to fixed. I’ll hold off on upgrading till the gain is turned off or doesn’t affect the ascom gain. QHY has a nice set of user defined gain/offset presets, so I use those when imaging. The current gain overwriting the ascom is a big issue for me as I might do 2 sessions one for HA and another for RGB and use 2 different gain/offsets.

I don’t want to speak for the ASCOM developers who created the camera interface, BUT I have a suspicion that they decided to expose gain controls and not offset because gain is likely to vary based on binning (typically one would use lower gain values for 2x2 through 4x4) and offset will likely remain static regardless of binning.

Apparently not true as seen in the example by @hfjacinto - different offsets for different gains

Next version of SGP will have the ability to have “Not Set” for the gains. Use gains if it makes sense from SGP…use them from your ASCOM driver with Offsets if not. The choice is yours.

Thanks,
Jared

1 Like

@DesertSky

Gain is a multiplicative coefficient used to drive the CCDs preamp and offset is a linear shift away from 0 (after gain). The offset value is “just enough” to successfully shift the preamp’s multiplicative gain and the subsequent ADU conversion errors away from 0 (by rounding) and should be pretty close to the same value for all binning modes. I am honestly not sure why those values in the screen shot above are different. In a 16-bit camera, offset is expressed as a 16-bit value (0-65535). Having offset values vary by 15 or 35 ADU seems inconsequential as they both likely ensure all gain calculation have a proper amount of resolution. Offset is also not nearly as critical (unless it’s way too high)… any value that keeps all conversions “off the floor” should be sufficient. Not implying I am right, just honestly that I don’t know.

That said, given the explanation above, it makes sense to me that offset may not be exposed as a dynamic property in ASCOM cameras.

I still take the stance that, if your driver does not support setting gain dynamically based on binning mode, you will seriously want to consider using SGPro to manage it.

It will depend on if the offset is added to the signal before or after the gain is applied, it could be
(signal + offset) * gain
or
signal * gain + offset

The second is what Ken is thinking of but maybe some drivers are implementing the first. Even then this could be allowed for in the low level driver by adjusting the offset as a function of gain. I don’t think this needs to be controlled by the user.

The Gain control was added at the request of a group of CCD and application developers who had a meeting at an imaging conference a few years ago, they suggested the changes that were added for version 2 of the camera driver specification.

Thanks Chris. That’s good to know… I had not considered it, but it makes sense.

With cameras that support variable offset, the offset is in ADC counts, or camera ADU. For Chris, this would be:

Signal*Gain + Offset

The offset is added to the signal during analog to digital conversion. The offset in a shallow exposure can be very easily measured in any FITS editor.

With a variable gain camera, as you increase gain, you lose dynamic range, so it becomes important to find the optimal offset for a given gain setting, to ensure you are not needlessly throwing away dynamic range. As such, it is not really ideal to use a single offset at every gain setting. Exactly how much offset you need can also change depending on what you are filtering with…NB filters might need a bit more offset, LRGB filters under light polluted skies could add a significant skyfog offset of their own in mere seconds, so a large offset may simply be unnecessary, and could be costly in terms of dynamic range at higher gain settings. Variable offset is a means of optimizing performance, and in practice we CMOS camera users don’t use a single offset for all gain settings.

Since this value is in ADU, a single value means different things for different gain settings. At Gain 0 on the ASI1600 or QHY163, the actual conversion gain is ~4.88e-/ADU. With the ASI1600, the default driver offset is 10, which can be easily measured in a bias frame as the mean will be ~10 ADU. In contrast, at unity gain, the conversion gain is ~1e-/ADU, and the default driver offset is 21. Again this can be easily measured in a bias frame. Now, an offset of 10 ADU @ Gain 0 is representative of ~48.8e-, while an offset of 21 ADU @ Gain 0 is representative of ~21e-. The default high gain (setting 300 on the ASI) offset is 50 ADU, which at that level would be about 8-9e-.

Thing is, if we used an offset of 50 ADU at all gain settings, the actual electron count of that offset will increase, dramatically. For example, at Gain 0, an offset of 50 is representative of ~244e-. Hardly necessary, when the read noise is only 3.5e- and dark current @ -20C is ~0.006e-/s. This is particularly true for LRGB exposures…I find myself using only 30 second L exposures in my back yard, which still clips stars, so gaining back every ounce of offset that I can is useful.

AIUI what you are saying is that the sky fog adds an offset to the signal and you want to use a reduced offset to compensate for that so you get the maximum dynamic range. The offset could be enough to make unilluminated pixels negative, so recording 0 on the ADC.

What would that do to the dark frames? You obviously need to use the same gain but if you use the same offset the dark signal becomes meaningless. If you use a different offset doesn’t the dark frame become incorrect?

I have a bad feeling about using different offsets for image and calibration data, and a bad feeling about having an offset that suppresses the black point.

I’m not recommending using different offsets for calibration frames than for lights. I am also not recommending using a ZERO offset, which would indeed result in problems for the darks.