Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LOFAR Station Client
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
LOFAR2.0
LOFAR Station Client
Commits
a242d6f7
Commit
a242d6f7
authored
1 year ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
Bugfixes in statistics writer
parent
950f619b
No related branches found
No related tags found
1 merge request
!63
Bugfixes
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+2
-0
2 additions, 0 deletions
README.md
VERSION
+1
-1
1 addition, 1 deletion
VERSION
lofar_station_client/statistics/writer/hdf5.py
+29
-23
29 additions, 23 deletions
lofar_station_client/statistics/writer/hdf5.py
with
32 additions
and
24 deletions
README.md
+
2
−
0
View file @
a242d6f7
...
@@ -105,6 +105,8 @@ tox -e debug tests.requests.test_prometheus
...
@@ -105,6 +105,8 @@ tox -e debug tests.requests.test_prometheus
```
```
## Releasenotes
## Releasenotes
-
0.15.7 - Fix: Recording LBA statistics does not request HBA-only metadata
-
Fix: Syntax error when querying SDP metadata
-
0.15.6 - Represent BSTs in 488x2 arrays
-
0.15.6 - Represent BSTs in 488x2 arrays
-
l2ss-statistics-writer: Fix syntax error in printing help
-
l2ss-statistics-writer: Fix syntax error in printing help
-
More resilience against errors when interfacing with Tango
-
More resilience against errors when interfacing with Tango
...
...
This diff is collapsed.
Click to expand it.
VERSION
+
1
−
1
View file @
a242d6f7
0.15.
6
0.15.
7
This diff is collapsed.
Click to expand it.
lofar_station_client/statistics/writer/hdf5.py
+
29
−
23
View file @
a242d6f7
...
@@ -375,38 +375,20 @@ class HDF5Writer(ABC):
...
@@ -375,38 +375,20 @@ class HDF5Writer(ABC):
matrix_name
,
matrix_name
,
)
)
def
get_matrix
(
self
):
def
_add_device_metadata
(
self
,
matrix
:
StatisticsData
):
"""
Constructs a matrix for storing in the hdf5 file
"""
matrix
=
self
.
get_matrix_data
()
# add generic info
matrix
.
nof_payload_errors
=
self
.
current_collector
.
parameters
[
"
nof_payload_errors
"
]
matrix
.
nof_valid_payloads
=
self
.
current_collector
.
parameters
[
"
nof_valid_payloads
"
]
matrix
.
gn_indices
=
self
.
current_collector
.
parameters
[
"
gn_indices
"
]
# Stores the header of the packet received for this matrix as a list of
# attributes
if
self
.
statistics_packet_header
:
for
k
,
val
in
_dict_to_hdf5_attrs
(
self
.
statistics_packet_header
).
items
():
if
hasattr
(
matrix
,
k
):
setattr
(
matrix
,
k
,
val
)
# add station state
# add station state
if
self
.
antennafield_device
:
if
self
.
antennafield_device
:
try
:
try
:
if
self
.
antennafield_device
.
Antenna_Type_R
!=
"
LBA
"
:
matrix
.
hbat_pwr_on
=
self
.
antennafield_device
.
HBAT_PWR_on_R
matrix
.
hbat_pwr_on
=
self
.
antennafield_device
.
HBAT_PWR_on_R
matrix
.
frequency_band
=
self
.
antennafield_device
.
Frequency_Band_R
matrix
.
frequency_band
=
self
.
antennafield_device
.
Frequency_Band_R
except
(
DevFailed
,
AttributeError
):
except
(
DevFailed
,
AttributeError
):
logger
.
exception
(
logger
.
exception
(
"
Failed to read from %s
"
,
self
.
antennafield_device
.
name
()
"
Failed to read from %s
"
,
self
.
antennafield_device
.
name
()
)
)
if
self
.
sdp_device
and
self
.
antenna_sdp_mapping
:
if
self
.
sdp_device
and
self
.
antenna_sdp_mapping
is
not
None
:
try
:
try
:
nyquist_zones
=
self
.
sdp_device
.
nyquist_zone_RW
nyquist_zones
=
self
.
sdp_device
.
nyquist_zone_RW
fpga_spectral_inversion
=
self
.
sdp_device
.
FPGA_spectral_inversion_R
fpga_spectral_inversion
=
self
.
sdp_device
.
FPGA_spectral_inversion_R
...
@@ -463,6 +445,30 @@ class HDF5Writer(ABC):
...
@@ -463,6 +445,30 @@ class HDF5Writer(ABC):
except
(
DevFailed
,
AttributeError
):
except
(
DevFailed
,
AttributeError
):
logger
.
exception
(
"
Failed to read from %s
"
,
self
.
tilebeam_device
.
name
())
logger
.
exception
(
"
Failed to read from %s
"
,
self
.
tilebeam_device
.
name
())
def
get_matrix
(
self
):
"""
Constructs a matrix for storing in the hdf5 file
"""
matrix
=
self
.
get_matrix_data
()
# add generic info
matrix
.
nof_payload_errors
=
self
.
current_collector
.
parameters
[
"
nof_payload_errors
"
]
matrix
.
nof_valid_payloads
=
self
.
current_collector
.
parameters
[
"
nof_valid_payloads
"
]
matrix
.
gn_indices
=
self
.
current_collector
.
parameters
[
"
gn_indices
"
]
# Stores the header of the packet received for this matrix as a list of
# attributes
if
self
.
statistics_packet_header
:
for
k
,
val
in
_dict_to_hdf5_attrs
(
self
.
statistics_packet_header
).
items
():
if
hasattr
(
matrix
,
k
):
setattr
(
matrix
,
k
,
val
)
# Add metadata of Tango devices
self
.
_add_device_metadata
(
matrix
)
return
matrix
return
matrix
@abstractmethod
@abstractmethod
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment