From 5664fc50eb99504dfebad5c0601c6c5df1ecc115 Mon Sep 17 00:00:00 2001 From: Auke Klazema <klazema@astron.nl> Date: Mon, 14 Mar 2022 17:24:30 +0100 Subject: [PATCH] L2SS-663: Rename Beam device into TileBeam device --- .gitlab-ci.yml | 8 ++-- CDB/LOFAR_ConfigDb.json | 6 +-- .../{device-beam.yml => device-tilebeam.yml} | 8 ++-- .../startup/01-devices.py | 4 +- jupyter-notebooks/Beamforming_Test.ipynb | 38 +++++++++---------- jupyter-notebooks/Tile Beam Steering.ipynb | 12 +++--- sbin/run_integration_test.sh | 6 +-- .../docs/source/beam_tracking.rst | 4 +- .../source/devices/{beam.rst => tilebeam.rst} | 4 +- tangostationcontrol/docs/source/index.rst | 2 +- tangostationcontrol/setup.cfg | 2 +- .../tangostationcontrol/devices/boot.py | 2 +- .../devices/{beam.py => tilebeam.py} | 8 ++-- ...device_beam.py => test_device_tilebeam.py} | 6 +-- .../test/devices/test_beam_device.py | 8 ++-- 15 files changed, 59 insertions(+), 59 deletions(-) rename docker-compose/{device-beam.yml => device-tilebeam.yml} (82%) rename tangostationcontrol/docs/source/devices/{beam.rst => tilebeam.rst} (86%) rename tangostationcontrol/tangostationcontrol/devices/{beam.py => tilebeam.py} (99%) rename tangostationcontrol/tangostationcontrol/integration_test/default/devices/{test_device_beam.py => test_device_tilebeam.py} (97%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4b4dd9211..8437f0727 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 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-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-boot latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh device-docker latest @@ -252,17 +252,17 @@ docker_build_image_device_apspu: script: # 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 -docker_build_image_device_beam: +docker_build_image_device_tilebeam: extends: .base_docker_images_except only: refs: - merge_requests changes: - - docker-compose/device-beam.yml + - docker-compose/device-tilebeam.yml - docker-compose/lofar-device-base/* script: # 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: extends: .base_docker_images_except only: diff --git a/CDB/LOFAR_ConfigDb.json b/CDB/LOFAR_ConfigDb.json index 621c84589..a2ed6f174 100644 --- a/CDB/LOFAR_ConfigDb.json +++ b/CDB/LOFAR_ConfigDb.json @@ -14,10 +14,10 @@ } } }, - "Beam": { + "TileBeam": { "STAT": { - "Beam": { - "STAT/Beam/1": {} + "TileBeam": { + "STAT/TileBeam/1": {} } } }, diff --git a/docker-compose/device-beam.yml b/docker-compose/device-tilebeam.yml similarity index 82% rename from docker-compose/device-beam.yml rename to docker-compose/device-tilebeam.yml index 6a276157f..1d243a6e1 100644 --- a/docker-compose/device-beam.yml +++ b/docker-compose/device-tilebeam.yml @@ -8,8 +8,8 @@ volumes: iers-data: {} services: - device-beam: - image: device-beam + device-tilebeam: + image: device-tilebeam # build explicitly, as docker-compose does not understand a local image # being shared among services. build: @@ -17,7 +17,7 @@ services: dockerfile: docker-compose/lofar-device-base/Dockerfile args: 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: driver: "json-file" options: @@ -39,5 +39,5 @@ services: - 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 + - l2ss-tilebeam TileBeam 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 394979833..82afee40e 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,9 +7,9 @@ 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") +tilebeam = DeviceProxy("STAT/TileBeam/1") beamlet = DeviceProxy("STAT/Beamlet/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, beam, beamlet, docker] +devices = [apsct, apspu, recv, sdp, sst, xst, unb2, boot, tilebeam, beamlet, docker] diff --git a/jupyter-notebooks/Beamforming_Test.ipynb b/jupyter-notebooks/Beamforming_Test.ipynb index 0ae1c7631..323982e34 100644 --- a/jupyter-notebooks/Beamforming_Test.ipynb +++ b/jupyter-notebooks/Beamforming_Test.ipynb @@ -105,11 +105,11 @@ } ], "source": [ - "# Beam device\n", - "b_name = 'STAT/Beam/1'\n", - "b = DeviceProxy(b_name)\n", - "state = str(b.state())\n", - "print(b_name + ' : ' + state)" + "# TileBeam device\n", + "tb_name = 'STAT/TileBeam/1'\n", + "tb = DeviceProxy(tb_name)\n", + "state = str(tb.state())\n", + "print(tb_name + ' : ' + state)" ] }, { @@ -130,15 +130,15 @@ "# Start Beam device\n", "if state == \"OFF\":\n", " time.sleep(1)\n", - " b.initialise()\n", + " tb.initialise()\n", " time.sleep(1)\n", - "state = str(b.state())\n", + "state = str(tb.state())\n", "if state == \"STANDBY\":\n", - " b.set_defaults()\n", - " b.on()\n", - "state = str(b.state())\n", + " tb.set_defaults()\n", + " tb.on()\n", + "state = str(tb.state())\n", "if state == \"ON\":\n", - " print(f\"Device {b_name} is now in ON state\")" + " print(f\"Device {tb_name} is now in ON state\")" ] }, { @@ -158,9 +158,9 @@ ], "source": [ "# Test Beam attribute\n", - "beam = b\n", - "print(96==len(beam.HBAT_pointing_direction_R))\n", - "print(96==len(beam.HBAT_pointing_timestamp_R))" + "tilebeam = tb\n", + "print(96==len(tilebeam.HBAT_pointing_direction_R))\n", + "print(96==len(tilebeam.HBAT_pointing_timestamp_R))" ] }, { @@ -182,7 +182,7 @@ "source": [ "# Test HBAT delays\n", "pointing_direction = numpy.array([[\"J2000\",\"0deg\",\"0deg\"]] * 96).flatten()\n", - "delays = b.HBAT_delays(pointing_direction)\n", + "delays = tb.HBAT_delays(pointing_direction)\n", "print(delays)\n", "print(96*16==len(delays))" ] @@ -239,7 +239,7 @@ "source": [ "# Test whole main function\n", "print(recv.read_attribute('HBAT_BF_delays_RW').value)\n", - "beam.HBAT_set_pointing(pointing_direction)\n", + "tilebeam.HBAT_set_pointing(pointing_direction)\n", "print(recv.read_attribute('HBAT_BF_delays_RW').value)" ] }, @@ -254,9 +254,9 @@ ], "metadata": { "kernelspec": { - "display_name": "StationControl", + "display_name": "Python 3", "language": "python", - "name": "stationcontrol" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -268,7 +268,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.3" + "version": "3.8.10" } }, "nbformat": 4, diff --git a/jupyter-notebooks/Tile Beam Steering.ipynb b/jupyter-notebooks/Tile Beam Steering.ipynb index 8041f6b99..956b8bb15 100644 --- a/jupyter-notebooks/Tile Beam Steering.ipynb +++ b/jupyter-notebooks/Tile Beam Steering.ipynb @@ -32,7 +32,7 @@ ], "source": [ "# point all tiles at the horizon at 24°\n", - "beam.HBAT_pointing_direction_RW=[(\"AZELGEO\",\"24deg\",\"0deg\")]*96\n", + "tilebeam.HBAT_pointing_direction_RW=[(\"AZELGEO\",\"24deg\",\"0deg\")]*96\n", " \n", "# wait for pointing to be applied\n", "time.sleep(0.5)\n", @@ -94,7 +94,7 @@ "source": [ "for angle, direction in zip(angles, directions):\n", " # set angles\n", - " beam.HBAT_pointing_direction_RW=[(\"AZELGEO\",f\"{angle}deg\",\"0deg\")]*96\n", + " tilebeam.HBAT_pointing_direction_RW=[(\"AZELGEO\",f\"{angle}deg\",\"0deg\")]*96\n", " \n", " # obtain delays\n", " time.sleep(0.5)\n", @@ -143,7 +143,7 @@ "\n", "for idx, (angle, direction) in enumerate(zip(angles, directions)):\n", " # set angles\n", - " beam.HBAT_pointing_direction_RW=[(\"AZELGEO\",f\"{angle}deg\",\"0deg\")]*96\n", + " tilebeam.HBAT_pointing_direction_RW=[(\"AZELGEO\",f\"{angle}deg\",\"0deg\")]*96\n", " \n", " # obtain delays\n", " time.sleep(0.5)\n", @@ -172,9 +172,9 @@ ], "metadata": { "kernelspec": { - "display_name": "StationControl", + "display_name": "Python 3", "language": "python", - "name": "stationcontrol" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -186,7 +186,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.3" + "version": "3.8.10" } }, "nbformat": 4, diff --git a/sbin/run_integration_test.sh b/sbin/run_integration_test.sh index 17fa54803..c33514571 100755 --- a/sbin/run_integration_test.sh +++ b/sbin/run_integration_test.sh @@ -14,13 +14,13 @@ cd "$LOFAR20_DIR/docker-compose" || exit 1 # Build only the required images, please do not build everything that makes CI # take really long to finish, especially grafana / jupyter / prometheus. # 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 databaseds dsconfig elk integration-test make build archiver-timescale hdbppts-cm hdbppts-es # 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 # Give dsconfig and databaseds time to start @@ -38,7 +38,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 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 make start archiver-timescale hdbppts-cm hdbppts-es diff --git a/tangostationcontrol/docs/source/beam_tracking.rst b/tangostationcontrol/docs/source/beam_tracking.rst index a689739a5..a9860420a 100644 --- a/tangostationcontrol/docs/source/beam_tracking.rst +++ b/tangostationcontrol/docs/source/beam_tracking.rst @@ -34,7 +34,7 @@ Coordinates in a celestial coordinate system result in a different direction dep 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. @@ -65,7 +65,7 @@ The positions of the elements within an HBA tile are handled differently. Instea - The R axis is roughly down, - 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). diff --git a/tangostationcontrol/docs/source/devices/beam.rst b/tangostationcontrol/docs/source/devices/tilebeam.rst similarity index 86% rename from tangostationcontrol/docs/source/devices/beam.rst rename to tangostationcontrol/docs/source/devices/tilebeam.rst index 8075cde99..e0c4ce810 100644 --- a/tangostationcontrol/docs/source/devices/beam.rst +++ b/tangostationcontrol/docs/source/devices/tilebeam.rst @@ -1,7 +1,7 @@ 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 -------------------- @@ -81,6 +81,6 @@ We use `python-casacore <https://casacore.github.io/python-casacore/index.html>` :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)`` diff --git a/tangostationcontrol/docs/source/index.rst b/tangostationcontrol/docs/source/index.rst index f72e468dd..0fd199ad8 100644 --- a/tangostationcontrol/docs/source/index.rst +++ b/tangostationcontrol/docs/source/index.rst @@ -19,7 +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/tilebeam devices/beamlet devices/boot devices/docker diff --git a/tangostationcontrol/setup.cfg b/tangostationcontrol/setup.cfg index 44e21e97a..cfc0a249b 100644 --- a/tangostationcontrol/setup.cfg +++ b/tangostationcontrol/setup.cfg @@ -35,7 +35,7 @@ where=./ console_scripts = l2ss-apsct = tangostationcontrol.devices.apsct: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-boot = tangostationcontrol.devices.boot:main l2ss-docker-device = tangostationcontrol.devices.docker_device:main diff --git a/tangostationcontrol/tangostationcontrol/devices/boot.py b/tangostationcontrol/tangostationcontrol/devices/boot.py index 3ae76d7f8..f6c694ef7 100644 --- a/tangostationcontrol/tangostationcontrol/devices/boot.py +++ b/tangostationcontrol/tangostationcontrol/devices/boot.py @@ -241,7 +241,7 @@ class Boot(lofar_device): "STAT/SST/1", "STAT/XST/1", "STAT/Beamlet/1", - "STAT/Beam/1", # Accesses RECV and Beamlet + "STAT/TileBeam/1", # Accesses RECV and Beamlet ], ) diff --git a/tangostationcontrol/tangostationcontrol/devices/beam.py b/tangostationcontrol/tangostationcontrol/devices/tilebeam.py similarity index 99% rename from tangostationcontrol/tangostationcontrol/devices/beam.py rename to tangostationcontrol/tangostationcontrol/devices/tilebeam.py index afcdf7887..948a36572 100644 --- a/tangostationcontrol/tangostationcontrol/devices/beam.py +++ b/tangostationcontrol/tangostationcontrol/devices/tilebeam.py @@ -3,7 +3,7 @@ # Distributed under the terms of the APACHE license. # See LICENSE.txt for more info. -""" Beam Device Server for LOFAR2.0 +""" TileBeam Device Server for LOFAR2.0 """ @@ -28,10 +28,10 @@ logger = logging.getLogger() -__all__ = ["Beam", "main", "BeamTracker"] +__all__ = ["TileBeam", "main", "BeamTracker"] @device_logging_to_python() -class Beam(lofar_device): +class TileBeam(lofar_device): # ----------------- # Device Properties @@ -320,7 +320,7 @@ class Beam(lofar_device): # ---------- def main(**kwargs): """Main function of the ObservationControl module.""" - return entry(Beam, **kwargs) + return entry(TileBeam, **kwargs) # ---------- # Beam Tracker diff --git a/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_beam.py b/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_tilebeam.py similarity index 97% rename from tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_beam.py rename to tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_tilebeam.py index 381678118..4948dd7f7 100644 --- a/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_beam.py +++ b/tangostationcontrol/tangostationcontrol/integration_test/default/devices/test_device_tilebeam.py @@ -24,12 +24,12 @@ class NumpyEncoder(json.JSONEncoder): return json.JSONEncoder.default(self, obj) -class TestDeviceBeam(AbstractTestBases.TestDeviceBase): +class TestDeviceTileBeam(AbstractTestBases.TestDeviceBase): pointing_direction = numpy.array([["J2000","0deg","0deg"]] * 96).flatten() def setUp(self): - super().setUp("STAT/Beam/1") + super().setUp("STAT/TileBeam/1") def setup_recv_proxy(self): # setup RECV @@ -146,7 +146,7 @@ class TestDeviceBeam(AbstractTestBases.TestDeviceBase): numpy.testing.assert_equal(calculated_HBAT_delay_steps[0], expected_HBAT_delay_steps) numpy.testing.assert_equal(calculated_HBAT_delay_steps[48], expected_HBAT_delay_steps) - def test_beam_tracking(self): + def test_tilebeam_tracking(self): # setup RECV as well recv_proxy = self.setup_recv_proxy() diff --git a/tangostationcontrol/tangostationcontrol/test/devices/test_beam_device.py b/tangostationcontrol/tangostationcontrol/test/devices/test_beam_device.py index 48ce76bf1..905c5a3b1 100644 --- a/tangostationcontrol/tangostationcontrol/test/devices/test_beam_device.py +++ b/tangostationcontrol/tangostationcontrol/test/devices/test_beam_device.py @@ -9,7 +9,7 @@ from tango.test_context import DeviceTestContext -from tangostationcontrol.devices import beam, lofar_device +from tangostationcontrol.devices import tilebeam, lofar_device import mock @@ -22,7 +22,7 @@ class TestBeamDevice(base.TestCase): # Patch DeviceProxy to allow making the proxies during initialisation # that we otherwise avoid using - for device in [beam, lofar_device]: + for device in [tilebeam, lofar_device]: proxy_patcher = mock.patch.object( device, 'DeviceProxy') proxy_patcher.start() @@ -30,14 +30,14 @@ class TestBeamDevice(base.TestCase): def test_get_pointing_directions(self): """Verify can read pointings attribute and length matches without err""" - with DeviceTestContext(beam.Beam, process=True, timeout=10) as proxy: + with DeviceTestContext(tilebeam.TileBeam, process=True, timeout=10) as proxy: proxy.initialise() self.assertEqual(96, len(proxy.read_attribute( "HBAT_pointing_direction_R").value)) def test_get_pointing_timestamps(self): """Verify can read timestamps attribute and length matches without err""" - with DeviceTestContext(beam.Beam, process=True, timeout=10) as proxy: + with DeviceTestContext(tilebeam.TileBeam, process=True, timeout=10) as proxy: proxy.initialise() self.assertEqual(96, len(proxy.read_attribute( "HBAT_pointing_timestamp_R").value)) -- GitLab