def moveDerot(angle): return ccs.SendCommand(getRotEnv(), rotServer, "SETDP", "%.4f" % angle)
hdulist.writeto(filename, overwrite=True) return filename def msgSend(env, process, command, param): result = subprocess.run(['msgSend', env, process, command, param], stdout=subprocess.PIPE) if __name__ == '__main__': parser = argparse.ArgumentParser( description='Inject a modal disturbance on the DM') parser.add_argument('frequency', type=float, help='Frequency [Hz]') parser.add_argument('amplitude', type=float, help='Amplitude [umRMS]') parser.add_argument('mode', type=int, help='Mode index Z=2..16') args = parser.parse_args() ccs.CcsInit('generate_model_disturbance.py') # Generate disturbance filename = disturbance(args.frequency, args.amplitude, args.mode) # Configure SPARTA ccs.SendCommand('wat{0}nao'.format(os.environ['TCSID']), 'spaccsServer', 'SETUP', 'ModalCtrDisturb.FILENAME {0}'.format(filename)) ccs.SendCommand('wat{0}nao'.format(os.environ['TCSID']), 'spaccsServer', 'SETUP', 'ModalCtrDisturb.CYCLES 30') ccs.SendCommand('wat{0}nao'.format(os.environ['TCSID']), 'spaccsServer', 'EXEC', 'ModalCtrDisturb.run')
def ccdInit(): ccs.SendCommand(getCcdEnv(), ccdServer, "SETUP", "-expoId -1 -file ccdSetupComplete.det")
def ccdOnline(): ccs.SendCommand(getCcdEnv(), ccdServer, "ONLINE")
def ccdStop(): return ccs.SendCommand(getCcdEnv(), ccdServer, "STOP")
def ccdWait(): return ccs.SendCommand(getCcdEnv(), ccdServer, "WAIT")
def ccdStart(): return ccs.SendCommand(getCcdEnv(), ccdServer, "START")
def ccdSetup(buffer): #buffer = dict(buffer,**ccdBuffer) return ccs.SendCommand(getCcdEnv(), ccdServer, "SETUP", "-function " + buffer2param(buffer))
def moveAz(angle): return ccs.SendCommand(getAzEnv(), azServer, "PRESET", "abs,%.4f,600" % angle)