Skip to content
Snippets Groups Projects
Commit c4cbba79 authored by Jasper Annyas's avatar Jasper Annyas
Browse files

L2SS-357:Corrected error in recv-sim Dockerfile and adjusted notebook

parent 9ff1ed54
Branches
Tags
1 merge request!134Resolve L2SS-357 "Rename pcc to recv"
......@@ -6,5 +6,5 @@ RUN apt-get update && apt-get install -y python3 python3-pip python3-yaml git &&
pip3 install -r requirements.txt && \
git clone --depth 1 --branch master https://git.astron.nl/lofar2.0/pypcc
WORKDIR /recv
WORKDIR /pypcc
CMD ["python3","pypcc2.py","--simulator"]
%% Cell type:code id:waiting-chance tags:
``` python
import time
```
%% Cell type:code id:moving-alexandria tags:
``` python
d=DeviceProxy("LTS/SDP/1")
d=DeviceProxy("LTS/RECV/1")
```
%% Cell type:code id:ranking-aluminum tags:
``` python
state = str(d.state())
if state == "OFF" or state == "FAULT":
d.initialise()
time.sleep(1)
state = str(d.state())
if state == "STANDBY":
d.on()
state = str(d.state())
if state == "ON":
print("Device is now in on state")
else:
print("warning, expected device to be in on state, is: ", state)
```
%% Output
---------------------------------------------------------------------------
ConnectionFailed Traceback (most recent call last)
/tmp/ipykernel_21/3603531217.py in <module>
----> 1 state = str(d.state())
2
3
4 if state == "OFF" or state == "FAULT":
5 d.initialise()
/usr/local/lib/python3.7/dist-packages/tango/green.py in greener(obj, *args, **kwargs)
193 green_mode = access('green_mode', None)
194 executor = get_object_executor(obj, green_mode)
--> 195 return executor.run(fn, args, kwargs, wait=wait, timeout=timeout)
196
197 return greener
/usr/local/lib/python3.7/dist-packages/tango/green.py in run(self, fn, args, kwargs, wait, timeout)
107 # Sychronous (no delegation)
108 if not self.asynchronous or not self.in_executor_context():
--> 109 return fn(*args, **kwargs)
110 # Asynchronous delegation
111 accessor = self.delegate(fn, *args, **kwargs)
/usr/local/lib/python3.7/dist-packages/tango/device_proxy.py in __DeviceProxy__state(self, *args, **kwargs)
1558 if dev_st == DevState.ON : ...
1559 """
-> 1560 return self._state(*args, **kwargs)
1561
1562
ConnectionFailed: DevFailed[
DevError[
desc = TRANSIENT CORBA system exception: TRANSIENT_NoUsableProfile
origin = Connection::connect
reason = API_CorbaException
severity = ERR]
DevError[
desc = Failed to connect to device lts/sdp/1
origin = Connection::connect
reason = API_CantConnectToDevice
severity = ERR]
]
Device is now in on state
%% Cell type:code id:transsexual-battle tags:
``` python
values = [
[d.FPGA_mask_RW, "FPGA_mask_RW"],
[d.FPGA_scrap_R, "FPGA_scrap_R"],
[d.FPGA_scrap_RW, "FPGA_scrap_RW"],
[d.FPGA_status_R, "FPGA_status_R"],
[d.FPGA_temp_R, "FPGA_temp_R"],
[d.FPGA_version_R, "FPGA_version_R"],
[d.FPGA_weights_R, "FPGA_weights_R"],
[d.FPGA_weights_RW, "FPGA_weights_RW"],
[d.TR_busy_R, "TR_busy_R"],
[d.TR_reload_RW, "TR_reload_RW"],
# [d.TR_tod_R, "TR_tod_R"],
# [d.TR_uptime_R, "TR_uptime_R"]
]
for i in values:
print("🟦🟦🟦", i[1], ": ", i[0])
```
%% Output
---------------------------------------------------------------------------
DevFailed Traceback (most recent call last)
/tmp/ipykernel_22/2885399456.py in <module>
1 values = [
----> 2 [d.FPGA_mask_RW, "FPGA_mask_RW"],
3 [d.FPGA_scrap_R, "FPGA_scrap_R"],
4 [d.FPGA_scrap_RW, "FPGA_scrap_RW"],
5 [d.FPGA_status_R, "FPGA_status_R"],
/usr/local/lib/python3.7/dist-packages/tango/device_proxy.py in __DeviceProxy__getattr(self, name)
319 attr_info = self.__get_attr_cache().get(name_l)
320 if attr_info:
--> 321 return __get_attribute_value(self, attr_info, name)
322
323 if name_l in self.__get_pipe_cache():
/usr/local/lib/python3.7/dist-packages/tango/device_proxy.py in __get_attribute_value(self, attr_info, name)
281 def __get_attribute_value(self, attr_info, name):
282 _, enum_class = attr_info
--> 283 attr_value = self.read_attribute(name).value
284 if enum_class:
285 return enum_class(attr_value)
/usr/local/lib/python3.7/dist-packages/tango/green.py in greener(obj, *args, **kwargs)
193 green_mode = access('green_mode', None)
194 executor = get_object_executor(obj, green_mode)
--> 195 return executor.run(fn, args, kwargs, wait=wait, timeout=timeout)
196
197 return greener
/usr/local/lib/python3.7/dist-packages/tango/green.py in run(self, fn, args, kwargs, wait, timeout)
107 # Sychronous (no delegation)
108 if not self.asynchronous or not self.in_executor_context():
--> 109 return fn(*args, **kwargs)
110 # Asynchronous delegation
111 accessor = self.delegate(fn, *args, **kwargs)
/usr/local/lib/python3.7/dist-packages/tango/device_proxy.py in __DeviceProxy__read_attribute(self, value, extract_as)
439
440 def __DeviceProxy__read_attribute(self, value, extract_as=ExtractAs.Numpy):
--> 441 return __check_read_attribute(self._read_attribute(value, extract_as))
442
443
/usr/local/lib/python3.7/dist-packages/tango/device_proxy.py in __check_read_attribute(dev_attr)
155 def __check_read_attribute(dev_attr):
156 if dev_attr.has_failed:
--> 157 raise DevFailed(*dev_attr.get_err_stack())
158 return dev_attr
159
DevFailed: DevFailed[
DevError[
desc = Read value for attribute FPGA_mask_RW has not been updated
origin = Device_3Impl::read_attributes_no_except
reason = API_AttrValueNotSet
severity = ERR]
DevError[
desc = Failed to read_attribute on device lts/sdp/1, attribute FPGA_mask_RW
origin = DeviceProxy::read_attribute()
reason = API_AttributeFailed
severity = ERR]
]
%% Cell type:code id:7accae6a tags:
``` python
attr_names = d.get_attribute_list()
for i in attr_names:
exec("value = print(i, d.{})".format(i))
```
%% Cell type:code id:b88868c5 tags:
``` python
wgswitches = d.FPGA_wg_enable_R
print("Old values:\n", wgswitches)
wgswitches[9][0] = True
wgswitches[10][0] = True
print("Values to be set:\n", wgswitches)
d.FPGA_wg_enable_RW =wgswitches
time.sleep(7)
print("Values read back after setting:\n",d.FPGA_wg_enable_R)
```
%% Output
array([[1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.],
[1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.],
[1., 1., 1., 1., 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., 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., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]],
dtype=float32)
%% Cell type:code id:8f3db8c7 tags:
``` python
phases = d.FPGA_wg_phase_R
print("Old values:\n", phases)
phases[9][0] = 1.0334
phases[9][1] = 20.15
phases[10][0] = 130
print("Values to be set:\n", phases)
d.FPGA_wg_phase_RW = phases
time.sleep(7)
print("Values read back after setting:\n", d.FPGA_wg_phase_R)
```
%% Output
array([[119.99817, 119.99817, 119.99817, 119.99817, 119.99817, 119.99817,
119.99817, 119.99817, 119.99817, 119.99817, 119.99817, 119.99817,
119.99817, 119.99817, 119.99817, 119.99817],
[119.99817, 119.99817, 119.99817, 119.99817, 119.99817, 119.99817,
119.99817, 119.99817, 119.99817, 119.99817, 119.99817, 119.99817,
119.99817, 119.99817, 119.99817, 119.99817],
[119.99817, 119.99817, 119.99817, 119.99817, 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. ,
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. , 0. , 0. ,
0. , 0. , 0. , 0. , 0. , 0. ,
0. , 0. , 0. , 0. ]], dtype=float32)
%% Cell type:code id:e45b4874 tags:
``` python
amplitudes = d.FPGA_wg_amplitude_R
print("Old values:\n", amplitudes)
amplitudes[9][0] = 1.0
amplitudes[9][1] = 1.99
amplitudes[10][0] = 0.5
print("Values to be set:\n", amplitudes)
d.FPGA_wg_amplitude_RW = amplitudes
time.sleep(7)
print("Values read back after setting:\n", d.FPGA_wg_amplitude_R)
```
%% Output
version_R *L2SS-357-Rename_PCC_to_RECV [c4d52d7125ece480acb1492a5fc0ba7fc60f9ea1]
Ant_mask_RW [[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]
[False False False]]
array([[29921878., 29921878., 29921878., 29921878., 29921878., 29921878.,
29921878., 29921878., 29921878., 29921878., 29921878., 29921878.,
29921878., 29921878., 29921878., 29921878.],
[29921878., 29921878., 29921878., 29921878., 29921878., 29921878.,
29921878., 29921878., 29921878., 29921878., 29921878., 29921878.,
29921878., 29921878., 29921878., 29921878.],
[29921878., 29921878., 29921878., 29921878., 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.,
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., 0., 0.,
0., 0., 0., 0., 0., 0.,
0., 0., 0., 0.]], dtype=float32)
---------------------------------------------------------------------------
DevFailed Traceback (most recent call last)
/tmp/ipykernel_26/3093379163.py in <module>
3
4 for i in attr_names:
----> 5 exec("value = print(i, d.{})".format(i))
%% Cell type:code id:9b1bbd3e tags:
<string> in <module>
/usr/local/lib/python3.7/dist-packages/tango/device_proxy.py in __DeviceProxy__getattr(self, name)
319 attr_info = self.__get_attr_cache().get(name_l)
320 if attr_info:
--> 321 return __get_attribute_value(self, attr_info, name)
322
323 if name_l in self.__get_pipe_cache():
/usr/local/lib/python3.7/dist-packages/tango/device_proxy.py in __get_attribute_value(self, attr_info, name)
281 def __get_attribute_value(self, attr_info, name):
282 _, enum_class = attr_info
--> 283 attr_value = self.read_attribute(name).value
284 if enum_class:
285 return enum_class(attr_value)
/usr/local/lib/python3.7/dist-packages/tango/green.py in greener(obj, *args, **kwargs)
193 green_mode = access('green_mode', None)
194 executor = get_object_executor(obj, green_mode)
--> 195 return executor.run(fn, args, kwargs, wait=wait, timeout=timeout)
196
197 return greener
/usr/local/lib/python3.7/dist-packages/tango/green.py in run(self, fn, args, kwargs, wait, timeout)
107 # Sychronous (no delegation)
108 if not self.asynchronous or not self.in_executor_context():
--> 109 return fn(*args, **kwargs)
110 # Asynchronous delegation
111 accessor = self.delegate(fn, *args, **kwargs)
/usr/local/lib/python3.7/dist-packages/tango/device_proxy.py in __DeviceProxy__read_attribute(self, value, extract_as)
439
440 def __DeviceProxy__read_attribute(self, value, extract_as=ExtractAs.Numpy):
--> 441 return __check_read_attribute(self._read_attribute(value, extract_as))
442
443
/usr/local/lib/python3.7/dist-packages/tango/device_proxy.py in __check_read_attribute(dev_attr)
155 def __check_read_attribute(dev_attr):
156 if dev_attr.has_failed:
--> 157 raise DevFailed(*dev_attr.get_err_stack())
158 return dev_attr
159
DevFailed: DevFailed[
DevError[
desc = Read value for attribute CLK_Enable_PWR_R has not been updated
origin = Device_3Impl::read_attributes_no_except
reason = API_AttrValueNotSet
severity = ERR]
``` python
frequencies = d.FPGA_wg_frequency_R
print("Old values:\n", frequencies)
frequencies[9][0] = 19000000
frequencies[9][1] = 20000000
frequencies[10][0] = 22000000
print("Values to be set:\n", frequencies)
d.FPGA_wg_frequency_RW = frequencies
print("Values read back after setting:\n", d.FPGA_wg_frequency_R)
```
DevError[
desc = Failed to read_attribute on device lts/recv/1, attribute CLK_Enable_PWR_R
origin = DeviceProxy::read_attribute()
reason = API_AttributeFailed
severity = ERR]
]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment