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"), )
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"), )
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) ]
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, )
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'), )
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"), )
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)'), )
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'), )
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'), )
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'), )
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.'), )
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), )
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'), )
def __init__(self, name, dictionaryRequired): self.name = name # first time initialization of database table if not Actor.table: Actor.table = database.Table.attach( Actor.tableName, (types.UInt(name='id'), types.String(name='name'), types.Int(name='major'), types.Int(name='minor'), types.String(name='checksum')), bufferSize=3) # try to (re)load this actor's dictionary try: log.msg('loading keydict for %s' % (name)) self.kdict = keys.KeysDictionary.load(name, forceReload=True) cksum = self.kdict.checksum (major, minor) = self.kdict.version except keys.KeysDictionaryError as e: if dictionaryRequired: raise ActorException('No %s dictionary available' % name) log.err('dictionary load error: %s' % e) self.kdict = None cksum = '' (major, minor) = (0, 0) # is this actor already in the database? if name in Actor.existing: (ex_idnum, ex_major, ex_minor, ex_cksum) = Actor.existing[name] if (major, minor) == (ex_major, ex_minor): if cksum != ex_cksum: raise ActorException( 'Dictionary has changed without version update for %s %d.%d' % (name, major, minor)) print('re-initializing %s actor version %d.%d' % (name, major, minor)) self.idnum = ex_idnum elif major < ex_major or (major == ex_major and minor < ex_minor): raise ActorException( 'Found old dictionary for %s? %d.%d < %d.%d' % (name, major, minor, ex_major, ex_minor)) else: print('updating %s actor from %d.%d to %d.%d' % (name, ex_major, ex_minor, major, minor)) self.create(major, minor, cksum) else: print('recording new %s actor in database (version %d.%d)' % (name, major, minor)) self.create(major, minor, cksum) # initialize our keyword statistics self.keyStats = {} # remember this actor for this session Actor.registry[self.name] = self
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'), )
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'), )
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'), )
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'))), )
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'), )
def initCoreTables(rawBufferSize, hdrBufferSize): """ Initializes the core database tables This function is called after the reactor is started but before entering the main event loop. """ Table.attach('reply_raw', (types.Long(name='id'), types.Double(name='tai'), types.String(name='msg')), bufferSize=rawBufferSize, indices=('tai', )) Table.attach('reply_hdr', (types.Long(name='raw_id'), types.UInt(name='actor_id'), types.String(name='program'), types.String(name='username'), types.UInt(name='cmd_num'), messages.ReplyHeader.MsgCode, types.UInt(name='key_errors')), bufferSize=hdrBufferSize, indices=('actor_id', ))
def __init__(self, actor): self.actor = actor self.hartmann_thread = None # Declare commands self.keys = keys.KeysDictionary( 'hartmann_hartmann', (1, 1), keys.Key('id', types.Int(), help='first exposure number of Hartmann pair to process.'), keys.Key('id2', types.Int(), help='second exposure number of Hartmann to process (default: id+1).'), keys.Key('mjd', types.Int(), help='MJD of the Hartmann pair to process (default: current MJD).'), keys.Key('noCorrect', help='if set, do not apply any recommended corrections.'), keys.Key('noSubframe', help='if set, take fullframe images.'), keys.Key('ignoreResiduals', help='if set, apply red moves regardless of resulting blue residuals.'), keys.Key('noCheckImage', help='if set, do not check the flux level in the image ' '(useful for sparse plugged plates).'), keys.Key('minBlueCorrection', help='if set, the calculated correction for the blue ring will be ' 'the minimum to get in the tolerance range.'), keys.Key('bypass', types.String(), help='a list of checks and systems to bypass'), keys.Key('cameras', types.String(), help='a list of cameras to process'), ) self.vocab = [ ('ping', '', self.ping), ('status', '', self.status), ('collimate', '[noCorrect] [noSubframe] [ignoreResiduals] [noCheckImage] ' '[minBlueCorrection] [<bypass>] [<cameras>]', self.collimate), ('recompute', '<id> [<id2>] [<mjd>] [noCorrect] ' '[noCheckImage] [<bypass>] [<cameras>]', self.recompute), ('abort', '', self.abort) ]
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
def __init__(self, actor): self.actor = actor # Define some typed command arguemetnts self.keys = keys.KeysDictionary( "apogeeql_apogeeql", (1, 1), keys.Key("actor", types.String(), help="Another actor to command"), keys.Key("cmd", types.String(), help="A command string"), keys.Key("count", types.Int(), help="A count of things to do")) # # Declare commands # self.vocab = [ ('ping', '', self.ping), ('status', '', self.status), ('update', '', self.update), ('checkdisks', '', self.checkDisks), ('stopidl', '', self.stopIDL), ('startidl', '', self.startIDL), ('ql', '<cmd>', self.quicklook), ('doSomething', '<count>', self.doSomething), ('passAlong', 'actor <cmd>', self.passAlong), ]
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), ('connect', '<controller> [<name>]', self.connect), ('disconnect', '<controller>', self.disconnect), ('monitor', '<controllers> <period>', self.monitor), ('temps', '', self.temps), ('temps', 'status', self.temps), ] # Define typed command arguments for the above commands. self.keys = keys.KeysDictionary( "ccd_ccd", (1, 1), keys.Key("name", types.String(), help='the name of a multi-instance controller.'), keys.Key("period", types.Float(), help='how often a periodic monitor should be called. '), keys.Key("controller", types.String(), help='the name of a controller.'), keys.Key("controllers", types.String() * (1, None), help='the names of 1 or more controllers to work on'), )
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'))), )
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
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 = "drpCheck" self.vocab = [ ('set', '<drpFolder>', self.changeFolder), ] # Define typed command arguments for the above commands. self.keys = keys.KeysDictionary( "drp_drp", (1, 1), keys.Key("drpFolder", types.String(), help="custom drp folder"), )
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 = [] for testName in XcuCmd.testNames: testFunc = partial(self.testFunc, funcName=testName) setattr(self, testName, testFunc) self.vocab.append((testName, '<cam>', testFunc)) self.keys = keys.KeysDictionary( "tests__xcu", (1, 1), keys.Key("cam", types.String(), help='camera to test'), )
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 = [ ('power', '@raw', self.raw), ('power', '@(on|off|bounce) @(agc|leakage|adam|boardb|boardc|usb|switch) [<ids>]', self.setPower), ('power', 'status', self.status), ] # Define typed command arguments for the above commands. self.keys = keys.KeysDictionary( "peb_power", (1, 2), keys.Key("ids", types.String(), help="List of active devices"), )
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), ('start', '<cam> <setpoint> [<period>] [<kp>]', self.startLoop), ('stop', '<cam>', self.stopLoop), ] # Define typed command arguments for the above commands. self.keys = keys.KeysDictionary('regul_regul', (1, 1), keys.Key('setpoint', types.Float(), help='Detector box temperature setpoint'), keys.Key('period', types.Float(), help='control loop period (hours), default=8'), keys.Key('kp', types.Float(), help='control loop coefficient, default=1.1'), keys.Key('cam', types.String(), help='single camera to regulate'), )