Exemplo n.º 1
0
def moveDerot(angle):
    return ccs.SendCommand(getRotEnv(), rotServer, "SETDP", "%.4f" % angle)
Exemplo n.º 2
0
    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')
Exemplo n.º 3
0
def ccdInit():
    ccs.SendCommand(getCcdEnv(), ccdServer, "SETUP",
                    "-expoId -1 -file ccdSetupComplete.det")
Exemplo n.º 4
0
def ccdOnline():
    ccs.SendCommand(getCcdEnv(), ccdServer, "ONLINE")
Exemplo n.º 5
0
def ccdStop():
    return ccs.SendCommand(getCcdEnv(), ccdServer, "STOP")
Exemplo n.º 6
0
def ccdWait():
    return ccs.SendCommand(getCcdEnv(), ccdServer, "WAIT")
Exemplo n.º 7
0
def ccdStart():
    return ccs.SendCommand(getCcdEnv(), ccdServer, "START")
Exemplo n.º 8
0
def ccdSetup(buffer):
    #buffer = dict(buffer,**ccdBuffer)
    return ccs.SendCommand(getCcdEnv(), ccdServer, "SETUP",
                           "-function " + buffer2param(buffer))
Exemplo n.º 9
0
def moveAz(angle):
    return ccs.SendCommand(getAzEnv(), azServer, "PRESET",
                           "abs,%.4f,600" % angle)