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), ('gen2Reload', '', self.gen2Reload), ('getFitsCards', '<frameId> <expTime> <expType>', self.getFitsCards), ] # Define typed command arguments for the above commands. self.keys = keys.KeysDictionary( "core_core", (1, 1), keys.Key("frameType", types.Enum('A', 'A9'), help=''), keys.Key("cam", types.String(), help='camera name, e.g. r1'), keys.Key("cnt", types.Int(), help='a count'), keys.Key("expType", types.Enum('bias', 'dark', 'arc', 'flat', 'object'), help='exposure type for FITS header'), keys.Key("expTime", types.Float(), help='exposure time'), keys.Key("frameId", types.Int(), help='Gen2 frame 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 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"), )
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 = [ ('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): 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, 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'), )
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 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'), )
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, 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 = [ ('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): # initialize from the superclass super(SopCmd_LCO, self).__init__(actor) # Define APO specific keys. self.keys.extend([keys.Key('nDarks', types.Int(), help='Number of darks to take'), keys.Key('nDarkReads', types.Int(), help='Number of readouts per dark'), keys.Key('nFlatReads', types.Int(), help='Number of readouts per flat')]) # Define new commands for APO self.vocab = [('gotoField', '[slew] [screen] [flat] [guiderFlat] ' '[darks] [guider] ' '[<guiderFlatTime>] [<guiderTime>] [<nFlatReads>] ' '[<nDarks>] [<nDarkReads>] [abort]', self.gotoField)]
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 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.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): # 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): 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 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 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'), )
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 = [ ('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 = [ ('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): 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 = [] for testName in EnuCmd.testNames: testFunc = partial(self.testFunc, funcName=testName) setattr(self, testName, testFunc) self.vocab.append((testName, '@(sm1|sm2|sm3|sm4)', testFunc)) self.keys = keys.KeysDictionary( "tests__enu", (1, 1), keys.Key("smId", types.Int(), help='spectrograph to test'), )
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 = [ ('led', '@raw', self.raw), ('led', '@(on|flash|off)', self.setPower), ('led', '@(config|configflash) [<ledperiod>] [<dutycycle>]', self.configParameters), ('led', 'status', self.status), ] # Define typed command arguments for the above commands. self.keys = keys.KeysDictionary( "peb_led", (1, 2), keys.Key("ledperiod", types.Int(), help="Period in us"), keys.Key("dutycycle", types.Float(), help="Duty cycle in %"), )
def __init__(self, actor): # initialize from the superclass super(SopCmd_APO, self).__init__(actor) # Define APO specific keys. self.keys.extend([ keys.Key('narc', types.Int(), help='Number of arcs to take'), keys.Key('nbias', types.Int(), help='Number of biases to take'), keys.Key('ndark', types.Int(), help='Number of darks to take'), keys.Key('nexp', types.Int(), help='Number of exposures to take'), keys.Key('nflat', types.Int(), help='Number of flats to take'), keys.Key('arcTime', types.Float(), help='Exposure time for arcs'), keys.Key('darkTime', types.Float(), help='Exposure time for flats'), keys.Key('flatTime', types.Float(), help='Exposure time for flats'), keys.Key('test', help='Assert that the exposures are ' 'not expected to be meaningful'), keys.Key('sp1', help='Select SP1'), keys.Key('sp2', help='Select SP2'), keys.Key('nStep', types.Int(), help='Number of dithered ' 'exposures to take'), keys.Key('nTick', types.Int(), help='Number of ticks ' 'to move collimator'), keys.Key('dither', types.String(), help='MaNGA dither position ' 'for a single dither.'), keys.Key('dithers', types.String(), help='MaNGA dither positions ' 'for a dither sequence.'), keys.Key('mangaDithers', types.String(), help='MaNGA dither ' 'positions for a ' 'dither sequence.'), keys.Key('mangaDither', types.String(), help='MaNGA dither ' 'position for a ' 'single dither.'), keys.Key('count', types.Int(), help='Number of MaNGA dither ' 'sets to perform.'), keys.Key('noHartmann', help='Don\'t make Hartmann corrections'), keys.Key('noCalibs', help='Don\'t run the calibration step'), keys.Key('keepOffsets', help='When slewing, do not clear ' 'accumulated offsets'), keys.Key('ditherSeq', types.String(), help='dither positions for ' 'each sequence. ' 'e.g. AB') ]) # Define new commands for APO self.vocab = [ ('doBossCalibs', '[<narc>] [<nbias>] [<ndark>] [<nflat>] ' '[<arcTime>] [<darkTime>] [<flatTime>] ' '[<guiderFlatTime>] [abort]', self.doBossCalibs), ('doBossScience', '[<expTime>] [<nexp>] [abort] [stop] [test]', self.doBossScience), ('doMangaDither', '[<expTime>] [<dither>] [stop] [abort]', self.doMangaDither), ('doMangaSequence', '[<expTime>] [<dithers>] [<count>] [stop] ' '[abort]', self.doMangaSequence), ('doApogeeMangaDither', '[<mangaDither>] [<comment>] ' '[stop] [abort]', self.doApogeeMangaDither), ('doApogeeMangaSequence', '[<mangaDithers>] [<count>] [<comment>] ' '[stop] [abort]', self.doApogeeMangaSequence), ('gotoField', '[<arcTime>] [<flatTime>] [<guiderFlatTime>] ' '[<guiderTime>] [noSlew] [noHartmann] [noCalibs] ' '[noGuider] [abort] [keepOffsets]', self.gotoField), ('ditheredFlat', '[sp1] [sp2] [<expTime>] [<nStep>] [<nTick>]', self.ditheredFlat), ('hartmann', '[<expTime>]', self.hartmann), ('collimateBoss', '', self.collimateBoss), ('lampsOff', '', self.lampsOff) ]
def __init__(self, actor): # This lets us access the rest of the actor. self.actor = actor self.boresightLoop = 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. # seqArgs = '[<name>] [<comments>]' self.vocab = [ ('startBoresightAcquisition', '[<expTime>] [<nExposures>]', self.startBoresightAcquisition), ('addBoresightPosition', '', self.addBoresightPosition), ('reduceBoresightData', '', self.reduceBoresightData), ('abortBoresightAcquisition', '', self.abortBoresightAcquisition), ('fpsLoop', '[<expTime>] [<cnt>]', self.fpsLoop), # ('mcsLoop', '[<expTime>] [<cnt>] [@noCentroids]', self.mcsLoop), ('moveToPfsDesign', f'<designId> {seqArgs}', self.moveToPfsDesign), ('movePhiToAngle', f'<angle> <iteration> {seqArgs}', self.movePhiToAngle), ('moveToHome', f'@(phi|theta|all) {seqArgs}', self.moveToHome), ('moveToSafePosition', f'{seqArgs}', self.moveToSafePosition), ('gotoVerticalFromPhi60', f'{seqArgs}', self.gotoVerticalFromPhi60), ('makeMotorMap', f'@(phi|theta) <stepsize> <repeat> [@slowOnly] {seqArgs}', self.makeMotorMap), ('makeOntimeMap', f'@(phi|theta) {seqArgs}', self.makeOntimeMap), ('angleConvergenceTest', f'@(phi|theta) <angleTargets> {seqArgs}', self.angleConvergenceTest), ('targetConvergenceTest', f'@(ontime|speed) <totalTargets> <maxsteps> {seqArgs}', self.targetConvergenceTest), ('motorOntimeSearch', f'@(phi|theta) {seqArgs}', self.motorOntimeSearch), ] # Define typed command arguments for the above commands. self.keys = keys.KeysDictionary( "iic_iic", (1, 1), keys.Key("nPositions", types.Int(), help="number of angles to measure at"), keys.Key("nExposures", types.Int(), help="number of exposures to take at each position"), keys.Key("expTime", types.Float(), default=1.0, help="Seconds for exposure"), keys.Key('name', types.String(), help='sps_sequence name'), keys.Key('comments', types.String(), help='sps_sequence comments'), keys.Key("cnt", types.Int(), default=1, help="times to run loop"), keys.Key("angle", types.Int(), help="arm angle"), keys.Key("stepsize", types.Int(), help="step size of motor"), keys.Key("repeat", types.Int(), help="number of iteration for motor map generation"), keys.Key("angleTargets", types.Int(), help="Target number for angle convergence"), keys.Key("totalTargets", types.Int(), help="Target number for 2D convergence"), keys.Key("maxsteps", types.Int(), help="Maximum step number for 2D convergence test"), keys.Key("iteration", types.Int(), help="Interation number"), keys.Key( "designId", types.Long(), help= "pfsDesignId for the field,which defines the fiber positions"), )
def __init__(self, actor): # This lets us access the rest of the actor. self.actor = actor self.seq = 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. # seqArgs = '[<name>] [<comments>] [<head>] [<tail>] [@doTest]' identArgs = '[<cam>] [<arm>] [<sm>]' commonArgs = f'{identArgs} [<duplicate>] {seqArgs}' dcbArgs = f'[<switchOn>] [<switchOff>] [<warmingTime>] [<attenuator>] [force]' timedLampsArcArgs = '[<hgar>] [<hgcd>] [<argon>] [<neon>] [<krypton>] [<xenon>] [@doShutterTiming]' self.vocab = [ ('masterBiases', f'{commonArgs}', self.masterBiases), ('masterDarks', f'[<exptime>] {commonArgs}', self.masterDarks), ('ditheredFlats', f'<exptime> [<pixels>] [<nPositions>] [switchOff] {dcbArgs} {commonArgs}', self.ditheredFlats), ('scienceArc', f'<exptime> {dcbArgs} {commonArgs}', self.scienceArc), ('scienceTrace', f'<exptime> [<window>] [switchOff] {dcbArgs} {commonArgs}', self.scienceTrace), ('scienceObject', f'<exptime> [<window>] {commonArgs}', self.scienceObject), ('domeFlat', f'<exptime> [<window>] {commonArgs}', self.domeFlat), ('bias', f'{commonArgs}', self.doBias), ('dark', f'<exptime> {commonArgs}', self.doDark), ('expose', f'arc <exptime> {dcbArgs} {commonArgs}', self.scienceArc), ('expose', f'flat <exptime> [noLampCtl] [switchOff] {dcbArgs} {commonArgs}', self.scienceTrace), ('slit', f'throughfocus <exptime> <position> {dcbArgs} {commonArgs}', self.slitThroughFocus), ('detector', f'throughfocus <exptime> <position> [<tilt>] {dcbArgs} {commonArgs}', self.detThroughFocus), ('dither', f'arc <exptime> <pixels> [doMinus] {dcbArgs} {commonArgs}', self.ditheredArcs), ('defocus', f'arc <exptime> <position> {dcbArgs} {commonArgs}', self.defocusedArcs), ('custom', '[<name>] [<comments>] [<head>] [<tail>]', self.custom), ('ditheredFlats', f'<halogen> [@doShutterTiming] [<pixels>] [<nPositions>] {commonArgs}', self.ditheredFlats), ('scienceArc', f'{timedLampsArcArgs} {commonArgs}', self.scienceArc), ('scienceTrace', f'<halogen> [@doShutterTiming] [<window>] {commonArgs}', self.scienceTrace), ('expose', f'arc {timedLampsArcArgs} {commonArgs}', self.scienceArc), ('expose', f'flat <halogen> {commonArgs}', self.scienceTrace), ('test', f'hexapodStability {timedLampsArcArgs} [<position>] {commonArgs}', self.hexapodStability), ('dither', f'arc {timedLampsArcArgs} <pixels> [doMinus] {commonArgs}', self.ditheredArcs), ('detector', f'throughfocus {timedLampsArcArgs} <position> [<tilt>] {commonArgs}', self.detThroughFocus), ('defocus', f'arc {timedLampsArcArgs} <position> {commonArgs}', self.defocusedArcs), ('sps', 'rdaMove (low|med) [<sm>]', self.rdaMove), ] # Define typed command arguments for the above commands. self.keys = keys.KeysDictionary( 'iic_iic', (1, 1), keys.Key('exptime', types.Float() * (1, ), help='exptime list (seconds)'), keys.Key('duplicate', types.Int(), help='exposure duplicate (1 is default)'), 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('head', types.String() * (1, ), help='cmdStr list to process before'), keys.Key('tail', types.String() * (1, ), help='cmdStr list to process after'), keys.Key('switchOn', types.String() * (1, None), help='which dcb lamp to switch on.'), keys.Key('switchOff', types.String() * (1, None), help='which dcb lamp to switch off.'), keys.Key('iisOn', types.String() * (1, None), help='which iis lamp to switch on.'), keys.Key('iisOff', types.String() * (1, None), help='which iis lamp to switch off.'), keys.Key('attenuator', types.Int(), help='Attenuator value.'), keys.Key( 'position', types.Float() * (1, 3), help= 'slit/motor position for throughfocus same args as np.linspace' ), keys.Key('tilt', types.Float() * (1, 3), help='motor tilt (a, b, c)'), keys.Key( 'nPositions', types.Int(), help='Number of position for dithered flats (default : 20)'), keys.Key('pixels', types.Float(), help='dithering step in pixels'), keys.Key('warmingTime', types.Float(), help='customizable warming time'), keys.Key('halogen', types.Float(), help='quartz halogen lamp on time'), keys.Key('argon', types.Float(), help='Ar lamp on time'), keys.Key('hgar', types.Float(), help='HgAr lamp on time'), keys.Key('neon', types.Float(), help='Ne lamp on time'), keys.Key('krypton', types.Float(), help='Kr lamp on time'), keys.Key('hgcd', types.Float(), help='HgCd lamp on time'), keys.Key('xenon', types.Float(), help='Xenon lamp on time'), keys.Key("window", types.Int() * (1, 2), help='first row, total number of rows to read'), )
def __init__(self, actor): self.actor = actor self.replyQueue = sopActor.Queue('(replyQueue)', 0) # # Declare keys that we're going to use # self.keys = keys.KeysDictionary( "sop_sop", (2, 0), keys.Key("abort", help="Abort a command"), keys.Key("clear", help="Clear a flag"), keys.Key("expTime", types.Float(), help="Exposure time"), keys.Key("fiberId", types.Int(), help="A fiber ID"), keys.Key("keepQueues", help="Restart thread queues"), keys.Key("noSlew", help="Don't slew to field"), keys.Key("noDomeFlat", help="Don't run the dome flat step"), keys.Key("geek", help="Show things that only some of us love"), keys.Key("subSystem", types.String() * (1, ), help="The sub-systems to bypass"), keys.Key("threads", types.String() * (1, ), help="Threads to restart; default: all"), keys.Key("ditherPairs", types.Int(), help="Number of dither pairs (AB or BA) to observe"), keys.Key('guiderTime', types.Float(), help='Exposure time ' 'for guider'), keys.Key('guiderFlatTime', types.Float(), help='Exposure time ' 'for guider flats'), keys.Key('noGuider', help='Don\'t start the guider'), keys.Key("comment", types.String(), help="comment for headers"), keys.Key("scriptName", types.String(), help="name of script to run"), keys.Key("az", types.Float(), help="what azimuth to slew to"), keys.Key("rotOffset", types.Float(), help="what rotator offset to add"), keys.Key("alt", types.Float(), help="what altitude to slew to"), ) # # Declare commands # self.vocab = [ ("bypass", "<subSystem> [clear]", self.bypass), ("doApogeeScience", "[<expTime>] [<ditherPairs>] [stop] [<abort>] [<comment>]", self.doApogeeScience), ("doApogeeSkyFlats", "[<expTime>] [<ditherPairs>] [stop] [abort]", self.doApogeeSkyFlats), ("ping", "", self.ping), ("restart", "[<threads>] [keepQueues]", self.restart), ("gotoInstrumentChange", "[abort] [stop]", self.gotoInstrumentChange), ("gotoStow", "[abort] [stop]", self.gotoStow), ("gotoAll60", "[abort] [stop]", self.gotoAll60), ("gotoStow60", "[abort] [stop]", self.gotoStow60), ("gotoGangChange", "[<alt>] [abort] [stop] [noDomeFlat] [noSlew]", self.gotoGangChange), ("doApogeeDomeFlat", "[stop] [abort]", self.doApogeeDomeFlat), ("setFakeField", "[<az>] [<alt>] [<rotOffset>]", self.setFakeField), ("status", "[geek]", self.status), ("reinit", "", self.reinit), ("runScript", "<scriptName>", self.runScript), ("listScripts", "", self.listScripts), ]