Changes between Version 144 and Version 145 of UserGuideGit


Ignore:
Timestamp:
Mar 2, 2009, 4:01:34 PM (16 years ago)
Author:
Frédéric
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UserGuideGit

    v144 v145  
    153153It can be usefull to call an external program to make tethered shooting, instead of using the Merlin/Orion triggering.
    154154
    155 If a '''{{{shoot.py}}}''' python script is found in the user config. dir, the functions '''{{{mirrorLockup(stabilizationDelay)}}}''' and '''{{{shoot(bracketNumber)}}}''' contained in this script will be called instead of internal ones.
     155If a '''{{{shoot.py}}}''' python script is found in the user config. dir, the functions '''{{{mirrorLockup()}}}''' and '''{{{shoot(bracketNumber)}}}''' contained in this script will be called instead of internal ones.
    156156
    157157Here is a minimalistic example script (here, we use '''gphoto2''' as tethered shooting program):
     
    161161import subprocess
    162162
     163
    163164def mirrorLockup():
     165    """ Lockup the mirror.
     166
     167    @return: error code, stdout, stderr
     168    @rtype: tuple of int, str, str
     169    """
     170
    164171    # See shoot() function
     172    return 0, "", ""
    165173
    166174
    167175def shoot(bracketNumber):
    168 
    169     # Launch the external command
     176    """ Shoot.
     177
     178    @param bracketNumber: number of the current bracket picture
     179    @type bracketNumber: int
     180
     181    @return: error code, stdout, stderr
     182    @rtype: tuple of int, str, str
     183    """
     184
     185    # Launch external command
    170186    p = subprocess.Popen(["gphoto2", "--capture-image"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    171187
     
    173189    stdout, stderr = p.communicate()
    174190
    175     # Return result (a tuple containing return code, stdout and stderr)
    176     return p.returncode, stdout, stderr
     191    return p.returncode,stdout, stderr
    177192}}}
    178193