Issue with dark library

224 views
Skip to first unread message

bulrichl

unread,
Dec 1, 2024, 7:38:50 AM12/1/24
to Open PHD Guiding
I purchased a new guide camera (ZWO ASI220MM mini). Because I also use a main camera by ZWO, I connected (by cable) only the ASI220 when I generated the new PHD2 profile.

Several times I tried to generate the new PHD2 profile with the direct camera driver ("ZWO ASI Camera") selecting "ASI220 mini", and finally found out the following behavior:

I am asked whether the new camera is already connected,

1. when I click on 'yes', the pixel size (4 microns) is detected correctly, but the bit resolution is set to 8-bit, the 16-bit option is grayed out and no more selectable,

2. when I click on 'no' and manually input the pixel size, I can select a bit resolution of 16.

ad 1.:
When I capture dark frames, the resulting dark library is a 8-bit file. This is evident from the Debug Logfile, and I verified it as well by loading the dark library in PixInsight. When looping, the camera generates images with a sampling of 8 bits. This is not appropriate for guiding. Why is the 16-bit option grayed out and no more selectable?

ad 2.:
When I capture dark frames, the resulting dark library again is a 8-bit file! When looping, the camera now captures images in 16-bit (12-bit scaled to 16-bit). The camera generates images and star profiles that can be used for guiding. However, I don't understand how this combination could work: dark frames in 8-bit are not compatible with 16-bit images. Actually a dark frame subtraction executed in this way will achieve nothing.

So I conclude that this is a PHD2 issue: I am not allowed to generate a dark library as 16-bit file.

Bernd

logs:


Configuration:
Windows 10 Professional
ASCOM v7.0.2.4675
ZWO Camera Driver v3.24
ASCOM Camera Driver v6.5.26
PHD2 v2.6.13 dev5

bulrichl

unread,
Dec 1, 2024, 7:51:14 AM12/1/24
to Open PHD Guiding
Sorry, wrong link.The correct one:

Bernd

pollya...@gmail.com

unread,
Dec 1, 2024, 9:36:50 AM12/1/24
to Open PHD Guiding
Hello Bernd,
Your new link doesn't work either.
I'd suggest you use PHD2's Automatic Log File Upload as described here: https://openphdguiding.org/getting-help/
Cheers,
- Jack T

Bryan

unread,
Dec 1, 2024, 9:55:59 AM12/1/24
to Open PHD Guiding
Bernd

Based on the link URL (https://openphdguiding.org/logs/d1/PHD2_logs_XgNV.zip), you tried to use the PHD2 logging function; however both links are the the same.

Bryan

bulrichl

unread,
Dec 1, 2024, 12:16:15 PM12/1/24
to Open PHD Guiding

Bruce Waddington

unread,
Dec 1, 2024, 12:31:35 PM12/1/24
to Open PHD Guiding
I don't think this needs to be complicated.  Make sure that your guide camera is operating in 16-bit mode, then use the 'Darks' menu to build a new dark library.  As long as you continue to use that configuration profile going forward, things will be fine unless the camera driver reverts to 8-bit mode for some reason. 

Bruce

bulrichl

unread,
Dec 2, 2024, 12:08:57 PM12/2/24
to Open PHD Guiding
Hi Bruce,

Generating a new dark library indeed solved the issue. However, I think there are two flaws in the New-Profile-Wizard:
1. 16-bit pixel sample format cannot be selected when the user confirms that the camera is already connected and
2. the dark library that is generated by the wizard always has 8-bit pixel sample format.
Anyway, I know how to proceed now. Thank you very much for the hint.

---

Regarding determining an appropriate gain value for guiding with the ZWO ASI220MM Mini, I did the following (maybe this information is useful for other users of this camera):

When the direct camera driver is used, the New-Profile-Wizard sets a gain of 58 % in PHD2 which translates to a gain setting of 348 according to ZWO's gain setting scale. That seemed pretty high to me, considering the graphs published by ZWO ( https://www.zwoastro.com/product/zwo-asi220mm-minimono/ ) and the rather high, apparently fixed offset of about 3200 ADU. I analyzed a guiding image (guide scope focal length: 355 mm, aperture: 60 mm, PHD2 gain: 58 %, exposure time: 2 s) saved with the File > Save Image... command. The saturation signal was 65520 ADU. It is important that this value is input (in PHD2: Guide > Advanced Settings, Camera tab, section Star Saturation Detection) in order that PHD2 is enabled to identify saturated star cores correctly. The image was solved with PixInsight's ImageSolver script and annotated with the AnnotateImage script:

2024_11_30_GuidingFrame_Annotated.jpg

With the above settings, 319 pixels had a signal > 65519 ADU. 296 pixels were saturated in the 21 identified stars in the annotation:

Sat. px. Name Vis. brightn. [mag] B-V
1 TYC47-64-1 11.50 0.17
53 TYC47-70-1 *  9.20 1.598
64 TYC47-690-1 *  7.62 0.331
90 TYC47-708-1 * 10.26 1.275
1 TYC47-880-1 12.10 0.842
3 TYC47-1021-1 11.55 0.51
- TYC47-1141-1 12.52 -0.365
5 TYC47-1504-1 11.23 1.029
3 TYC4699-15-1 11.38 0.986
4 TYC4699-28-1 10.97 0.833
- TYC4699-76-1 11.76 0.425
8 TYC4699-89-1 10.95 0.91
1 TYC4699-135-1 11.82 1.369
20 TYC4699-305-1 *  9.02 0.485
5 TYC4699-344-1 11.04 0.893
5 TYC4699-351-1 11.02 0.799
13 TYC4699-454-1 *  9.62 0.561
7 TYC4699-518-1 10.91 0.468
5 TYC4699-577-1 11.18 0.85
4 TYC4699-775-1 11.60 0.391
4 TYC4699-933-1 11.66 0.629

296 Sum

(Visual brightness and B-V index according to Cartes du Ciel)

In my view, the starred stars are not useful for guiding at all. Due to this result, I lowered the gain in PHD2 to 42 % corresponding to a gain setting of 252 according to ZWO's gain setting scale, and a new dark library was generated. Unfortunately it is cloudy these nights, so I cannot test momentarily what this change effects.

Bernd

Bruce Waddington

unread,
Dec 2, 2024, 2:59:53 PM12/2/24
to Open PHD Guiding
Well, I think the primary problem here is that you still don't understand how these things work.  There is no code in the mainstream parts of PHD2 that set the bit-depth of the camera - not in the profile wizard, the Advanced Settings, or the code for creating dark libraries or bad-pixel maps.  You, the user, are expected to get that set correctly using whatever tools are available to you - property dialogs, ASCOM user interfaces, whatever.  For many guide cameras, the bit-depth is just a basic property of the device and is what it is.  Therefore, you must be sure that the camera is operating in the mode you want before you run build a dark library - whether that's in the profile wizard or via the 'Darks' menu.  If that's not convenient to do while using the wizard, the building of the dark library can be done later - that's why it's an elective action. Because of my first point,  the profile wizard doesn't  let you change the bit depth of an already connected camera - and the camera was at that point running in 8-bit mode.  By extension, if you had put the camera in 16-bit mode beforehand, you wouldn't have been able to change the UI option to 8-bit, and the dark library you elected to build would have been 16-bit.

I would agree this is a bit complicated and it's difficult to communicate all this in the limited context of a user interface. 

Bruce

bulrichl

unread,
Dec 2, 2024, 4:59:52 PM12/2/24
to Open PHD Guiding
I have never entered a gain value of 58 % in the PHD2 menu. However, the following passage always appears in the debug log file when connecting the camera:

------------------------------------------------------------------------------
10:46:53.975 00.092 11968 GetBoolean("/Update/enabled", 1) returns 0
10:46:53.977 00.002 11968 GetInt("/Update/series", 1) returns 0
10:47:05.143 11.166 11968 GetInt("/profile/1/camera/ZWO/bpp", 16) returns 16
10:47:10.852 05.709 11968 GetString("/profile/1/indi/INDIcam", "") returns ""
10:47:16.324 05.472 11968 GetInt("/profile/1/camera/ZWO/bpp", 16) returns 16
10:47:18.529 02.205 11968 GetString("/profile/1/indi/INDIcam", "") returns ""
10:47:19.573 01.044 11968 gear_dialog: OnButtonConnectCamera
10:47:19.576 00.003 11968 gear_dialog: DoConnectCamera [ZWO ASI Camera]
10:47:19.578 00.002 11968 Status Line: Kameraverbindung aufbauen...
10:47:19.585 00.007 11968 GetString("/profile/1/cam_hash/8d44cd37/whichCamera", "") returns ""
10:47:19.587 00.002 11968 Connecting to camera [ZWO ASI Camera] id = []
10:47:19.595 00.008 11968 ZWO: SDK Version = [1, 30, 0, 0]
10:47:19.602 00.007 11968 ZWO: find camera id: [], ncams = 1
10:47:19.897 00.295 11968 ZWO: using mode BPP = 16
10:47:19.899 00.002 11968 ZWO: usb3 = 0, is_mini = 1, name = [ZWO ASI220MM Mini]
10:47:19.901 00.002 11968 ZWO: selecting snap mode
10:47:19.903 00.002 11968 ZWO: IsColorCam = 0
10:47:19.905 00.002 11968 ZWO: supported bin 0 = 1
10:47:19.907 00.002 11968 ZWO: supported bin 1 = 2
10:47:19.913 00.006 11968 ZWO: gain range = 0 .. 600
10:47:19.915 00.002 11968 ZWO: lowest RN gain = 350 (58%)
10:47:19.916 00.001 11968 ZWO: frame (0,0)+(1920,1080)
10:47:19.941 00.025 11968 GetDouble("/profile/1/camera/pixelsize", 0.000000) returns 4.000000
10:47:19.943 00.002 11968 DoConnectCamera: reconnecting=0 warningIssued=0 lastCam=[ZWO ASI Camera] scaleRatio=1.000
10:47:19.945 00.002 11968 Connected Camera: ZWO ASI220MM Mini
10:47:19.947 00.002 11968 FullSize=(1920,1080)
10:47:19.949 00.002 11968 PixelSize=4.00
10:47:19.951 00.002 11968 BitsPerPixel=16
10:47:19.953 00.002 11968 HasGainControl=1
10:47:19.954 00.001 11968 GuideCameraGain=58
10:47:19.956 00.002 11968 HasShutter=0
10:47:19.958 00.002 11968 HasSubFrames=1
10:47:19.960 00.002 11968 ST4HasGuideOutput=1
10:47:19.961 00.001 11968 GetBoolean("/profile/1/camera/AutoLoadDefectMap", 1) returns 1
------------------------------------------------------------------------------

Please explain where this information:
> ZWO: lowest RN gain = 350 (58%)"
> ZWO: gain range = 0 .. 600
comes from. In any case, I have not entered it.

Bernd

Bruce Waddington

unread,
Dec 2, 2024, 10:15:43 PM12/2/24
to Open PHD Guiding
We don't want to get into explanations of everything you might find in a debug log file.  That file is for the developers and for customer support.  What you're seeing here is simply a record of default settings being used for the camera.  If you want to change the gain, you should use the Advanced Settings dialog and always exit it with the 'Ok' button.  The UI control reflects a percentage of the supported range of gains for the camera, not a literal, device-level gain level.  For your camera, a PHD2 gain setting of 58% corresponds to a device gain level of 350 which also corresponds to the point of lowest read noise.  That's why it's chosen as the default value.  When you open the Advanced Settings dialog, the UI will tell you what the percentage gain setting is - the default or whatever value you've changed it to.

I think you should focus on learning how to use PHD2 and getting the settings you want for your gear rather than prowling around in the debug log file.  Obviously, you are free to examine the debug log file but you will then need to study the source code to understand what it all means.

Bruce

bulrichl

unread,
Dec 3, 2024, 4:30:10 AM12/3/24
to Open PHD Guiding
> Well, I think the primary problem here is that you still don't understand how these things work.
Yes, and this misunderstanding is  preprogrammed in the truest sense of the word. In the New Profile Wizard, I am asked which sampling shall be applied, and I chose 16-bit. So for what reason should I expect that my selection will not be respected when directly afterwards (still in the New Profile Wizard) the camera is automatically connected and the dark frames are captured? This is counterintuitive.

Since apparently there is no willingness to change this behavior, I can only advise those who are starting up PHD2 for the first time or are operating a new guide camera: avoid using the New Profile Wizard. Strange.

Bernd

Dale Ghent

unread,
Dec 3, 2024, 3:18:49 PM12/3/24
to open-phd...@googlegroups.com

Reading back through this thread, I think there are some valid points that can warrant an examination of the setup process. For example, if a camera is capable of both 8 and 16 bit output, 16bit (or whatever is the highest advertised) should be preferred.

I've also seen some friction around the gain being prescribed as a percentage. This one trips a lot of people up where they don't know that:

1) it's a percentage, not an absolute number or gain value, but I've found folks (including myself) putting numbers in there as if it weren't a percentage.
2) they don't know what the range of possible gain values are, so divining an appropriate percentage value of that is not possible unless one scrutinizes the debug log.

I can kind of understand why percentage was chosen back in the early-early days of PHD2. But with sensors with multiple gain domains and offsets and whatnot now, I think that form of configuration is too vague and cumbersome.

I do have some ZWO guide cameras so I can at least take a look at the 8/16bit issue but the gain value being a percentage is a far larger change to the app that affects everyone.

> On Dec 3, 2024, at 04:30, 'bulrichl' via Open PHD Guiding <open-phd...@googlegroups.com> wrote:
>
> > Well, I think the primary problem here is that you still don't understand how these things work.Yes, and this misunderstanding is preprogrammed in the truest sense of the word. In the New Profile Wizard, I am asked which sampling shall be applied, and I chose 16-bit. So for what reason should I expect that my selection will not be respected when directly afterwards (still in the New Profile Wizard) the camera is automatically connected and the dark frames are captured? This is counterintuitive.
> --
> You received this message because you are subscribed to the Google Groups "Open PHD Guiding" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to open-phd-guidi...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/open-phd-guiding/bf7174af-2d21-46b0-99bd-08d56f8dd24fn%40googlegroups.com.

Message has been deleted
Message has been deleted
Message has been deleted

bulrichl

unread,
Dec 5, 2024, 11:25:55 AM12/5/24
to Open PHD Guiding
Thank you for supporting my point of view, Dale.

---

No clouds last night. So I was able to compare guide images captured with a PHD2 gain of 58 (= ZWO gain setting of  348, captured at November 30) and PHD2 gain of 42 (= ZWO gain setting of 252, capture at December 3):

GuidingFrame_ASI220_gain348.jpg

GuidingFrame_ASI220_gain252.jpg

The histograms show the main difference, I think they speak for themselves. The direct benefit of lowering the gain is a substantial increase of star SNR values which improves the guiding performance. Probably there is room for further lowering the gain setting.

With lower gain setting, offset could be also decreased in order to expand the usable signal range. Unfortunately I was not able to set the offset value of the ASI220, neither using the direct nor the ASCOM camera driver. Offset strangely seems to be fixed at 200, resulting in a median of about 3200 ADU in dark frames. If anyone is aware of how to set offset values of < 200 with this camera, please advise. For a gain of 252, I would like to use an offset of 125.

Bernd
Reply all
Reply to author
Forward
0 new messages