Skip to content
Snippets Groups Projects
Commit d22256e6 authored by Stefano Di Frischia's avatar Stefano Di Frischia
Browse files

Merge branch 'master' into L2SS-405-archiving-setup-production

parents fa50d8cb cfd036df
No related branches found
No related tags found
1 merge request!265Resolve L2SS-405 "Archiving setup production"
Showing
with 1247 additions and 83 deletions
...@@ -97,7 +97,7 @@ docker_build_image_all: ...@@ -97,7 +97,7 @@ docker_build_image_all:
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh unb2-sim latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh unb2-sim latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-apsct latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-apsct latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-apspu latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-apspu latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-beam latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-tilebeam latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-beamlet latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-beamlet latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-boot latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-boot latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-docker latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-docker latest
...@@ -252,17 +252,17 @@ docker_build_image_device_apspu: ...@@ -252,17 +252,17 @@ docker_build_image_device_apspu:
script: script:
# Do not remove 'bash' or statement will be ignored by primitive docker shell # Do not remove 'bash' or statement will be ignored by primitive docker shell
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-apspu $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-apspu $tag
docker_build_image_device_beam: docker_build_image_device_tilebeam:
extends: .base_docker_images_except extends: .base_docker_images_except
only: only:
refs: refs:
- merge_requests - merge_requests
changes: changes:
- docker-compose/device-beam.yml - docker-compose/device-tilebeam.yml
- docker-compose/lofar-device-base/* - docker-compose/lofar-device-base/*
script: script:
# Do not remove 'bash' or statement will be ignored by primitive docker shell # Do not remove 'bash' or statement will be ignored by primitive docker shell
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-beam $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-tilebeam $tag
docker_build_image_device_beamlet: docker_build_image_device_beamlet:
extends: .base_docker_images_except extends: .base_docker_images_except
only: only:
......
...@@ -2,3 +2,6 @@ ...@@ -2,3 +2,6 @@
path = docker-compose/tango-prometheus-exporter/ska-tango-grafana-exporter path = docker-compose/tango-prometheus-exporter/ska-tango-grafana-exporter
url = https://git.astron.nl/lofar2.0/ska-tango-grafana-exporter.git url = https://git.astron.nl/lofar2.0/ska-tango-grafana-exporter.git
branch = station-control branch = station-control
[submodule "tangostationcontrol/tangostationcontrol/toolkit/libhdbpp-python"]
path = tangostationcontrol/tangostationcontrol/toolkit/libhdbpp-python
url = https://gitlab.com/tango-controls/hdbpp/libhdbpp-python
...@@ -14,10 +14,10 @@ ...@@ -14,10 +14,10 @@
} }
} }
}, },
"Beam": { "TileBeam": {
"STAT": { "STAT": {
"Beam": { "TileBeam": {
"STAT/Beam/1": {} "STAT/TileBeam/1": {}
} }
} }
}, },
......
...@@ -5,6 +5,21 @@ ...@@ -5,6 +5,21 @@
Station Control software related to Tango devices. Station Control software related to Tango devices.
# Index
* [Docker compose documentation](docker-compose/README.md)
* [Timescaledb](docker-compose/timescaledb/README.md)
* [Jupyter startup files](docker-compose/jupyter/ipython-profiles/stationcontrol-jupyter/startup/README.md)
* [Tango Prometheus exporter](https://git.astron.nl/lofar2.0/ska-tango-grafana-exporter)
* [ReadTheDocs (Sphinx / ReStructuredText) documentation](tangostationcontrol/docs/README.md)
* Source code documentation
* [Attribute wrapper documentation](tangostationcontrol/tangostationcontrol/clients/README.md)
* [Archiver documentation](tangostationcontrol/tangostationcontrol/toolkit/README.md)
* [Adding a new tango device](tangostationcontrol/tangostationcontrol/devices/README.md)
* [HDF5 statistics](tangostationcontrol/tangostationcontrol/statistics_writer/README.md)
* [Unit tests](tangostationcontrol/tangostationcontrol/test/README.md)
* [Integration tests](tangostationcontrol/tangostationcontrol/integration_test/README.md)
# Installation # Installation
## Prerequisites ## Prerequisites
......
...@@ -8,8 +8,8 @@ volumes: ...@@ -8,8 +8,8 @@ volumes:
iers-data: {} iers-data: {}
services: services:
device-beam: device-tilebeam:
image: device-beam image: device-tilebeam
# build explicitly, as docker-compose does not understand a local image # build explicitly, as docker-compose does not understand a local image
# being shared among services. # being shared among services.
build: build:
...@@ -17,7 +17,7 @@ services: ...@@ -17,7 +17,7 @@ services:
dockerfile: docker-compose/lofar-device-base/Dockerfile dockerfile: docker-compose/lofar-device-base/Dockerfile
args: args:
SOURCE_IMAGE: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}-tango-itango:${TANGO_ITANGO_VERSION} SOURCE_IMAGE: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}-tango-itango:${TANGO_ITANGO_VERSION}
container_name: ${CONTAINER_NAME_PREFIX}device-beam container_name: ${CONTAINER_NAME_PREFIX}device-tilebeam
logging: logging:
driver: "json-file" driver: "json-file"
options: options:
...@@ -39,5 +39,5 @@ services: ...@@ -39,5 +39,5 @@ services:
- bin/start-ds.sh - bin/start-ds.sh
# configure CORBA to _listen_ on 0:port, but tell others we're _reachable_ through ${HOSTNAME}:port, since CORBA # configure CORBA to _listen_ on 0:port, but tell others we're _reachable_ through ${HOSTNAME}:port, since CORBA
# can't know about our Docker port forwarding # can't know about our Docker port forwarding
- l2ss-beam Beam STAT -v -ORBendPoint giop:tcp:0:5711 -ORBendPointPublish giop:tcp:${HOSTNAME}:5711 - l2ss-tilebeam TileBeam STAT -v -ORBendPoint giop:tcp:0:5711 -ORBendPointPublish giop:tcp:${HOSTNAME}:5711
restart: unless-stopped restart: unless-stopped
...@@ -7,9 +7,9 @@ sst = DeviceProxy("STAT/SST/1") ...@@ -7,9 +7,9 @@ sst = DeviceProxy("STAT/SST/1")
xst = DeviceProxy("STAT/XST/1") xst = DeviceProxy("STAT/XST/1")
unb2 = DeviceProxy("STAT/UNB2/1") unb2 = DeviceProxy("STAT/UNB2/1")
boot = DeviceProxy("STAT/Boot/1") boot = DeviceProxy("STAT/Boot/1")
beam = DeviceProxy("STAT/Beam/1") tilebeam = DeviceProxy("STAT/TileBeam/1")
beamlet = DeviceProxy("STAT/Beamlet/1") beamlet = DeviceProxy("STAT/Beamlet/1")
docker = DeviceProxy("STAT/Docker/1") docker = DeviceProxy("STAT/Docker/1")
# Put them in a list in case one wants to iterate # Put them in a list in case one wants to iterate
devices = [apsct, apspu, recv, sdp, sst, xst, unb2, boot, beam, beamlet, docker] devices = [apsct, apspu, recv, sdp, sst, xst, unb2, boot, tilebeam, beamlet, docker]
%% Cell type:code id:87c924c0 tags: %% Cell type:code id:87c924c0 tags:
``` python ``` python
import time, sys, datetime import time, sys, datetime
import numpy import numpy
sys.path.append('/hosthome/tango/tangostationcontrol/tangostationcontrol') sys.path.append('/hosthome/tango/tangostationcontrol/tangostationcontrol')
from beam.delays import delay_calculator from beam.delays import delay_calculator
``` ```
%% Cell type:code id:438a5eb9 tags: %% Cell type:code id:438a5eb9 tags:
``` python ``` python
# RECV device # RECV device
device_name = 'STAT/RECV/1' device_name = 'STAT/RECV/1'
d=DeviceProxy(device_name) d=DeviceProxy(device_name)
state = str(d.state()) state = str(d.state())
print(device_name + ' : ' + state) print(device_name + ' : ' + state)
``` ```
%% Output %% Output
STAT/RECV/1 : OFF STAT/RECV/1 : OFF
%% Cell type:code id:3df10bdf tags: %% Cell type:code id:3df10bdf tags:
``` python ``` python
# Start RECV device # Start RECV device
if state == "OFF": if state == "OFF":
time.sleep(1) time.sleep(1)
d.initialise() d.initialise()
time.sleep(1) time.sleep(1)
state = str(d.state()) state = str(d.state())
if state == "STANDBY": if state == "STANDBY":
d.set_defaults() d.set_defaults()
d.on() d.on()
state = str(d.state()) state = str(d.state())
if state == "ON": if state == "ON":
print(f"Device {device_name} is now in ON state") print(f"Device {device_name} is now in ON state")
``` ```
%% Output %% Output
Device STAT/RECV/1 is now in ON state Device STAT/RECV/1 is now in ON state
%% Cell type:code id:8d90ad2c tags: %% Cell type:code id:8d90ad2c tags:
``` python ``` python
# Test RECV properties # Test RECV properties
recv = d recv = d
print(32==len(recv.get_hbat_bf_delay_step_delays())) print(32==len(recv.get_hbat_bf_delay_step_delays()))
print(288==len(recv.get_hbat_reference_itrf())) print(288==len(recv.get_hbat_reference_itrf()))
print(4608==len(recv.get_hbat_antenna_itrf())) print(4608==len(recv.get_hbat_antenna_itrf()))
print(3072==len(recv.get_hbat_signal_input_delays())) print(3072==len(recv.get_hbat_signal_input_delays()))
``` ```
%% Output %% Output
True True
True True
True True
True True
%% Cell type:code id:58a52064 tags: %% Cell type:code id:58a52064 tags:
``` python ``` python
# Beam device # TileBeam device
b_name = 'STAT/Beam/1' tb_name = 'STAT/TileBeam/1'
b = DeviceProxy(b_name) tb = DeviceProxy(tb_name)
state = str(b.state()) state = str(tb.state())
print(b_name + ' : ' + state) print(tb_name + ' : ' + state)
``` ```
%% Output %% Output
STAT/Beam/1 : OFF STAT/Beam/1 : OFF
%% Cell type:code id:79028ac4 tags: %% Cell type:code id:79028ac4 tags:
``` python ``` python
# Start Beam device # Start Beam device
if state == "OFF": if state == "OFF":
time.sleep(1) time.sleep(1)
b.initialise() tb.initialise()
time.sleep(1) time.sleep(1)
state = str(b.state()) state = str(tb.state())
if state == "STANDBY": if state == "STANDBY":
b.set_defaults() tb.set_defaults()
b.on() tb.on()
state = str(b.state()) state = str(tb.state())
if state == "ON": if state == "ON":
print(f"Device {b_name} is now in ON state") print(f"Device {tb_name} is now in ON state")
``` ```
%% Output %% Output
Device STAT/Beam/1 is now in ON state Device STAT/Beam/1 is now in ON state
%% Cell type:code id:eaf2716c tags: %% Cell type:code id:eaf2716c tags:
``` python ``` python
# Test Beam attribute # Test Beam attribute
beam = b tilebeam = tb
print(96==len(beam.HBAT_pointing_direction_R)) print(96==len(tilebeam.HBAT_pointing_direction_R))
print(96==len(beam.HBAT_pointing_timestamp_R)) print(96==len(tilebeam.HBAT_pointing_timestamp_R))
``` ```
%% Output %% Output
True True
True True
%% Cell type:code id:b7336c9f tags: %% Cell type:code id:b7336c9f tags:
``` python ``` python
# Test HBAT delays # Test HBAT delays
pointing_direction = numpy.array([["J2000","0deg","0deg"]] * 96).flatten() pointing_direction = numpy.array([["J2000","0deg","0deg"]] * 96).flatten()
delays = b.HBAT_delays(pointing_direction) delays = tb.HBAT_delays(pointing_direction)
print(delays) print(delays)
print(96*16==len(delays)) print(96*16==len(delays))
``` ```
%% Output %% Output
[1.05088616e-07 1.05088616e-07 1.05088616e-07 ... 1.05088616e-07 [1.05088616e-07 1.05088616e-07 1.05088616e-07 ... 1.05088616e-07
1.05088616e-07 1.05088616e-07] 1.05088616e-07 1.05088616e-07]
True True
%% Cell type:code id:8cdc47c6 tags: %% Cell type:code id:8cdc47c6 tags:
``` python ``` python
# Test calculate HBAT beamforming delays # Test calculate HBAT beamforming delays
HBAT_bf_delays = recv.calculate_HBAT_bf_delays(delays) HBAT_bf_delays = recv.calculate_HBAT_bf_delays(delays)
print(HBAT_bf_delays) print(HBAT_bf_delays)
print(96*32==len(HBAT_bf_delays)) print(96*32==len(HBAT_bf_delays))
``` ```
%% Output %% Output
[31. 31. 31. ... 31. 31. 31.] [31. 31. 31. ... 31. 31. 31.]
True True
%% Cell type:code id:294b46a6 tags: %% Cell type:code id:294b46a6 tags:
``` python ``` python
# Test whole main function # Test whole main function
print(recv.read_attribute('HBAT_BF_delays_RW').value) print(recv.read_attribute('HBAT_BF_delays_RW').value)
beam.HBAT_set_pointing(pointing_direction) tilebeam.HBAT_set_pointing(pointing_direction)
print(recv.read_attribute('HBAT_BF_delays_RW').value) print(recv.read_attribute('HBAT_BF_delays_RW').value)
``` ```
%% Output %% Output
[[0 0 0 ... 0 0 0] [[0 0 0 ... 0 0 0]
[0 0 0 ... 0 0 0] [0 0 0 ... 0 0 0]
[0 0 0 ... 0 0 0] [0 0 0 ... 0 0 0]
... ...
[0 0 0 ... 0 0 0] [0 0 0 ... 0 0 0]
[0 0 0 ... 0 0 0] [0 0 0 ... 0 0 0]
[0 0 0 ... 0 0 0]] [0 0 0 ... 0 0 0]]
[[31 31 31 ... 31 31 31] [[31 31 31 ... 31 31 31]
[31 31 31 ... 31 31 31] [31 31 31 ... 31 31 31]
[31 31 31 ... 31 31 31] [31 31 31 ... 31 31 31]
... ...
[31 31 31 ... 31 31 31] [31 31 31 ... 31 31 31]
[31 31 31 ... 31 31 31] [31 31 31 ... 31 31 31]
[31 31 31 ... 31 31 31]] [31 31 31 ... 31 31 31]]
%% Cell type:code id:d5c2f175 tags: %% Cell type:code id:d5c2f175 tags:
``` python ``` python
``` ```
......
This diff is collapsed.
%% Cell type:code id:fa2af747 tags: %% Cell type:code id:fa2af747 tags:
``` python ``` python
import time import time
``` ```
%% Cell type:code id:e09282f3 tags: %% Cell type:code id:e09282f3 tags:
``` python ``` python
# point all tiles at the horizon at 24° # point all tiles at the horizon at 24°
beam.HBAT_pointing_direction_RW=[("AZELGEO","24deg","0deg")]*96 tilebeam.HBAT_pointing_direction_RW=[("AZELGEO","24deg","0deg")]*96
# wait for pointing to be applied # wait for pointing to be applied
time.sleep(0.5) time.sleep(0.5)
# obtain and print delays # obtain and print delays
steps = recv.HBAT_BF_delay_steps_RW[0].reshape(2,4,4)[0] steps = recv.HBAT_BF_delay_steps_RW[0].reshape(2,4,4)[0]
steps steps
``` ```
%% Output %% Output
array([[28, 28, 28, 28], array([[28, 28, 28, 28],
[19, 19, 19, 19], [19, 19, 19, 19],
[11, 11, 11, 11], [11, 11, 11, 11],
[ 3, 3, 3, 3]]) [ 3, 3, 3, 3]])
%% Cell type:code id:1fe719f3 tags: %% Cell type:code id:1fe719f3 tags:
``` python ``` python
# process these angles # process these angles
angles = (0, 90, 180, 270) angles = (0, 90, 180, 270)
directions = ["North", "East", "South", "West"] directions = ["North", "East", "South", "West"]
``` ```
%% Cell type:code id:68c7c8a3 tags: %% Cell type:code id:68c7c8a3 tags:
``` python ``` python
for angle, direction in zip(angles, directions): for angle, direction in zip(angles, directions):
# set angles # set angles
beam.HBAT_pointing_direction_RW=[("AZELGEO",f"{angle}deg","0deg")]*96 tilebeam.HBAT_pointing_direction_RW=[("AZELGEO",f"{angle}deg","0deg")]*96
# obtain delays # obtain delays
time.sleep(0.5) time.sleep(0.5)
steps = recv.HBAT_BF_delay_steps_RW[0].reshape(2,4,4)[0] steps = recv.HBAT_BF_delay_steps_RW[0].reshape(2,4,4)[0]
print(f"Pointing {direction}") print(f"Pointing {direction}")
print(steps) print(steps)
print() print()
``` ```
%% Output %% Output
Pointing North Pointing North
[[31 29 25 22] [[31 29 25 22]
[24 21 17 14] [24 21 17 14]
[17 14 10 7] [17 14 10 7]
[ 9 6 2 0]] [ 9 6 2 0]]
Pointing East Pointing East
[[ 9 17 24 31] [[ 9 17 24 31]
[ 6 14 21 29] [ 6 14 21 29]
[ 2 10 17 25] [ 2 10 17 25]
[ 0 7 14 22]] [ 0 7 14 22]]
Pointing South Pointing South
[[ 0 2 6 9] [[ 0 2 6 9]
[ 7 10 14 17] [ 7 10 14 17]
[14 17 21 24] [14 17 21 24]
[22 25 29 31]] [22 25 29 31]]
Pointing West Pointing West
[[22 14 7 0] [[22 14 7 0]
[25 17 10 2] [25 17 10 2]
[29 21 14 6] [29 21 14 6]
[31 24 17 9]] [31 24 17 9]]
%% Cell type:code id:48367453 tags: %% Cell type:code id:48367453 tags:
``` python ``` python
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
from matplotlib import transforms from matplotlib import transforms
``` ```
%% Cell type:code id:a38c8165 tags: %% Cell type:code id:a38c8165 tags:
``` python ``` python
# process these angles # process these angles
angles = (0, 90, 180, 270, 24) angles = (0, 90, 180, 270, 24)
directions = ["North", "East", "South", "West", "24 ° (~NNE)"] directions = ["North", "East", "South", "West", "24 ° (~NNE)"]
fig, axs = plt.subplots(nrows=1, ncols=5, figsize=(15, 10), fig, axs = plt.subplots(nrows=1, ncols=5, figsize=(15, 10),
subplot_kw={'xticks': [], 'yticks': []}) subplot_kw={'xticks': [], 'yticks': []})
for idx, (angle, direction) in enumerate(zip(angles, directions)): for idx, (angle, direction) in enumerate(zip(angles, directions)):
# set angles # set angles
beam.HBAT_pointing_direction_RW=[("AZELGEO",f"{angle}deg","0deg")]*96 tilebeam.HBAT_pointing_direction_RW=[("AZELGEO",f"{angle}deg","0deg")]*96
# obtain delays # obtain delays
time.sleep(0.5) time.sleep(0.5)
steps = recv.HBAT_BF_delay_steps_RW[0].reshape(2,4,4)[0] steps = recv.HBAT_BF_delay_steps_RW[0].reshape(2,4,4)[0]
# plot on top row # plot on top row
ax = axs[idx] ax = axs[idx]
im = ax.imshow(steps, origin="upper") im = ax.imshow(steps, origin="upper")
im.set_transform(transforms.Affine2D().rotate_deg(24) + ax.transData) im.set_transform(transforms.Affine2D().rotate_deg(24) + ax.transData)
ax.set_title(f"Pointing {direction}") ax.set_title(f"Pointing {direction}")
ax.set_xlim(-2, 4) ax.set_xlim(-2, 4)
ax.set_ylim(5, -1) ax.set_ylim(5, -1)
plt.tight_layout() plt.tight_layout()
plt.show() plt.show()
``` ```
%% Output %% Output
%% Cell type:code id:699c6510 tags: %% Cell type:code id:699c6510 tags:
``` python ``` python
``` ```
......
...@@ -14,13 +14,13 @@ cd "$LOFAR20_DIR/docker-compose" || exit 1 ...@@ -14,13 +14,13 @@ cd "$LOFAR20_DIR/docker-compose" || exit 1
# Build only the required images, please do not build everything that makes CI # Build only the required images, please do not build everything that makes CI
# take really long to finish, especially grafana / jupyter / prometheus. # take really long to finish, especially grafana / jupyter / prometheus.
# jupyter is physically large > 2.5gb and overlayfs is really slow. # jupyter is physically large > 2.5gb and overlayfs is really slow.
make build device-sdp device-recv device-sst device-unb2 device-xst device-beamlet device-beam make build device-sdp device-recv device-sst device-unb2 device-xst device-beamlet device-tilebeam
make build sdptr-sim recv-sim unb2-sim apsct-sim apspu-sim make build sdptr-sim recv-sim unb2-sim apsct-sim apspu-sim
make build databaseds dsconfig elk integration-test make build databaseds dsconfig elk integration-test
make build archiver-timescale hdbppts-cm hdbppts-es make build archiver-timescale hdbppts-cm hdbppts-es
# Start and stop sequence # Start and stop sequence
make stop device-boot device-docker device-apsct device-apspu device-sdp device-recv device-sst device-unb2 device-xst device-beamlet device-beam sdptr-sim recv-sim unb2-sim apsct-sim apspu-sim hdbppts-es hdbppts-cm archiver-timescale make stop device-boot device-docker device-apsct device-apspu device-sdp device-recv device-sst device-unb2 device-xst device-beamlet device-tilebeam sdptr-sim recv-sim unb2-sim apsct-sim apspu-sim hdbppts-es hdbppts-cm archiver-timescale
make start databaseds dsconfig elk make start databaseds dsconfig elk
# Give dsconfig and databaseds time to start # Give dsconfig and databaseds time to start
...@@ -38,7 +38,7 @@ make start sdptr-sim recv-sim unb2-sim apsct-sim apspu-sim ...@@ -38,7 +38,7 @@ make start sdptr-sim recv-sim unb2-sim apsct-sim apspu-sim
# Give the simulators time to start # Give the simulators time to start
sleep 5 sleep 5
make start device-boot device-apsct device-apspu device-sdp device-recv device-sst device-unb2 device-xst device-beam device-beamlet make start device-boot device-apsct device-apspu device-sdp device-recv device-sst device-unb2 device-xst device-tilebeam device-beamlet
# Archive devices -> starting order is important # Archive devices -> starting order is important
make start archiver-timescale hdbppts-cm hdbppts-es make start archiver-timescale hdbppts-cm hdbppts-es
......
# Tango Station Control Device wrappers
This code provides an attribute_wrapper class in place of attributes for tango devices. the attribute wrappers contain additional code
that moves a lot of the complexity and redundant code to the background.
The tango Device class is also abstracted further to a "lofar_device" class. This class wraps
The only things required on the users part are to declare the attributes using the attribute_wrapper (see `example/example_device`),
declare what client the attribute has to use in the initialisation and provide support for the used clients.
To see how to add support for new clients, see `clients/README.md`
In addition it also provides an abstraction to the tango device, specifically for hardware devices. Examples of hardware devices
can be found in TODO and an empty template can be found in `HW_device_template.py`
Requires numpy
```pip install numpy```
Requires opcua
```pip install opcua```
Requires pytango
```pip install pytango```
### usage
You can start the device by calling it in any console with:
<Device_name>.py instance_name
...@@ -34,7 +34,7 @@ Coordinates in a celestial coordinate system result in a different direction dep ...@@ -34,7 +34,7 @@ Coordinates in a celestial coordinate system result in a different direction dep
Positions Positions
-------------------- --------------------
The positions of the antennas are required in ITRF, a carthesian geocentric coordinate system ("XYZ" with its origin at the center of the Earth). These coordinates provide an absolute 3D position on Earth and form the basis for most delay computations. These positions are not stationary however, due to the tectonic plate movement. Instead, we use source coordinates in ETRS89 (also carthesian geocentric), and convert those to ITRF using updated and extrapolated tectonic models (see ``tangostationcontrol.beam.geo.ETRS_to_ITRF``). The positions of the antennas are required in ITRF, a carthesian geocentric coordinate system ("XYZ" with its origin at the center of the Earth). These coordinates provide an absolute 3D position on Earth and form the basis for most delay computations. These positions are not stationary however, due to the tectonic plate movement. Instead, we use source coordinates in ETRS89 (also carthesian geocentric), and convert those to ITRF using updated and extrapolated tectonic models (see ``tangostationcontrol.tilebeam.geo.ETRS_to_ITRF``).
:recv.HBAT_reference_ETRS: (property) The reference position of each HBA tile, in ETRS89. :recv.HBAT_reference_ETRS: (property) The reference position of each HBA tile, in ETRS89.
...@@ -65,7 +65,7 @@ The positions of the elements within an HBA tile are handled differently. Instea ...@@ -65,7 +65,7 @@ The positions of the elements within an HBA tile are handled differently. Instea
- The R axis is roughly down, - The R axis is roughly down,
- The HBA tiles on a station all lie on the same PQ plane, so R == 0. - The HBA tiles on a station all lie on the same PQ plane, so R == 0.
These facts allow us to use the following information to calculate the absolute position of each tile element. The conversion takes the relative offsets of the elements within a tile, rotates them in PQR space, rotates those into relative ETRS offsets, and finally into absolute positions in ETRS. See ``tangostationcontrol.beam.hba_tile`` for these computations. These facts allow us to use the following information to calculate the absolute position of each tile element. The conversion takes the relative offsets of the elements within a tile, rotates them in PQR space, rotates those into relative ETRS offsets, and finally into absolute positions in ETRS. See ``tangostationcontrol.tilebeam.hba_tile`` for these computations.
:recv.HBAT_base_antenna_offsets: (property) The relative offsets of each element within a tile, with respect to the tile's reference position (the center of the ground plane). :recv.HBAT_base_antenna_offsets: (property) The relative offsets of each element within a tile, with respect to the tile's reference position (the center of the ground plane).
......
Beam Beam
==================== ====================
The ``beam == DeviceProxy("STAT/Beam/1")`` device sets up the beamforming on the station. It configures the HBA tile beam former, which adds the signals of its 16 elements within the tile. These element signals can be delayed a configurable amount of time, allowing their sum to become more sensitive in a certain direction. Each tile can have their own pointing direction configured. The ``tilebeam == DeviceProxy("STAT/TileBeam/1")`` device sets up the beamforming on the station. It configures the HBA tile beam former, which adds the signals of its 16 elements within the tile. These element signals can be delayed a configurable amount of time, allowing their sum to become more sensitive in a certain direction. Each tile can have their own pointing direction configured.
Beam Tracking Beam Tracking
-------------------- --------------------
...@@ -81,6 +81,6 @@ We use `python-casacore <https://casacore.github.io/python-casacore/index.html>` ...@@ -81,6 +81,6 @@ We use `python-casacore <https://casacore.github.io/python-casacore/index.html>`
:returns: ``str`` :returns: ``str``
:use_measures(dir): Activate the measures tables in the provided directory. This necessitates turning off and restarting the Beam device, so the command will always appear to fail. Turn the device back and the selected measures tables will be active. :use_measures(dir): Activate the measures tables in the provided directory. This necessitates turning off and restarting the TileBeam device, so the command will always appear to fail. Turn the device back and the selected measures tables will be active.
:returns: ``(does not return)`` :returns: ``(does not return)``
...@@ -19,7 +19,7 @@ Even without having access to any LOFAR2.0 hardware, you can install the full st ...@@ -19,7 +19,7 @@ Even without having access to any LOFAR2.0 hardware, you can install the full st
installation installation
interfaces/overview interfaces/overview
devices/using devices/using
devices/beam devices/tilebeam
devices/beamlet devices/beamlet
devices/boot devices/boot
devices/docker devices/docker
......
...@@ -11,5 +11,5 @@ h5py >= 3.1.0 # BSD ...@@ -11,5 +11,5 @@ h5py >= 3.1.0 # BSD
psutil >= 5.8.0 # BSD psutil >= 5.8.0 # BSD
docker >= 5.0.3 # Apache 2 docker >= 5.0.3 # Apache 2
python-logstash-async >= 2.3.0 # MIT python-logstash-async >= 2.3.0 # MIT
python-casacore >= 3.3.1 # GPL2 python-casacore >= 3.3.1 # LGPLv3
etrs-itrs@git+https://github.com/brentjens/etrs-itrs # license pending etrs-itrs@git+https://github.com/brentjens/etrs-itrs # license pending
...@@ -35,7 +35,7 @@ where=./ ...@@ -35,7 +35,7 @@ where=./
console_scripts = console_scripts =
l2ss-apsct = tangostationcontrol.devices.apsct:main l2ss-apsct = tangostationcontrol.devices.apsct:main
l2ss-apspu = tangostationcontrol.devices.apspu:main l2ss-apspu = tangostationcontrol.devices.apspu:main
l2ss-beam = tangostationcontrol.devices.beam:main l2ss-tilebeam = tangostationcontrol.devices.tilebeam:main
l2ss-beamlet = tangostationcontrol.devices.sdp.beamlet:main l2ss-beamlet = tangostationcontrol.devices.sdp.beamlet:main
l2ss-boot = tangostationcontrol.devices.boot:main l2ss-boot = tangostationcontrol.devices.boot:main
l2ss-docker-device = tangostationcontrol.devices.docker_device:main l2ss-docker-device = tangostationcontrol.devices.docker_device:main
......
...@@ -92,7 +92,7 @@ The attribute wrapper relies on 1 internal file. tango/tangostationcontrol/devic ...@@ -92,7 +92,7 @@ The attribute wrapper relies on 1 internal file. tango/tangostationcontrol/devic
## Closing ## Closing
The advantages of using attribute_wrapper class instead of the standard Tango Attribute class can be noted in the following example where, in the first part, an implementation of the standard class is presented, while in the second part the analogous implementation using an attribute_wrapper is shown. The advantages of using attribute_wrapper class instead of the standard Tango Attribute class can be noted in the following example where, in the first part, an implementation of the standard class is presented, while in the second part the analogous implementation using an attribute_wrapper is shown.
##From official Tango documentation # ## From official Tango documentation
```python ```python
class PowerSupply(Device): class PowerSupply(Device):
......
...@@ -218,7 +218,7 @@ class Boot(lofar_device): ...@@ -218,7 +218,7 @@ class Boot(lofar_device):
DeviceProxy_Time_Out = device_property( DeviceProxy_Time_Out = device_property(
dtype='DevDouble', dtype='DevDouble',
mandatory=False, mandatory=False,
default_value=10.0, default_value=30.0,
) )
# Initialise the hardware when initialising a station. Can end badly when using simulators. # Initialise the hardware when initialising a station. Can end badly when using simulators.
...@@ -241,7 +241,7 @@ class Boot(lofar_device): ...@@ -241,7 +241,7 @@ class Boot(lofar_device):
"STAT/SST/1", "STAT/SST/1",
"STAT/XST/1", "STAT/XST/1",
"STAT/Beamlet/1", "STAT/Beamlet/1",
"STAT/Beam/1", # Accesses RECV and Beamlet "STAT/TileBeam/1", # Accesses RECV and Beamlet
], ],
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment