Ejemplo n.º 1
0
    def __init__(self, actor):
        # This lets us access the rest of the actor.
        self.actor = actor

        # Declare the commands we implement. When the actor is started
        # these are registered with the parser, which will call the
        # associated methods when matched. The callbacks will be
        # passed a single argument, the parsed and typed command.
        #
        self.vocab = [
            ('ping', '', self.ping),
            ('status', '', self.status),
            ('inventory', '', self.inventory),
            ('testArgs', '[<cnt>] [<exptime>]', self.testArgs),
        ]

        # Define typed command arguments for the above commands.
        self.keys = keys.KeysDictionary("core_core", (1, 1),
                                        keys.Key("device", types.String(),
                                                 help='device name, probably like bee_r1'),
                                        keys.Key("cam", types.String(),
                                                 help='camera name, e.g. r1'),
                                        keys.Key("cnt", types.Int(),
                                                 help='a count'),
                                        keys.Key("exptime", types.Float(),
                                                 help='exposure time'),
                                        )
Ejemplo n.º 2
0
    def __init__(self, actor):
        # This lets us access the rest of the actor.
        self.actor = actor
        self.butler = None

        # Declare the commands we implement. When the actor is started
        # these are registered with the parser, which will call the
        # associated methods when matched. The callbacks will be
        # passed a single argument, the parsed and typed command.
        #
        self.vocab = [
            ('ping', '', self.ping),
            ('status', '', self.status),
            ('ingest', '<filepath>', self.ingest),
            ('detrend', '<visit> <arm> [<rerun>]', self.detrend),

            ('startDotLoop', '', self.startDotLoop),
            ('stopDotLoop', '', self.stopDotLoop),
            ('processDotData', '', self.processDotData),
            ('checkLeftOvers', '', self.checkLeftOvers)
        ]

        # Define typed command arguments for the above commands.
        self.keys = keys.KeysDictionary("drp_drp", (1, 1),
                                        keys.Key("rerun", types.String(), help="rerun drp folder"),
                                        keys.Key("filepath", types.String(), help="Raw FITS File path"),
                                        keys.Key("arm", types.String(), help="arm"),
                                        keys.Key("visit", types.Int(), help="visitId"),
                                        )
Ejemplo n.º 3
0
    def __init__(self, actor):
        # This lets us access the rest of the actor.
        self.actor = actor

        # Declare the commands we implement. When the actor is started
        # these are registered with the parser, which will call the
        # associated methods when matched. The callbacks will be
        # passed a single argument, the parsed and typed command.
        #
        self.name = 'drpProcess'
        self.vocab = [
            ('ping', '', self.ping),
            ('status', '', self.status),
            ('ingest', '<fitsPath>', self.ingest),
            ('detrend', '[<context>] <fitsPath>', self.detrend),
        ]

        # Define typed command arguments for the above commands.
        self.keys = keys.KeysDictionary(
            "drp_drp",
            (1, 1),
            keys.Key("expTime", types.Float(), help="The exposure time"),
            keys.Key("context", types.String(), help="custom drp folder"),
            keys.Key("fitsPath", types.String(), help="FITS File path"),
        )
Ejemplo n.º 4
0
    def __init__(self, actor):
        self.actor = actor
        self.cam = actor.name[:4]
        self.version = actor.version

        # ecamera files should not be gzipped, to make processing in IRAF easier.
        if 'ecamera' in actor.name:
            self.doCompress = False
            self.ext = ''
        else:
            self.doCompress = True
            self.ext = '.gz'

        self.dataRoot = self.actor.config.get(self.actor.name, 'dataRoot')
        self.filePrefix = self.actor.config.get(self.actor.name, 'filePrefix')

        # We track the names of any currently valid dark and flat files.
        self.biasFile = None
        self.darkFile = None
        self.biasTemp = 99.9
        self.darkTemp = 99.9
        self.flatFile = None
        self.flatCartridge = -1

        self.simRoot = None
        self.simSeqno = 1

        self.resync(actor.bcast, doFinish=False)

        self.keys = opsKeys.KeysDictionary("gcamera_camera", (1, 1),
                                           opsKeys.Key("time", types.Float(), help="exposure time."),
                                           opsKeys.Key("mjd", types.String(), help="MJD for simulation sequence"),
                                           opsKeys.Key("cartridge", types.Int(), help="cartridge number; used to bind flats to images."),
                                           opsKeys.Key("seqno", types.Int(),
                                                       help="image number for simulation sequence."),
                                           opsKeys.Key("filename", types.String(),
                                                       help="the filename to write to"),
                                           opsKeys.Key("stack", types.Int(), help="number of exposures to take and stack."),
                                           opsKeys.Key("temp", types.Float(), help="camera temperature setpoint."),
                                           opsKeys.Key("n", types.Int(), help="number of times to loop status queries."),
                                           )

        self.vocab = [
            ('ping', '', self.pingCmd),
            ('status', '', self.status),
            ('deathStatus', '<n>', self.deathStatus),
            ('setBOSSFormat', '', self.setBOSSFormat),
            ('setFlatFormat', '', self.setFlatFormat),
            ('simulate', '(off)', self.simulateOff),
            ('simulate', '<mjd> <seqno>', self.simulateFromSeq),
            ('setTemp', '<temp>', self.setTemp),
            ('expose', '<time> [<cartridge>] [<filename>] [<stack>] [force]', self.expose),
            ('bias', '[<stack>]', self.expose),
            ('dark', '<time> [<filename>] [<stack>]', self.expose),
            ('flat', '<time> [<cartridge>] [<filename>] [<stack>]', self.expose),
            ('reconnect', '', self.reconnect),
            ('aph', '', self.reconnect),
            ('resync', '', self.resync),
            ('shutdown', '[force]', self.shutdown)
            ]
Ejemplo n.º 5
0
    def __init__(self, actor):
        # This lets us access the rest of the actor.
        self.actor = actor
        self.name = 'cooler'

        # Declare the commands we implement. When the actor is started
        # these are registered with the parser, which will call the
        # associated methods when matched. The callbacks will be
        # passed a single argument, the parsed and typed command.
        #
        self.vocab = [
            ('cooler', '[<timeout>] raw', self.coolerRaw),
            ('cooler', 'status', self.status),
            ('cooler', 'temps', self.temps),
            ('cooler', 'on <setpoint>', self.tempLoop),
            ('cooler', 'power <setpoint>', self.powerLoop),
            ('cooler', 'off', self.off),
            ('cooler2', '[<timeout>] raw', self.coolerRaw),
            ('cooler2', 'status', self.status),
            ('cooler2', 'temps', self.temps),
            ('cooler2', 'on <setpoint>', self.tempLoop),
            ('cooler2', 'power <setpoint>', self.powerLoop),
            ('cooler2', 'off', self.off),
        ]

        # Define typed command arguments for the above commands.
        self.keys = keys.KeysDictionary(
            "xcu_cooler",
            (1, 2),
            keys.Key("setpoint", types.Float(), help='cooler setpoint'),
            keys.Key("timeout",
                     types.Float(),
                     help='timeout (in seconds) for raw command.'),
        )
Ejemplo n.º 6
0
    def __init__(self, actor):
        # This lets us access the rest of the actor.
        self.actor = actor

        # Declare the commands we implement. When the actor is started
        # these are registered with the parser, which will call the
        # associated methods when matched. The callbacks will be
        # passed a single argument, the parsed and typed command.
        #
        lightSources = '|'.join(SpecModule.lightSources)
        self.vocab = [
            ('ping', '', self.ping),
            ('status', '', self.status),
            ('declareLightSource',
             f'[<sm1>] [<sm2>] [<sm3>] [<sm4>] [{lightSources}]',
             self.declareLightSource),
        ]

        # Define typed command arguments for the above commands.
        self.keys = keys.KeysDictionary(
            "sps_sps",
            (1, 1),
            keys.Key('sm1', types.String(), help='sm1 light source'),
            keys.Key('sm2', types.String(), help='sm2 light source'),
            keys.Key('sm3', types.String(), help='sm3 light source'),
            keys.Key('sm4', types.String(), help='sm4 light source'),
        )
Ejemplo n.º 7
0
    def __init__(self, actor):
        # This lets us access the rest of the actor.
        self.actor = actor

        # Declare the commands we implement. When the actor is started
        # these are registered with the parser, which will call the
        # associated methods when matched. The callbacks will be
        # passed a single argument, the parsed and typed command.
        #
        self.vocab = [
            ('ping', '', self.ping),
            ('status', '[@all]', self.status),
            ('connect', '<controller> [<name>]', self.connect),
            ('disconnect', '<controller>', self.disconnect),
            ('monitor', '<controllers> <period>', self.monitor),
        ]

        # Define typed command arguments for the above commands.
        self.keys = keys.KeysDictionary(
            "xcu_xcu",
            (1, 1),
            keys.Key(
                "name",
                types.String(),
                help='an optional name to assign to a controller instance'),
            keys.Key("controllers",
                     types.String() * (1, None),
                     help='the names of 1 or more controllers to load'),
            keys.Key("controller",
                     types.String(),
                     help='the names a controller.'),
            keys.Key("period", types.Int(), help='the period to sample at.'),
        )
Ejemplo n.º 8
0
    def __init__(self, actor):
        # This lets us access the rest of the actor.
        self.actor = actor

        # Declare the commands we implement. When the actor is started
        # these are registered with the parser, which will call the
        # associated methods when matched. The callbacks will be
        # passed a single argument, the parsed and typed command.
        #
        self.vocab = [
            ('fpaMotors', 'findRange <cam> [<current>] [<axis>]', self.findRange),
            ('fpaMotors', 'checkRepeats <cam> [<reps>] [<axis>] [<distance>] [<delay>]',
             self.checkRepeats),
        ]

        # Define typed command arguments for the above commands.
        self.keys = keys.KeysDictionary("test.test", (1, 1),
                                        keys.Key("cam", types.String(),
                                                 help='camera name, e.g. b2'),
                                        keys.Key("axis", types.Enum('a','b','c'), default=None,
                                                 help='axis name'),
                                        keys.Key("reps", types.Int(), default=10,
                                                 help='number of repetitions'),
                                        keys.Key("delay", types.Float(), default=60,
                                                 help='delay between repetitions'),
                                        keys.Key("distance", types.Int(), default=3000,
                                                 help='how far to move'),
                                        keys.Key("current", types.Int(),
                                                 help='motor current override'),
                                        
                                        )
Ejemplo n.º 9
0
    def __init__(self, actor):
        # This lets us access the rest of the actor.
        self.actor = actor

        # Declare the commands we implement. When the actor is started
        # these are registered with the parser, which will call the
        # associated methods when matched. The callbacks will be
        # passed a single argument, the parsed and typed command.
        #
        self.vocab = [
            ('ionpump', '@raw', self.ionpumpRaw),
            ('ionpumpRead', '@raw', self.ionpumpReadRaw),
            ('ionpumpWrite', '@raw', self.ionpumpWriteRaw),
            ('ionpump', 'ident', self.ident),
            ('ionpump', 'status', self.status),
            ('ionpump', 'off [@pump1] [@pump2]', self.off),
            ('ionpump', 'on [@pump1] [@pump2] [<spam>]', self.on),
        ]

        # Define typed command arguments for the above commands.
        self.keys = keys.KeysDictionary(
            "xcu_ionpump",
            (1, 1),
            keys.Key("spam",
                     types.Int(),
                     help='how many times to poll for status'),
        )
Ejemplo n.º 10
0
    def __init__(self, actor):
        # This lets us access the rest of the actor.
        self.actor = actor

        # Declare the commands we implement. When the actor is started
        # these are registered with the parser, which will call the
        # associated methods when matched. The callbacks will be
        # passed a single argument, the parsed and typed command.
        #
        self.vocab = [
            ('gauge', '@raw', self.pcmGaugeRaw),
            ('gauge', '<setRaw>', self.setRaw),
            ('gauge', '<getRaw>', self.getRaw),
            ('gauge', 'status', self.pcmPressure),
        ]

        # Define typed command arguments for the above commands.
        self.keys = keys.KeysDictionary(
            "xcu_gauge",
            (1, 1),
            keys.Key("getRaw", types.Int(), help='the MPT200 query'),
            keys.Key(
                "setRaw",
                types.CompoundValueType(
                    types.Int(help='the MPT200 code'),
                    types.String(help='the MPT200 value'))),
        )
Ejemplo n.º 11
0
    def __init__(self, actor):
        # This lets us access the rest of the actor.
        self.actor = actor

        # Declare the commands we implement. When the actor is started
        # these are registered with the parser, which will call the
        # associated methods when matched. The callbacks will be
        # passed a single argument, the parsed and typed command.
        #
        self.vocab = [
            ('ccd', 'status', self.status),
            ('ccd', 'wipe', self.wipe),
            ('ccd', 'read [@(bias|dark|flat|arc|object|junk)] [<exptime>] [<obstime>]', self.read),
            ('ccd', 'expose <nbias>', self.exposeBiases),
            ('ccd', 'temps', self.fetchTemps),

        ]

        # Define typed command arguments for the above commands.
        self.keys = keys.KeysDictionary("fsm_ccd", (1, 1),
                                        keys.Key("obstime", types.String(),
                                                 help='official DATE-OBS string'),
                                        keys.Key("exptime", types.Float(),
                                                 help='official EXPTIME'),
                                        keys.Key("nbias", types.Int(),
                                                 help='number of biases to take'), )
Ejemplo n.º 12
0
    def __init__(self, actor):
        self.actor = actor

        #
        # Set the keyword dictionary
        #
        self.keys = keys.KeysDictionary("actorcore_core", (1, 2),
                                        keys.Key("cmd", types.String(), help="A command name"),
                                        keys.Key("controller", types.String(),
                                                 help='the names a controller.'),
                                        keys.Key("name", types.String(),
                                                 help='an optional name to assign to a controller instance'),
                                        keys.Key("filename", types.String(),
                                                 help='file for output'),
                                        keys.Key("cmds", types.String(),
                                                 help="A regexp matching commands"),
                                        keys.Key("html", help="Generate HTML"),
                                        keys.Key("full", help="Generate full help for all commands"),
                                        keys.Key("pageWidth", types.Int(),
                                                 help="Number of characters per line"),
                                        )

        self.vocab = (
            ('help', '[(full)] [<cmds>] [<pageWidth>] [(html)]', self.cmdHelp),
            ('cardFormats', '<filename>', self.cardFormats),
            ('reload', '[<cmds>]', self.reloadCommands),
            ('reloadConfiguration', '', self.reloadConfiguration),
            ('connect', '<controller> [<name>]', self.connect),
            ('disconnect', '<controller>', self.disconnect),
            ('version', '', self.version),
            ('exitexit', '', self.exitCmd),
            ('ipdb', '', self.ipdbCmd),
            ('ipython', '', self.ipythonCmd),
        )
Ejemplo n.º 13
0
    def __init__(self, actor):
        # This lets us access the rest of the actor.
        self.actor = actor

        # Declare the commands we implement. When the actor is started
        # these are registered with the parser, which will call the
        # associated methods when matched. The callbacks will be
        # passed a single argument, the parsed and typed command.
        #
        self.vocab = [
            ('sources', 'status', self.status),
            ('sources', '[<on>] [<off>] [<attenuator>] [force]', self.switch),
            ('arc', '[<on>] [<off>] [<attenuator>] [force]', self.switch),
            ('sources', 'abort', self.abort),
            ('sources', 'stop', self.stop),
            ('sources', 'start [@(operation|simulation)]', self.start),
        ]

        # Define typed command arguments for the above commands.
        self.keys = keys.KeysDictionary(
            "dcb__sources",
            (1, 1),
            keys.Key("on",
                     types.String() * (1, None),
                     help='which outlet to switch on.'),
            keys.Key("off",
                     types.String() * (1, None),
                     help='which outlet to switch off.'),
            keys.Key("attenuator", types.Int(), help="attenuator value"),
        )
Ejemplo n.º 14
0
    def __init__(self, actor):
        # This lets us access the rest of the actor.
        self.actor = actor

        # Declare the commands we implement. When the actor is started
        # these are registered with the parser, which will call the
        # associated methods when matched. The callbacks will be
        # passed a single argument, the parsed and typed command.
        #
        self.vocab = [
            ('temps', '@raw', self.tempsRaw),
            ('temps', 'status [<channel>]', self.getTemps),
            ('temps', 'test1', self.test1),
            ('temps', 'test2', self.test2),
            ('HPheaters', '@(on|off) @(shield|spreader)', self.HPheaters),
            ('heaters', '@(ccd|asic) <power>', self.heatersOn),
            ('heaters', '@(ccd|asic) @off', self.heatersOff),
            ('heaters', 'status', self.heaterStatus),
        ]

        # Define typed command arguments for the above commands.
        self.keys = keys.KeysDictionary("xcu_temps", (1, 1),
                                        keys.Key("power", types.Int(),
                                                 help='power level to set (0..100)'),
                                        keys.Key("channel", types.Int(),
                                                 help='channel to read'),           
                                        )
Ejemplo n.º 15
0
    def __init__(self, actor):
        # This lets us access the rest of the actor.
        self.actor = actor

        # Declare the commands we implement. When the actor is started
        # these are registered with the parser, which will call the
        # associated methods when matched. The callbacks will be
        # passed a single argument, the parsed and typed command.
        #
        self.name = "mono"
        self.vocab = [
            (self.name, 'status', self.status),
            (self.name, 'init', self.initialise),
            (self.name, '@(shutter) @(open|close)', self.cmdShutter),
            (self.name, '@(set) <grating>', self.setGrating),
            (self.name, '@(set) <outport>', self.setOutport),
            (self.name, '@(set) <wave>', self.setWave),
            (self.name, 'stop', self.stop),
            (self.name, 'start [@(operation|simulation)]', self.start),
        ]

        # Define typed command arguments for the above commands.
        self.keys = keys.KeysDictionary(
            "dcb__mono",
            (1, 1),
            keys.Key("grating", types.Int(), help="Grating Id"),
            keys.Key("outport", types.Int(), help="Outport Id"),
            keys.Key("wave", types.Float(), help="Wavelength"),
        )
Ejemplo n.º 16
0
    def __init__(self, actor):
        # This lets us access the rest of the actor.
        self.actor = actor

        # Declare the commands we implement. When the actor is started
        # these are registered with the parser, which will call the
        # associated methods when matched. The callbacks will be
        # passed a single argument, the parsed and typed command.
        #
        self.vocab = [
            ('getVisit', '', self.getVisit),
            ('getFitsCards', '<frameId> <expTime> <expType>', self.getFitsCards),
        ]

        # Define typed command arguments for the above commands.
        self.keys = keys.KeysDictionary("core_core", (1, 1),
                                        keys.Key("expType",
                                                 types.Enum('bias', 'dark', 'arc', 'flat',
                                                            'object', 'acquisition'),
                                                 help='exposure type for FITS header'),
                                        keys.Key("expTime", types.Float(),
                                                 help='exposure time'),
                                        keys.Key("frameId", types.String(),
                                                 help='Gen2 frame ID'),
                                        )
Ejemplo n.º 17
0
    def __init__(self, actor):
        # This lets us access the rest of the actor.
        self.actor = actor
        # Declare the commands we implement. When the actor is started
        # these are registered with the parser, which will call the
        # associated methods when matched. The callbacks will be
        # passed a le   le argument, the parsed and typed command.
        #
        exptypes = "|".join(ExposeCmd.expTypes[1:])
        self.exp = dict()

        self.vocab = [(
            'expose',
            f'@({exptypes}) <exptime> [<visit>] [<cam>] [<cams>] [@doLamps] [@doTest]',
            self.doExposure),
                      ('expose', 'bias [<visit>] [<cam>] [<cams>] [doTest]',
                       self.doExposure),
                      ('exposure', 'abort <visit>', self.abort),
                      ('exposure', 'finish <visit>', self.finish),
                      ('exposure', 'status', self.status)]

        # Define typed command arguments for the above commands.
        self.keys = keys.KeysDictionary(
            "sps_expose",
            (1, 1),
            keys.Key("exptime", types.Float(), help="The exposure time"),
            keys.Key("cam",
                     types.String(),
                     help='single camera to take exposure from'),
            keys.Key("cams",
                     types.String() * (1, ),
                     help='list of camera to take exposure from'),
            keys.Key("visit", types.Int(), help='PFS visit id'),
        )
Ejemplo n.º 18
0
 def __init__(self):
     MessageReceiver.__init__(self)
     # initialize a command message parser
     self.cmdParser = parser.CommandParser()
     # define our command keywords
     self.kdict = keys.KeysDictionary(
         '<cmd>',
         (0, 1),
         keys.Key('name', types.String(help='name of expression')),
         keys.Key('expr', types.String()),
         keys.Key('help', types.String(help='description of expression')),
         keys.Key('timeout', types.UInt(units='s',
                                        help='expiration timeout')),
         keys.Key(
             'history',
             types.UInt(units='s', help='amount of history to preload')),
         keys.Key('id', types.String(help='Subscriber ID')),
     )
     keys.CmdKey.setKeys(self.kdict)
     # define our command set
     self.commandSet = (
         validation.Cmd('monitor', 'info') >> self.monitorInfo,
         validation.Cmd('monitor', 'create <name> <expr> [<help>]') >>
         self.monitorCreate,
         validation.Cmd('monitor', 'drop <name>') >> self.monitorDrop,
         validation.Cmd('subscribe', '<name> [<timeout>] [<history>]') >>
         self.monitorSubscribe,
         validation.Cmd('flush', '<id>') >> self.monitorFlush,
     )
Ejemplo n.º 19
0
    def __init__(self, actor):
        # This lets us access the rest of the actor.
        self.actor = actor

        # Declare the commands we implement. When the actor is started
        # these are registered with the parser, which will call the
        # associated methods when matched. The callbacks will be
        # passed a single argument, the parsed and typed command.
        #
        identArgs = '[<cam>] [<arm>] [<sm>]'
        self.vocab = [
            ('sps', f'@startExposures <exptime> {identArgs} [<name>] [<comments>] [@doBias] [@doTest]', self.startExposures),
            ('domeArc', f'<exptime> {identArgs} [<name>] [<comments>] [<duplicate>] [@doTest]', self.domeArc),
        ]

        # Define typed command arguments for the above commands.
        self.keys = keys.KeysDictionary('iic_sunss', (1, 1),
                                        keys.Key('exptime', types.Float() * (1,), help='exptime list (seconds)'),
                                        keys.Key('cam', types.String() * (1,), help='camera(s) to take exposure from'),
                                        keys.Key('arm', types.String() * (1,), help='arm to take exposure from'),
                                        keys.Key('sm', types.Int() * (1,),
                                                 help='spectrograph module(s) to take exposure from'),
                                        keys.Key('name', types.String(), help='iic_sequence name'),
                                        keys.Key('comments', types.String(), help='iic_sequence comments'),
                                        keys.Key('duplicate', types.Int(), help='exposure duplicate (1 is default)'),
                                        )
Ejemplo n.º 20
0
    def __init__(self, actor):
        # This lets us access the rest of the actor.
        self.actor = actor
        # Declare the commands we implement. When the actor is started
        # these are registered with the parser, which will call the
        # associated methods when matched. The callbacks will be
        # passed a le   le argument, the parsed and typed command.
        #
        self.name = "sync"
        self.vocab = [
            ('slit', '<focus> [@(microns)] [@(abs)] [<cams>]', self.slitFocus),
            ('slit',
             'dither [<x>] [<y>] [@(pixels|microns)] [@(abs)] [<cams>]',
             self.slitDither),
            ('ccdMotors',
             'move [<a>] [<b>] [<c>] [<piston>] [@(microns)] [@(abs)] [<cams>]',
             self.ccdMotors),
            ('iis', '[<on>] [<warmingTime>] [<cams>]', self.iisOn),
            ('iis', '<off> [<cams>]', self.iisOff),
            ('checkFocus', '[<cams>]', self.checkFocus),
        ]

        # Define typed command arguments for the above commands.
        self.keys = keys.KeysDictionary(
            "sps_sync",
            (1, 1),
            keys.Key('focus', types.Float(), help='focus value'),
            keys.Key("cams",
                     types.String() * (1, ),
                     help='list of camera to take exposure from'),
            keys.Key("a",
                     types.Float(),
                     help='the number of ticks/microns to move actuator A'),
            keys.Key("b",
                     types.Float(),
                     help='the number of ticks/microns to move actuator B'),
            keys.Key("c",
                     types.Float(),
                     help='the number of ticks/microns to move actuator C'),
            keys.Key(
                "piston",
                types.Float(),
                help='the number of ticks/microns to move actuators A,B, and C'
            ),
            keys.Key("x",
                     types.Float(),
                     help='dither in pixels wrt ccd x direction'),
            keys.Key("y",
                     types.Float(),
                     help='dither in pixels wrt ccd y direction'),
            keys.Key('on',
                     types.String() * (1, None),
                     help='which iis lamp to switch on.'),
            keys.Key('off',
                     types.String() * (1, None),
                     help='which iis lamp to switch off.'),
            keys.Key('warmingTime',
                     types.Float(),
                     help='customizable warming time'),
        )
Ejemplo n.º 21
0
    def __init__(self, actor):
        # This lets us access the rest of the actor.
        self.actor = actor

        # Declare the commands we implement. When the actor is started
        # these are registered with the parser, which will call the
        # associated methods when matched. The callbacks will be
        # passed a single argument, the parsed and typed command.
        #
        self.vocab = [
            ('sequenceStatus', '[<id>]', self.sequenceStatus),
            ('sps', '@abortExposure [<id>]', self.abortExposure),
            ('sps', '@abort [<id>]', self.abortExposure),
            ('sps', '@finishExposure [<id>] [@noSunssBias]',
             self.finishExposure),
            ('annotate',
             '@(bad|ok) [<notes>] [<visit>] [<visitSet>] [<cam>] [<arm>] [<sm>]',
             self.annotate)
        ]

        # Define typed command arguments for the above commands.
        self.keys = keys.KeysDictionary(
            "mcs_mcs",
            (1, 1),
            keys.Key('id', types.Int(), help='optional visit_set_id.'),
            keys.Key('visit', types.Int(), help='optional visit_id.'),
            keys.Key('visitSet', types.Int(), help='optional visit_set_id.'),
            keys.Key('cam', types.String() * (1, ), help='camera(s)'),
            keys.Key('sm', types.Int() * (1, ), help='spectrograph module(s)'),
            keys.Key('arm', types.String() * (1, ), help='spspectrograph arm'),
            keys.Key('notes', types.String() * (1, ), help='additional notes'),
        )
Ejemplo n.º 22
0
    def __init__(self, actor):
        # This lets us access the rest of the actor.
        self.actor = actor

        # Declare the commands we implement. When the actor is started
        # these are registered with the parser, which will call the
        # associated methods when matched. The callbacks will be
        # passed a single argument, the parsed and typed command.
        #
        self.vocab = [
            ('turbo', '@raw', self.turboRaw),
            ('turbo', 'ident', self.ident),
            ('turbo', 'status', self.status),
            ('turbo', 'start', self.startTurbo),
            ('turbo', 'stop', self.stopTurbo),
            ('turbo', 'standby <percent>', self.standby),
            ('turbo', 'standby off', self.standbyOff),
        ]

        # Define typed command arguments for the above commands.
        self.keys = keys.KeysDictionary("xcu_turbo", (1, 1),
                                        keys.Key("percent", types.Int(),
                                                 help='the speed for standby mode'),
                                        keys.Key("period", types.Int(),
                                                 help='how often to poll for status'),

                                        )
Ejemplo n.º 23
0
    def __init__(self, actor):
        # This lets us access the rest of the actor.
        self.actor = actor

        # Declare the commands we implement. When the actor is started
        # these are registered with the parser, which will call the
        # associated methods when matched. The callbacks will be
        # passed a single argument, the parsed and typed command.
        #
        self.vocab = [
            ('pcm', '@raw', self.pcmRaw),
            # ('pcm', 'status [@(clear)]', self.udpStatus),
            ('power',
             '@(on|off|cycle) @(motors|gauge|cooler|temps|bee|fee|interlock|heaters|all) [@(force)]',
             self.nPower),
            # ('power', '@(on|off) @(motors|gauge|cooler|temps|bee|fee|interlock|heaters|all) [@(force)]', self.power),
            ('power',
             '@(voltage|current) @(ups|aux|motors|gauge|cooler|temps|bee|fee|interlock|heaters|all) [<n>] [@(counts)]',
             self.getPower),
            ('power', '@(status)', self.getPowerStatus),
            ('pcm',
             '@(calibrate) @(voltage|current|environment) @(ups|aux|motors|gauge|cooler|temps|bee|fee|interlock|heaters|temperature|pressure) <r1> <m1> <r2> <m2>',
             self.calibrateChannel),
            ('pcm', '@(saveCalData)', self.saveCalDataToROM),
            ('pcm', '@(environment) @(temperature|pressure|all)',
             self.getEnvironment),
            ('pcm', 'status', self.getPCMStatus),
            ('pcm', '@(reset) @(ethernet|system) [@(force)]', self.resetPCM),
            ('pcm', '@(setMask) @(powerOn|lowVoltage) <mask>', self.setMask),
            ('pcm', '@(getMask) @(powerOn|lowVoltage)', self.getMask),
            ('pcm', '@(getThreshold) @(upsBattery|upsLow|auxLow)',
             self.getThreshold),
            ('pcm', '@(setThreshold) @(upsBattery|upsLow|auxLow) <v>',
             self.setThreshold),
            ('pcm', '@(bootload) <filename>', self.bootloader),
        ]

        # Define typed command arguments for the above commands.
        self.keys = keys.KeysDictionary(
            "xcu_pcm",
            (1, 1),
            keys.Key("n", types.Int(), help='number of samples'),
            keys.Key("m1", types.Float(), help='measured value 1 (low)'),
            keys.Key("m2", types.Float(), help='measured value 2 (high)'),
            keys.Key("r1", types.Float(), help='raw count 1 (low)'),
            keys.Key("r2", types.Float(), help='raw count 2 (low)'),
            keys.Key("mask",
                     types.String(),
                     help='mask value, 8 bit binary string'),
            keys.Key("v", types.Float(), help='thershold voltage'),
            keys.Key("filename", types.String(),
                     help='new firmware file name'),
        )
Ejemplo n.º 24
0
    def __init__(self, actor):
        self.actor = actor

        self.vocab = [
            ('setCryoMode',
             '@(offline|standby|pumpdown|cooldown|operation|warmup|bakeout)',
             self.setCryoMode),
        ]

        self.keys = keys.KeysDictionary(
            "xcu_misc",
            (1, 1),
        )
Ejemplo n.º 25
0
    def __init__(self, actor):
        # This lets us access the rest of the actor.
        self.actor = actor

        self.vocab = [
            ('testMcs1', '', self.testMcs1),
            ('reloadVisitor', '', self.reloadVisitor),
        ]

        # Define typed command arguments for the above commands.
        self.keys = keys.KeysDictionary(
            "iic_test",
            (1, 1),
        )
Ejemplo n.º 26
0
    def __init__(self, actor):
        # This lets us access the rest of the actor.
        self.actor = actor

        # Declare the commands we implement. When the actor is started
        # these are registered with the parser, which will call the
        # associated methods when matched. The callbacks will be
        # passed a single argument, the parsed and typed command.
        #
        self.vocab = [
            ('pi', '@raw', self.sunssRaw),
            ('pi', 'move <degrees>', self.move),
            ('pi', 'move <steps>', self.move),
            ('status', '', self.status),
            ('stop', '', self.stop),
            ('track', '<ra> <dec> [<speed>] [<exptime>]', self.track),
            ('enable', '[<strategy>]', self.enable),
            ('disable', '', self.disable),
            ('startExposures', '', self.startExposures),
            ('takeFlats', '', self.takeFlats),
            ('reloadTracker', '', self.reloadTracker),
        ]
        # Define typed command arguments for the above commands.
        self.keys = keys.KeysDictionary(
            "sunss",
            (1, 1),
            keys.Key("ra",
                     types.Float(),
                     help='RA degrees to start tracking from'),
            keys.Key("dec",
                     types.Float(),
                     help='Dec degrees to start tracking from'),
            keys.Key("exptime", types.Float(), help='Exposure time'),
            keys.Key("degrees",
                     types.Float(),
                     help='Degrees to move frm current position'),
            keys.Key("steps",
                     types.Int(),
                     help='Steps to move frm current position'),
            keys.Key("speed",
                     types.Int(),
                     default=1,
                     help='Tracking speed multiple to test with'),
            keys.Key("strategy",
                     types.String(),
                     help='How to respond to telescope changes'),
        )

        self.state = 'stopped'
        self.connected = False
Ejemplo n.º 27
0
    def __init__(self, actor):
        # This lets us access the rest of the actor.
        self.actor = actor

        # Declare the commands we implement. When the actor is started
        # these are registered with the parser, which will call the
        # associated methods when matched. The callbacks will be
        # passed a single argument, the parsed and typed command.
        #
        self.vocab = [
            ('rough1', '@raw', self.roughRaw),
            ('rough1', 'ident', self.ident),
            ('rough1', 'status', self.status),
            ('rough1', 'start', self.startRough),
            ('rough1', 'stop', self.stopRough),
            ('rough1', 'standby <percent>', self.standby),
            ('rough1', 'standby off', self.standbyOff),

            ('rough2', '@raw', self.roughRaw),
            ('rough2 ident', '', self.ident),
            ('rough2 status', '', self.status),
            ('rough2 start', '', self.startRough),
            ('rough2 stop', '', self.stopRough),
            ('rough2 standby', '<percent>', self.standby),
            ('rough2 standby', 'off', self.standbyOff),

            ('roughGauge1', '@raw', self.gaugeRaw),
            ('roughGauge1', 'status', self.pressure),
            ('roughGauge1', '<setRaw>', self.setRaw),
            ('roughGauge1', '<getRaw>', self.getRaw),

            ('roughGauge2', '@raw', self.gaugeRaw),
            ('roughGauge2', 'status', self.pressure),
            ('roughGauge2', '<setRaw>', self.setRaw),
            ('roughGauge2', '<getRaw>', self.getRaw),
        ]

        # Define typed command arguments for the above commands.
        self.keys = keys.KeysDictionary("xcu_rough", (1, 2),
                                        keys.Key("percent", types.Int(),
                                                 help='the speed for standby mode'),
                                        keys.Key("getRaw", types.Int(),
                                                 help='the MPT200 query'),
                                        keys.Key("setRaw",
                                                 types.CompoundValueType(types.Int(help='the MPT200 code'),
                                                                         types.String(help='the MPT200 value'))),
                                        )
Ejemplo n.º 28
0
    def __init__(self, actor):
        # This lets us access the rest of the actor.
        self.actor = actor

        # Declare the commands we implement. When the actor is started
        # these are registered with the parser, which will call the
        # associated methods when matched. The callbacks will be
        # passed a single argument, the parsed and typed command.
        #
        self.vocab = [('ping', '', self.ping), ('status', '', self.status),
                      ('observe', '<designId>', self.genPfsDesignId),
                      ('finishField', '', self.finishField)]

        # Define typed command arguments for the above commands.
        self.keys = keys.KeysDictionary(
            "iic_iic", (1, 1),
            keys.Key('designId', types.Long(), help='selected pfsDesignId'))
Ejemplo n.º 29
0
    def __init__(self, actor):
        # This lets us access the rest of the actor.
        self.actor = actor

        # Declare the commands we implement. When the actor is started
        # these are registered with the parser, which will call the
        # associated methods when matched. The callbacks will be
        # passed a single argument, the parsed and typed command.
        #
        self.vocab = [
            ('ping', '', self.ping),
            ('status', '', self.status),
        ]

        # Define typed command arguments for the above commands.
        self.keys = keys.KeysDictionary("ssc_ssc", (1, 1),
                                        )
Ejemplo n.º 30
0
    def __init__(self, actor):
        # This lets us access the rest of the actor.
        self.actor = actor

        # Declare the commands we implement. When the actor is started
        # these are registered with the parser, which will call the
        # associated methods when matched. The callbacks will be
        # passed a single argument, the parsed and typed command.
        #
        self.vocab = [
            ('gatevalve', 'status', self.status),
            ('gatevalve', 'open [@(underVacuum)] [@(atAtmosphere)] [@(ok)] [@(reallyforce)] [@(dryrun)]',
             self.open),
            ('gatevalve', 'close', self.close),
            ('interlock', 'status', self.status),
            ('interlock', '@raw', self.interlockRaw),
            ('interlock', 'sendImage <path> [@doWait] [@sendReboot] [@straightToCode]', self.sendImage),
            ('setLimits', '[<atm>] [<soft>] [<hard>]', self.setLimits),
            ('sam', 'off', self.samOff),
            ('sam', 'on', self.samOn),
        ]

        # Define typed command arguments for the above commands.
        self.keys = keys.KeysDictionary("xcu_gatevalve", (1, 2),
                                        keys.Key("path", types.String(),
                                                 help='path of firmware file'),
                                        keys.Key("soft", types.Float(),
                                                 help='soft limit for dPressure'),   
                                        keys.Key("atm", types.Float(),
                                                 help='lower limit for atmospheric pressure'),   
                                        keys.Key("hard", types.Float(),
                                                 help='hard limit for dPressure'),   
        )

        # The valve manual declares 30 mbar/22.5 Torr as the maximum pressure across the valve.
        self.atmThreshold = 460.0  # The absolute lowest air pressure to accept as at atmosphere, Torr
        self.dPressSoftLimit = 22  # The overridable pressure difference limit for opening, Torr
        self.dPressHardLimit = 22  # The absolute pressure difference limit for opening, Torr

        try:
            self.actor.config.get('interlock', 'port')
            val = 'new'
        except Exception:
            val = 'old'
        self._interlockType = val