Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.apo.nmsu.edu/35m_operations/TUI/Scripts/ScriptingTutorial/SendCommands.html
Дата изменения: Sat Sep 6 02:16:02 2014
Дата индексирования: Sun Apr 10 08:07:09 2016
Кодировка:

Поисковые слова: enceladus
TUI:Scripts:Scripting Tutorial:Send Commands

Send Commands

Sending commands to an instrument or other actor is straightforward. You need to know the name of the actor (e.g. "dis", "echelle", "tcc") and the command you wish to send. See APO Documentationfor documentation for the instruments, TCC and hub.

This script simply takes a few darks. It is not actually useful (the DIS Expose window can already do this and more) and lacks adequate feedback, but it is a start.

Warning: all exposures should be taken using the hub's <inst>Expose actor rather than by talking directly to the instrument. This makes sure that your images are put in a location where you can find them. It also offers a uniform interface to the instruments. Other commands (e.g. for configuration) can be sent directly to the instrument.

DISDarks script

Be sure you have permission to use DIS before running this example!!!


def run(sr):
    """Sample script to take a series of DIS darks
    and demonstrate using <inst>Expose to take exposures.
    The exposure times and  # of iterations are short so the demo runs quickly.
    """
    expType = "dark"
    expTime = 1  # in seconds
    numExp = 3

    yield sr.waitCmd(
        actor = "disExpose",
        cmdStr = "%s time=%s n=%d name=dis%s" % \
            (expType, expTime, numExp, expType),
        abortCmdStr = "abort",
    )

Notes: