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

L2SS-574: move reference and antenna positions to RECV

parent 700df905
No related branches found
No related tags found
1 merge request!234Resolve L2SS-574 "Move hbat code to recv"
......@@ -36,18 +36,6 @@ class Beam(lofar_device):
# -----------------
# Device Properties
# -----------------
reference_itrf = device_property(
dtype='DevVarFloatArray',
mandatory=False,
default_value = numpy.tile(numpy.array([3826577.066, 461022.948, 5064892.786]),(96,1)) # CS002LBA, in ITRF2005 timestamp 2012.5
)
antenna_itrf = device_property(
dtype='DevVarFloatArray',
mandatory=False,
default_value = numpy.tile(numpy.array([3826923.546, 460915.441, 5064643.489]),(96,16,1)) # CS001LBA, in ITRF2005 timestamp 2012.5
)
HBAT_signal_input_delays = device_property(
dtype='DevVarFloatArray',
mandatory=False,
......@@ -83,6 +71,10 @@ class Beam(lofar_device):
# Set a reference of RECV device
self.recv_proxy = DeviceProxy("STAT/RECV/1")
# Retrieve positions from RECV device
self.hbat_reference_itrf = self.recv_proxy.get_hbat_reference_itrf().reshape(96,3)
self.hbat_antenna_itrf = self.recv_proxy.get_hbat_antenna_itrf().reshape(96,16,3)
# --------
# internal functions
# --------
......@@ -97,11 +89,11 @@ class Beam(lofar_device):
for tile in range(96):
# initialise delay calculator
d = delay_calculator(self.reference_itrf[tile])
d = delay_calculator(self.hbat_reference_itrf[tile])
d.set_measure_time(timestamp)
# calculate the delays based on the set reference position, the set time and now the set direction and antenna positions
delays[tile] = d.convert(pointing_direction[tile], self.antenna_itrf[tile])
delays[tile] = d.convert(pointing_direction[tile], self.hbat_antenna_itrf[tile])
return delays
......@@ -206,6 +198,7 @@ class Beam(lofar_device):
"""
Uploads beam weights based on a given pointing direction 2D array (96 tiles x 3 parameters)
"""
# Reshape the flatten input array
pointing_direction = numpy.array(pointing_direction).reshape(96,3)
self._HBAT_set_pointing(pointing_direction, timestamp)
......
......@@ -15,7 +15,7 @@
from tango import DebugIt
from tango.server import command
from tango.server import device_property, attribute
from tango import AttrWriteType, DevState
from tango import AttrWriteType, DevState, DevVarFloatArray
import numpy
# Additional import
......@@ -47,7 +47,6 @@ class RECV(opcua_device):
# -----------------
# Device Properties
# -----------------
ANT_mask_RW_default = device_property(
dtype='DevVarBooleanArray',
mandatory=False,
......@@ -75,6 +74,18 @@ class RECV(opcua_device):
# ],dtype=numpy.float64)
# )
hbat_reference_itrf = device_property(
dtype='DevVarFloatArray',
mandatory=False,
default_value = numpy.tile(numpy.array([3826577.066, 461022.948, 5064892.786]),(96,1)) # CS002LBA, in ITRF2005 timestamp 2012.5
)
hbat_antenna_itrf = device_property(
dtype='DevVarFloatArray',
mandatory=False,
default_value = numpy.tile(numpy.array([3826923.546, 460915.441, 5064643.489]),(96,16,1)) # CS001LBA, in ITRF2005 timestamp 2012.5
)
first_default_settings = [
# set the masks first, as those filter any subsequent settings
'ANT_mask_RW',
......@@ -143,6 +154,20 @@ class RECV(opcua_device):
# --------
# Commands
# --------
@command(dtype_out=DevVarFloatArray)
@DebugIt()
@only_in_states([DevState.ON])
def get_hbat_reference_itrf(self):
""" Return the property hbat_reference_itrf (96x3) into a flatten array """
return self.hbat_reference_itrf.flatten()
@command(dtype_out=DevVarFloatArray)
@DebugIt()
@only_in_states([DevState.ON])
def get_hbat_antenna_itrf(self):
""" Return the property hbat_antenna_itrf (96x16x3) into a flatten array """
return self.hbat_antenna_itrf.flatten()
@command()
@DebugIt()
@only_in_states([DevState.STANDBY, DevState.ON])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment