diff --git a/.gitignore b/.gitignore index 60c6519f7724a7ca08cac3263b595400dba9fdd2..6841e3ee2682fb0d5660e2491c5b03ac34f6957e 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ **/.project **/.pydevproject **/.settings/org.eclipse.core.resources.prefs +docs/build tangostationcontrol/dist tangostationcontrol/build **/.ipynb_checkpoints diff --git a/CDB/LOFAR_ConfigDb.json b/CDB/LOFAR_ConfigDb.json index 6886437ce7cf02ee741b5b70f07ebfbf71b08b4d..60b0115925b2ccf01bd27b3e0d072a17c78d580f 100644 --- a/CDB/LOFAR_ConfigDb.json +++ b/CDB/LOFAR_ConfigDb.json @@ -21,6 +21,13 @@ } } }, + "Beam": { + "STAT": { + "Beam": { + "STAT/Beam/1": {} + } + } + }, "boot": { "STAT": { "Boot": { diff --git a/docker-compose/device-beam.yml b/docker-compose/device-beam.yml new file mode 100644 index 0000000000000000000000000000000000000000..97385f16492ec123044033713d0c7b835d2062fd --- /dev/null +++ b/docker-compose/device-beam.yml @@ -0,0 +1,33 @@ +# +# Requires: +# - lofar-device-base.yml +# +version: '2' + +services: + device-beam: + image: device-beam + # build explicitly, as docker-compose does not understand a local image + # being shared among services. + build: + context: lofar-device-base + args: + SOURCE_IMAGE: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}-tango-itango:${TANGO_ITANGO_VERSION} + container_name: ${CONTAINER_NAME_PREFIX}device-beam + networks: + - control + ports: + - "5711:5711" # unique port for this DS + extra_hosts: + - "host.docker.internal:host-gateway" + volumes: + - ..:/opt/lofar/tango:rw + environment: + - TANGO_HOST=${TANGO_HOST} + working_dir: /opt/lofar/tango + entrypoint: + - bin/start-ds.sh + # 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 + - l2ss-beam Beam STAT -v -ORBendPoint giop:tcp:0:5711 -ORBendPointPublish giop:tcp:${HOSTNAME}:5711 + restart: unless-stopped diff --git a/docker-compose/jupyter/ipython-profiles/stationcontrol-jupyter/startup/01-devices.py b/docker-compose/jupyter/ipython-profiles/stationcontrol-jupyter/startup/01-devices.py index 74692f10fff62684c21047eb373aebd70a876155..03e7b75b4649c79647c5bb573b22e41eb330c159 100644 --- a/docker-compose/jupyter/ipython-profiles/stationcontrol-jupyter/startup/01-devices.py +++ b/docker-compose/jupyter/ipython-profiles/stationcontrol-jupyter/startup/01-devices.py @@ -7,7 +7,8 @@ sst = DeviceProxy("STAT/SST/1") xst = DeviceProxy("STAT/XST/1") unb2 = DeviceProxy("STAT/UNB2/1") boot = DeviceProxy("STAT/Boot/1") +beam = DeviceProxy("STAT/Beam/1") docker = DeviceProxy("STAT/Docker/1") # Put them in a list in case one wants to iterate -devices = [apsct, apspu, recv, sdp, sst, xst, unb2, boot, docker] +devices = [apsct, apspu, recv, sdp, sst, xst, unb2, boot, beam, docker] diff --git a/docs/source/devices/beam.rst b/docs/source/devices/beam.rst new file mode 100644 index 0000000000000000000000000000000000000000..c469162dfe25fafc1c79cecae15c7e1b36cf47e4 --- /dev/null +++ b/docs/source/devices/beam.rst @@ -0,0 +1,8 @@ +Beam +==================== + +The ``beam == DeviceProxy("STAT/Beam/1")`` device sets up the beamforming on the station: + +- The HBA tiles in RECV need *analog beamforming* to combine their 16 antennas into a single input for the RCU, +- THe LBAs or HBA tiles need *digital beamforming* in SDP to combine their signals into beamlets. + diff --git a/docs/source/index.rst b/docs/source/index.rst index 119d95164313538606e9f310f2e65ca6aca233d8..7baab29343d3f7c4015e6ed60e6ea4692e6073e3 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -19,6 +19,7 @@ Even without having access to any LOFAR2.0 hardware, you can install the full st installation interfaces/overview devices/using + devices/beam devices/boot devices/docker devices/recv diff --git a/sbin/run_integration_test.sh b/sbin/run_integration_test.sh index c3c37983ae63688658211337ebc17e83fa7ff546..5ec1d299b13199f299b0a9ec73bf4bdeafa0350c 100755 --- a/sbin/run_integration_test.sh +++ b/sbin/run_integration_test.sh @@ -15,7 +15,7 @@ cd "$LOFAR20_DIR/docker-compose" || exit 1 make build # Start and stop sequence -make stop device-boot device-docker device-apsct device-apspu device-sdp device-recv device-sst device-unb2 device-xst sdptr-sim recv-sim unb2-sim apsct-sim apspu-sim +make stop device-boot device-docker device-apsct device-apspu device-sdp device-recv device-sst device-unb2 device-xst device-beam sdptr-sim recv-sim unb2-sim apsct-sim apspu-sim make start databaseds dsconfig elk # Give dsconfig and databaseds time to start @@ -32,7 +32,7 @@ make start sdptr-sim recv-sim unb2-sim apsct-sim apspu-sim # Give the simulators time to start sleep 5 -make start device-boot device-apsct device-apspu device-sdp device-recv device-sst device-unb2 device-xst +make start device-boot device-apsct device-apspu device-sdp device-recv device-sst device-unb2 device-xst device-beam # Give devices time to restart # TODO(Corne Lukken): Use a nicer more reliable mechanism diff --git a/tangostationcontrol/setup.cfg b/tangostationcontrol/setup.cfg index e6101c890893c961e1eff27ce3d3ab4e019ea312..31662e40d639c2af2de417e734e794dc5679d4a4 100644 --- a/tangostationcontrol/setup.cfg +++ b/tangostationcontrol/setup.cfg @@ -36,6 +36,7 @@ where=./ console_scripts = l2ss-apsct = tangostationcontrol.devices.apsct:main l2ss-apspu = tangostationcontrol.devices.apspu:main + l2ss-beam = tangostationcontrol.devices.beam:main l2ss-boot = tangostationcontrol.devices.boot:main l2ss-docker-device = tangostationcontrol.devices.docker_device:main l2ss-observation = tangostationcontrol.devices.observation:main diff --git a/tangostationcontrol/tangostationcontrol/devices/README.md b/tangostationcontrol/tangostationcontrol/devices/README.md index 0c87cc56c040ce971ac012fcee534a61bb711ecf..f546fb339077c328e55dfd359c8cb23ccfbd64d1 100644 --- a/tangostationcontrol/tangostationcontrol/devices/README.md +++ b/tangostationcontrol/tangostationcontrol/devices/README.md @@ -10,6 +10,9 @@ If a new device is added, it will (likely) need to be referenced in several plac - Adjust `docker-compose/jupyter/ipython-profiles/stationcontrol-jupyter/startup/01-devices.py` to make an alias for it available in Jupyter, - Adjust `tangostationcontrol/tangostationcontrol/devices/boot.py` to add the device to the station initialisation sequence, - Add to `docker-compose/` to create a YaML file to start the device in a docker container. NOTE: it needs a unique 57xx port assigned, +- Adjust `tangostationcontrol/setup.cfg` to add an entry point for the device in the package installation, - Add to `tangostationcontrol/tangostationcontrol/integration_test/devices/` to add an integration test, - Adjust `sbin/run_integration_test.sh` to have the device started when running the integration tests, - Add to `docs/source/devices/` to mention the device in the end-user documentation. +- Adjust `docs/source/index.rst` to include the newly created file in `docs/source/devices/`. + diff --git a/tangostationcontrol/tangostationcontrol/devices/beam.py b/tangostationcontrol/tangostationcontrol/devices/beam.py new file mode 100644 index 0000000000000000000000000000000000000000..1711a8a89f9db0e73cc4bf2fd38e81a7a95ded01 --- /dev/null +++ b/tangostationcontrol/tangostationcontrol/devices/beam.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# +# Distributed under the terms of the APACHE license. +# See LICENSE.txt for more info. + +""" Beam Device Server for LOFAR2.0 + +""" + +# PyTango imports +from tango import AttrWriteType +import numpy +# Additional import + +from tangostationcontrol.devices.device_decorators import * +from tangostationcontrol.common.entrypoint import entry +from tangostationcontrol.clients.attribute_wrapper import attribute_wrapper +from tangostationcontrol.devices.lofar_device import lofar_device +from tangostationcontrol.common.lofar_logging import device_logging_to_python, log_exceptions + +__all__ = ["Beam", "main"] + + +@device_logging_to_python() +class Beam(lofar_device): + # ----------------- + # Device Properties + # ----------------- + + # ---------- + # Attributes + # ---------- + + pass + + # -------- + # overloaded functions + # -------- + + + # -------- + # Commands + # -------- + + +# ---------- +# Run server +# ---------- +def main(**kwargs): + """Main function of the ObservationControl module.""" + return entry(Beam, **kwargs) diff --git a/tangostationcontrol/tangostationcontrol/devices/boot.py b/tangostationcontrol/tangostationcontrol/devices/boot.py index c4df70bf5027a8068a1e58326c5ad442e63ad4fc..5f2e9b76e47a9ed61207a07fbc0584ec355b6620 100644 --- a/tangostationcontrol/tangostationcontrol/devices/boot.py +++ b/tangostationcontrol/tangostationcontrol/devices/boot.py @@ -251,6 +251,7 @@ class Boot(lofar_device): "STAT/SDP/1", # SDP controls the mask for SST/XST/BST, so initialise it first "STAT/SST/1", "STAT/XST/1", + "STAT/Beam/1", # Accesses RECV and SDP ], ) diff --git a/tangostationcontrol/tangostationcontrol/integration_test/devices/test_device_beam.py b/tangostationcontrol/tangostationcontrol/integration_test/devices/test_device_beam.py new file mode 100644 index 0000000000000000000000000000000000000000..b6be958cfde3b9f236947e9b1b76195c844bad40 --- /dev/null +++ b/tangostationcontrol/tangostationcontrol/integration_test/devices/test_device_beam.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# +# This file is part of the LOFAR 2.0 Station Software +# +# +# +# Distributed under the terms of the APACHE license. +# See LICENSE.txt for more info. + +from .base import AbstractTestBases + +class TestDeviceBeam(AbstractTestBases.TestDeviceBase): + + def setUp(self): + super().setUp("STAT/Beam/1")