Resolved Bug in Guider scripting found

Discussion in 'Scripting and Programming' started by DaveLane, Jul 5, 2017.

  1. DaveLane

    DaveLane Cyanogen Customer

    Joined:
    Sep 6, 2016
    Messages:
    21
    Location:
    Halifax, NS
    In my attempt to get two imaging cameras working at the same time (with the same MaxIM DL configuration) using the Guider interface, I have found a show stopper bug. I have been using MaxIM for nearly 20 years - not common to find a bug! (yes, using current version of MaxIM)

    Essentially if your "imaging" camera is smaller than your "guider" camera, you run into troubles. What happens is the size of the guider camera is limited in the X dimension to no larger than the CameraXSize of the main camera. The Y axis seems ok. If you set binning at 2 for the guider camera, the X dimension is limited at 1/2 the CameraXSize of the main camera.

    I have included a script at the bottom of this message that demonstrates the problem, using two camera simulators, but the problem is also there with real cameras. Before running the test setup the test cameras as:

    - setup camera 1 as simulator: 1024x1024
    - setup camera 2 as simulator: 2048x2048

    When you run it, you get:

    C:\bgo\arap>cscript maximtest.vbs
    Microsoft (R) Windows Script Host Version 5.8
    Copyright (C) Microsoft Corporation. All rights reserved.

    Main camera - set full frame with binning= 1 x 1
    CameraXSize= 1024
    CameraYSize= 1024
    BinX= 1
    BinY= 1
    StartX= 0
    StartY= 0
    NumX= 1024
    NumY= 1024

    Guider camera - binning= 1
    GuiderBinning= 1
    GuiderStartX= 0
    GuiderStartY= 0
    GuiderNumX= 1024
    GuiderNumY= 2048

    C:\bgo\arap>​

    If you change the imaging camera's size, the guider's size follows the new value.

    And with binning set to 2 for guider camera:

    C:\bgo\arap>cscript maximtest.vbs
    Microsoft (R) Windows Script Host Version 5.8
    Copyright (C) Microsoft Corporation. All rights reserved.

    Main camera - set full frame with binning= 1 x 1
    CameraXSize= 1024
    CameraYSize= 1024
    BinX= 1
    BinY= 1
    StartX= 0
    StartY= 0
    NumX= 1024
    NumY= 1024

    Guider camera - binning= 2
    GuiderBinning= 2
    GuiderStartX= 0
    GuiderStartY= 0
    GuiderNumX= 512
    GuiderNumY= 1024

    C:\bgo\arap>​

    Interestingly, if you swap the cameras in the GUI, you get the opposite - the guider Y dimension is limited to the size of the other camera.

    --- Dave
    Director BGO

    --->>>

    Dim cam ' "The" Camera object

    Set cam = CreateObject("MaxIm.CCDCamera")

    cam.DisableAutoShutdown = True

    cam.LinkEnabled = True
    if Not cam.LinkEnabled Then
    wscript.echo "Failed to start camera."
    Quit
    End If

    binning = 2
    guiderbinning = 2

    wscript.echo "Main camera - set full frame with binning=", binning, "x", binning

    cam.BinX = binning
    cam.BinY = binning
    cam.SetFullFrame
    wscript.echo "CameraXSize=" , cam.CameraXSize
    wscript.echo "CameraYSize=" , cam.CameraYSize
    wscript.echo "BinX=" , cam.BinX
    wscript.echo "BinY=" , cam.BinY
    wscript.echo "StartX=" , cam.StartX
    wscript.echo "StartY=" , cam.StartY
    wscript.echo "NumX=" , cam.NumX
    wscript.echo "NumY=" , cam.NumY

    wscript.echo
    wscript.echo "Guider camera - binning=", guiderbinning
    cam.GuiderBinning = guiderbinning
    cam.GuiderStartX = 0
    cam.GuiderStartY = 0
    cam.GuiderNumX = 2048
    cam.GuiderNumY = 2048
    wscript.echo "GuiderBinning=" , cam.GuiderBinning
    wscript.echo "GuiderStartX=" , cam.GuiderStartX
    wscript.echo "GuiderStartY=" , cam.GuiderStartY
    wscript.echo "GuiderNumX=" , cam.GuiderNumX
    wscript.echo "GuiderNumY=" , cam.GuiderNumY
     
    Last edited: Jul 5, 2017
  2. Owen Lawrence

    Owen Lawrence Staff Member

    Joined:
    Oct 1, 2014
    Messages:
    807
    Hi Dave,

    Thanks for the detailed report. I'll give your script a try and get back to you with my findings.

    - Owen -
     
  3. Owen Lawrence

    Owen Lawrence Staff Member

    Joined:
    Oct 1, 2014
    Messages:
    807
    Okay, the problem has been found and fixed. The correction will appear in the next Beta update, V6.14.3.0.

    - Owen -
     
  4. Bob Denny

    Bob Denny Cyanogen Customer

    Joined:
    Oct 12, 2014
    Messages:
    489
    Location:
    DC-3 Dreams, SP, Mesa, Arizona +1 480 396 9700
    Dave -- great repro scenario! Owen got it in less than an hour!! And Owen, great turn time!
     
  5. DaveLane

    DaveLane Cyanogen Customer

    Joined:
    Sep 6, 2016
    Messages:
    21
    Location:
    Halifax, NS
    Wow, I just noticed this now (I did not get a notice from the Forum). Thanks for fixing it Owen. When I get back at two camera support in my automation software, I'll continue my tests!

    Thanks Bob, as a fellow software developer, you would know how important it is to document bugs :)

    --- Dave
     

Share This Page