Delta Automation Tests

17:19
  • Source Found, Loop closed, everything optimized OK.
  • Hexapod: -4.1 -1.9 0.705 -177.8 239.4
18:14
  • This works, not sure how "safe" it is (won't hurt the hardware).
#! /usr/bin/env python

import time
import os
from AdOpt import AOIce

aoarb=AOIce.AOARBProxy()

bob = os.fork()

if bob==0:
aoarb.AcquireRefAO()
else:
print("bob")
time.sleep(1)
aoarb.CenterStar()
aoarb.CenterPupils()
aoarb.CheckFlux()
aoarb.CloseLoop()
aoarb.OptimizeGain()
aoarb.ApplyOpticalGain()
aoarb.Done()
print("bob")
time.sleep(1)
print("bob")

aoarb.StartAO()
print("bob")
time.sleep(10)
print("bob")
aoarb.Stop("bob")

#print(aoarb.RequestAOStatus())

  • Possibly "Safer" version, two programs.

testyIce.py

#! /usr/bin/env python

from AdOpt import AOIce

aoarb=AOIce.AOARBProxy()

aoarb.AcquireRefAO()

main program

#! /usr/bin/env python

import time
import os
from AdOpt import AOIce

aoarb=AOIce.AOARBProxy()

os.system("./testyIce.py &")

#bob = os.fork()

#if bob==0:
# aoarb.AcquireRefAO()
#else:
#print("bob")
#time.sleep(1)
aoarb.CenterStar()
aoarb.CenterPupils()
aoarb.CheckFlux()
aoarb.CloseLoop()
aoarb.OptimizeGain()
aoarb.ApplyOpticalGain()
aoarb.Done()
#print("bob")
#time.sleep(1)
#print("bob")

aoarb.StartAO()
print("bob")
time.sleep(10)
print("bob")
aoarb.Stop("bob")

  • Test that does each step and gets back the status
#! /usr/bin/env python

import time
import os
from AdOpt import AOIce

aoarb=AOIce.AOARBProxy()

os.system("./testyIce.py &")

#bob = os.fork()

#if bob==0:
# aoarb.AcquireRefAO()
#else:
print("bob")
time.sleep(1)
aoarb.CenterStar()
print(aoarb.RequestAOStatus().statusLED[1])
aoarb.CenterPupils()
print(aoarb.RequestAOStatus().statusLED[2])
aoarb.CheckFlux()
print(aoarb.RequestAOStatus().statusLED[3])
aoarb.CloseLoop()
print(aoarb.RequestAOStatus().statusLED[4])
aoarb.OptimizeGain()
print(aoarb.RequestAOStatus().statusLED[5])
aoarb.ApplyOpticalGain()
print(aoarb.RequestAOStatus().statusLED[6])
aoarb.Done()
print("bob")
time.sleep(1)
print("bob")

aoarb.StartAO()
print("bob")
time.sleep(10)
print("bob")
aoarb.Stop("bob")

#print(aoarb.RequestAOStatus())

  • Testing the functionality outlined below:
Hi Greg,

so it works like this: in PyModules /AdOpt/AOIce.py there are helper functions to setup the ICE interface from python. They haven't been used much, but anyway there are three proxies for the three arbitrators:

from AdOpt import AOIce

AOIce.pyramidFlaoProxy()

AOIce.adSecArbFlaoProxy()

AOIce.AOARBProxy()

If you instantiate the third one, you should be able to use it for all the commands defined in the corresponding ICE interface, which is defined in lib/iceIF/aoArb.ice. For example, you should be able to write, from any Python terminal:

aoarb = AOIce.AOARBProxy()

aoarb.CenterStar()

and that's exactly the same as pressing the "CenterStar" button on the FLAO GUI.

You should also be able to call this:

aoarb.RequestAOStatus()

and get back a structure with lots of details on the AO status. You can have a look at the aoArb.ice file to see the list of commands/requests that can be sent

If you need more examples, the program script/pupilCalibrator.py is basically the only one actually using this ICE python module, and mostly chats with the WFS arbitrator.

On Thu, Jan 25, 2024 at 10:17 PM Greg Taylor <gtaylor@lbto.org> wrote:

Awesome!

On 1/25/24 2:10 PM, Alfio Puglisi wrote:
Hi Greg, the short answer is yes, it is possible to send commands from Python.

I'll get back to you tomorrow with some examples

Alfio

On Thu, Jan 25, 2024 at 8:19 PM Greg Taylor <gtaylor@lbto.org> wrote:

Alfio,

I asked Fabio this question, but he must be too busy.



-------- Forwarded Message --------

Subject: Question
Date: Tue, 23 Jan 2024 17:59:49 -0700
From: Greg Taylor <gtaylor@lbto.org>
To: fabio Rossi <fabio.rossi@inaf.it>


Ciao Fabio,

I'm curious about the Python Ice interface on the AdSec computers. Is it possible to send and receive the commands and signals that the FLAO GUI sends and receives, from Python? If so, how?

Thanks!

-- GregoryTaylor - 02 Feb 2024
Topic revision: r1 - 02 Feb 2024, GregoryTaylor
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback