Resolved Modifying Stackpro Settings via Python

Discussion in 'Aluma AC Series CMOS' started by Will Golay, Oct 5, 2021.

  1. Will Golay

    Will Golay Cyanogen Customer

    Joined:
    Oct 5, 2021
    Messages:
    3
    Hello,

    The University of Iowa recently purchased an SBIG4040 camera, and we are looking to integrate this camera into a robotic observation package. Because this is the first iteration of this project with a CMOS camera, we are looking to provide users with the ability to select the gain mode they would like for the images that they request from the robotic observatory, which means we need to be able to modify those settings via a Python script. The code snippet below shows how we are currently connecting to the camera:
    Code:
    from win32com.client import Dispatch
    
        global _maxim
        global _camera
    
        _maxim = Dispatch("MaxIm.Application")
        _maxim.LockApp = True
    
        _camera = Dispatch("MaxIm.CCDCamera")
        _camera.DisableAutoShutdown = True
    
        _camera.LinkEnabled = True
    My question is primarily how would I go about, say, switching from a high gain readout to Stackpro readout, or as another example, change the number of subimages that Stackpro uses. Ideally, we are looking for some documentation that lists all of the commands associated with the _maxim and _camera objects. I'm glad to provide more context/info.
     
  2. Doug

    Doug Staff Member

    Joined:
    Sep 25, 2014
    Messages:
    9,956
    _camera.ReadoutModes will give you an array of BSTR containing the names of the readout modes, in a zero-based array.

    Then you can use:

    _camera.ReadoutMode = N, where N is the zero-based index of the readout mode you want
     
  3. Will Golay

    Will Golay Cyanogen Customer

    Joined:
    Oct 5, 2021
    Messages:
    3
    Thanks Doug, I appreciate it! However, I'm wondering, is there some documentation that you could share that details all the methods/variables/etc available for _maxim and _camera? We'd like to know the full extent of what exactly we can do using scripts like this, that way I don't have to keep coming back on here and bothering you all anytime we want to do anything new, haha :)
     
  4. Doug

    Doug Staff Member

    Joined:
    Sep 25, 2014
    Messages:
    9,956
    In terms of the number of images that StackPro uses, that is automatically adjusted based on the exposure time and the target stacking exposure duration. This is explained in the user manual, and also briefly in the MaxIm DL help at https://cdn.diffractionlimited.com/help/maximdl/SBIG_Gen_3.htm

    Here's the relevant excerpt:

    So the idea is you select your target subframe exposure time, and the camera automatically adjusts the number of subexposures as needed. If you're shorter than 2x the target you get one exposure. If you're more than that it increases the number of subexposures as needed to get as close to the target as it can, without going shorter than the target. If you're longer than 16X then you get 16 exposures of 1/16th the total exposure time requested.

    This means you don't have to be constantly adjusting your subframe exposure times manually. You can just set the shortest subexposure time you want and the camera will take care of the rest.
     
  5. Doug

    Doug Staff Member

    Joined:
    Sep 25, 2014
    Messages:
    9,956
    Have a look at the MaxIm DL user manual!

    https://cdn.diffractionlimited.com/help/maximdl/MaxIm-DL.htm

    The left panel shows the table of contents. Near the bottom of the list click Scripting. That will open up a section showing all the Events, Properties, and Methods of each of MaxIm DL's interfaces.
     
  6. Will Golay

    Will Golay Cyanogen Customer

    Joined:
    Oct 5, 2021
    Messages:
    3
    Ah, perfect, that is what I was looking for, I didn't even think to look in the MaxIm manual. Sorry to bother, and thanks for the help!
     
  7. Doug

    Doug Staff Member

    Joined:
    Sep 25, 2014
    Messages:
    9,956
    RTFM!

    Will mark as Resolved.
     

Share This Page