Log Book Entry No.7

Days, Calendar Created: 04 Sep 2013 16:35:24 Days, Calendar Last Revised: 06 Sep 2013 17:18:38 Person PedroPaiva Text Connecting MaximDL and FocusMax to Python

Basic information on automating astrophotography with python here
And almost everything you need to know about Python and COM objects here.
(If you just want the basics, check this link and this Quick Guide.)

From iPython run the following commands as apropriate:

import win32com.client

    # Try to load MaximDL module
    maxim =  win32com.client.gencache.EnsureDispatch('Maxim.Application')
    # If makepy fails, generate manually and override
    # Generate MaximDL module*
    modMax = win32com.client.gencache.EnsureModule('{B4955EC7-F7F2-11D2-AA9C-444553540000}', 0, 1, 0)
    maxim = win32com.client.Dispatch('Maxim.Application')
    maxim = modMax.IApplication(maxim)
    camera = win32com.client.Dispatch('Maxim.CCDCamera')
    camera= modMax.ICCDCamera(camera)
    document = win32com.client.Dispatch('Maxim.Document')
    document = modMax.IDocument(document)
    # Else, load camera and document
    camera =  win32com.client.gencache.EnsureDispatch('Maxim.CCDCamera')
    document =  win32com.client.gencache.EnsureDispatch('Maxim.Document')

    # Analogous with focuser
    focuser = win32com.client.gencache.EnsureDispatch('FocusMax.Focuser')
    # Generate FocusMax module*
modFM = win32com.client.gencache.EnsureModule('{12E053C4-A4BE-42FF-A680-AA72EDB68FA4}', 0, 1, 0) focuser = win32com.client.Dispatch('FocusMax.Focuser') focuser = modFM._Focuser(focuser) focusControl = win32com.client.Dispatch('FocusMax.FocusControl') focusControl = modFM._FocusControl(focusControl) focuserRate = win32com.client.Dispatch('FocusMax.Rate') focuserRate = modFM._Rate(focuserRate) telescope = win32com.client.Dispatch('FocusMax.Telescope') telescope = modFM._Telescope(telescope) else: focusControl = win32com.client.gencache.EnsureDispatch('FocusMax.FocusControl') focuserRate = win32com.client.gencache.EnsureDispatch('FocusMax.Rate') telescope = win32com.client.gencache.EnsureDispatch('FocusMax.Telescope') try: # "Direct" connect to telescope vias ASCOM telescope = win32com.client.gencache.EnsureDispatch('MeadeLX200GPS.Telescope') except: # Generate Meade module* modMeade = win32com.client.gencache.EnsureModule('{ACC9C081-8A1D-4A76-A86E-F2BAC88C8BA1}', 0, 1, 0) telescope = win32com.client.Dispatch('MeadeLX200GPS.Telescope') telescope = modMeade._Telescope(telescope) focuser = win32com.client.Dispatch('MeadeLX200GPS.Focuser') focuser = modMeade._Focuser(focuser) axisRate = win32com.client.Dispatch('MeadeLX200GPS.AxisRates') axisRate = modMeade._FocusControl(axisRate) focuserRate = win32com.client.Dispatch('MeadeLX200GPS.Rate') focuserRate = modMeade._Rate(focuserRate) else focuser = win32com.client.gencache.EnsureDispatch('MeadeLX200GPS.Focuser') axisRate = win32com.client.gencache.EnsureDispatch('MeadeLX200GPS.AxisRate') focuserRate = win32com.client.gencache.EnsureDispatch('MeadeLX200GPS.Focuser')
* this lines can be obtained from "makepy.py -i" command on your _lib/site-packages/win32com/client_ folder under your python installation directory Obs. Object info can be obtained via the "combrowse.py" command on your _lib/site-packages/win32com/client_ folder under your python installation directory.
Objects should be under "Registered Type Libraries" and they contain more information of available methods and property. MaximDL information are also available [[http://www.newastro.com/tutorials/maxim_objects.php][here]] and on [[http://www.cyanogen.com/help/maximdl/MaxIm-DL.htm][MaximDL Help]].
FocusMax information are also available on [[http://www.focusmax.org/Downloads/FocusMax%20Help.pdf][FocusMax Help]]
__Back to:__ [[Public.LogBookAstronomy][LogBookAstronomy]]
Subject Connecting MaximDL and FocusMax to Python
Status blank
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions

Physics WebpagesRHUL WebpagesCampus Connect • Royal Holloway, University of London, Egham, Surrey TW20 0EX; Tel/Fax +44 (0)1784 434455/437520

Topic revision: r3 - 06 Sep 2013 - PedroPaiva

This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding RHUL Physics Department TWiki? Send feedback