Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
1d7cbe26
Commit
1d7cbe26
authored
Jun 22, 2021
by
Jörn Künsemöller
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-707
: fix conditions for including certain beams in the SIP, add test coverage
parent
35fbaa47
No related branches found
No related tags found
3 merge requests
!634
WIP: COBALT commissioning delta
,
!491
Resolve TMSS-707
,
!481
Draft: SW-971 SW-973 SW-975: Various fixes to build LOFAR correctly.
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
SAS/TMSS/backend/src/tmss/tmssapp/adapters/sip.py
+7
-7
7 additions, 7 deletions
SAS/TMSS/backend/src/tmss/tmssapp/adapters/sip.py
SAS/TMSS/backend/test/t_adapter.py
+20
-1
20 additions, 1 deletion
SAS/TMSS/backend/test/t_adapter.py
with
27 additions
and
8 deletions
SAS/TMSS/backend/src/tmss/tmssapp/adapters/sip.py
+
7
−
7
View file @
1d7cbe26
...
...
@@ -347,7 +347,7 @@ def create_sip_representation_for_dataproduct(dataproduct: Dataproduct):
beams
=
[]
beam_map
=
siplib
.
ArrayBeamMap
(
subarraypointing_identifier
=
get_siplib_identifier
(
dataproduct
.
sap
.
global_identifier
,
"
SAP %s
"
%
dataproduct
.
sap
.
id
),
beamnumber
=
0
,
# todo: we only have one pointing in the feedback. Do we need a reference here?
beamnumber
=
dataproduct
.
specifications_doc
[
'
identifiers
'
][
'
tab_index
'
]
if
'
identifiers
'
in
dataproduct
.
specifications_doc
else
0
,
# todo: verify
dispersionmeasure
=
0
,
# fixed
numberofsubbands
=
len
(
dataproduct
.
feedback_doc
[
'
frequency
'
][
'
subbands
'
]),
stationsubbands
=
dataproduct
.
feedback_doc
[
'
frequency
'
][
'
subbands
'
],
...
...
@@ -363,13 +363,17 @@ def create_sip_representation_for_dataproduct(dataproduct: Dataproduct):
for
field
in
dataproduct
.
feedback_doc
[
'
antennas
'
][
'
fields
'
]:
station_fields
.
setdefault
(
field
[
'
station
'
],
[]).
append
(
field
[
'
field
'
])
for
station
,
fields
in
station_fields
.
items
():
if
True
:
# todo: how to tell whether we have a FlyseyeBeam?
if
len
(
dataproduct
.
feedback_doc
[
'
antennas
'
][
'
fields
'
])
==
1
:
beams
.
append
(
siplib
.
FlysEyeBeam
(
arraybeam_map
=
beam_map
,
station
=
siplib
.
Station
.
preconfigured
(
station
,
fields
))
)
if
True
:
# todo: how to tell whether we have a CoherentStokesBeam?
elif
'
coherent
'
in
dataproduct
.
specifications_doc
and
dataproduct
.
specifications_doc
[
'
coherent
'
]
is
False
:
beams
.
append
(
siplib
.
IncoherentStokesBeam
(
arraybeam_map
=
beam_map
)
)
else
:
pointing
=
dataproduct
.
feedback_doc
[
'
target
'
][
'
pointing
'
]
sap_pointing
=
dataproduct
.
sap
.
specifications_doc
[
'
pointing
'
]
beams
.
append
(
...
...
@@ -385,10 +389,6 @@ def create_sip_representation_for_dataproduct(dataproduct: Dataproduct):
equinox
=
pointing
[
'
direction_type
'
]).
_get_pyxb_pointing
(
suppress_warning
=
True
),
# todo: Use the diff between pointing and SAP pointing
)
)
if
True
:
# todo: how to tell whether we have a IncoherentStokesBeam?
beams
.
append
(
siplib
.
IncoherentStokesBeam
(
arraybeam_map
=
beam_map
)
)
sip_dataproduct
=
siplib
.
BeamFormedDataProduct
(
dataproduct_map
,
...
...
This diff is collapsed.
Click to expand it.
SAS/TMSS/backend/test/t_adapter.py
+
20
−
1
View file @
1d7cbe26
...
...
@@ -330,9 +330,28 @@ class SIPadapterTest(unittest.TestCase):
self
.
assertIn
(
str
(
dataproduct
.
global_identifier
.
unique_identifier
),
sip
.
get_prettyxml
())
self
.
assertIn
(
str
(
sap
.
global_identifier
.
unique_identifier
),
sip
.
get_prettyxml
())
# assert that a
time
Beamformed dataproduct in TMSS creates a BeamformedDataproduct in the SIP
# assert that a Beamformed dataproduct in TMSS creates a BeamformedDataproduct in the SIP
self
.
assertIn
(
str
(
'
<dataProduct xsi:type=
"
sip:BeamFormedDataProduct
"
>
'
),
sip
.
get_prettyxml
())
# assert we get a coherent stokes beam by default
self
.
assertIn
(
str
(
'
CoherentStokesBeam
'
),
sip
.
get_prettyxml
())
# alter dataproduct, recreate sip
dataproduct
.
specifications_doc
[
'
coherent
'
]
=
False
dataproduct
.
save
()
sip
=
generate_sip_for_dataproduct
(
dataproduct
)
# assert we get an incoherent stokes beam
self
.
assertIn
(
str
(
'
<arrayBeam xsi:type=
"
sip:IncoherentStokesBeam
"
>
'
),
sip
.
get_prettyxml
())
# alter dataproduct, recreate sip
dataproduct
.
feedback_doc
[
'
antennas
'
][
'
fields
'
]
=
[{
'
type
'
:
'
HBA
'
,
'
field
'
:
'
HBA0
'
,
'
station
'
:
'
CS001
'
}]
dataproduct
.
save
()
sip
=
generate_sip_for_dataproduct
(
dataproduct
)
# assert we get a flyseye beam if we have a single antenna field
self
.
assertIn
(
str
(
'
<arrayBeam xsi:type=
"
sip:FlysEyeBeam
"
>
'
),
sip
.
get_prettyxml
())
class
FeedbackAdapterTest
(
unittest
.
TestCase
):
...
...
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