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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
ccfef5eb
Commit
ccfef5eb
authored
1 year ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
TMSS_992: (partially) implemented beamformed feedback
parent
88709474
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1148
TMSS_992
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/TMSS/backend/src/tmss/tmssapp/adapters/feedback.py
+117
-1
117 additions, 1 deletion
SAS/TMSS/backend/src/tmss/tmssapp/adapters/feedback.py
with
117 additions
and
1 deletion
SAS/TMSS/backend/src/tmss/tmssapp/adapters/feedback.py
+
117
−
1
View file @
ccfef5eb
...
@@ -521,6 +521,7 @@ def create_feedback_for_observation_subtask_from_specifications(subtask: Subtask
...
@@ -521,6 +521,7 @@ def create_feedback_for_observation_subtask_from_specifications(subtask: Subtask
return
3
return
3
raise
ValueError
(
"
unknown band filter:
"
+
spec
[
'
stations
'
][
'
filter
'
])
raise
ValueError
(
"
unknown band filter:
"
+
spec
[
'
stations
'
][
'
filter
'
])
# correlated dataproducts
for
file_nr
,
dp
in
enumerate
(
dataproducts_correlated
.
order_by
(
'
filename
'
).
all
()):
for
file_nr
,
dp
in
enumerate
(
dataproducts_correlated
.
order_by
(
'
filename
'
).
all
()):
prefix
=
"
Observation.DataProducts.Output_Correlated_[%d].
"
%
(
file_nr
,)
prefix
=
"
Observation.DataProducts.Output_Correlated_[%d].
"
%
(
file_nr
,)
parset
.
add
(
prefix
+
"
fileFormat
"
,
"
AIPS++/CASA
"
)
parset
.
add
(
prefix
+
"
fileFormat
"
,
"
AIPS++/CASA
"
)
...
@@ -555,7 +556,122 @@ def create_feedback_for_observation_subtask_from_specifications(subtask: Subtask
...
@@ -555,7 +556,122 @@ def create_feedback_for_observation_subtask_from_specifications(subtask: Subtask
parset
.
add
(
prefix
+
"
centralFrequency
"
,
str
(
centralFrequency
))
parset
.
add
(
prefix
+
"
centralFrequency
"
,
str
(
centralFrequency
))
if
dataproducts_beamformed
.
exists
():
if
dataproducts_beamformed
.
exists
():
raise
NotImplementedError
(
"
Creating feedback from a beamformed observation
'
s specification is not implemented (yet)
"
)
# beamformed feedback
# COBALT also outputs 'generic' info about (in)coherent/flyseye which is in fact just the info of the first tab/fe pipeline.
# See: https://git.astron.nl/lofar2.0/cobalt/-/blob/main/CoInterface/src/LTAFeedback.cc#L284
# TMSS does not process this 'generic' info, which was incomplete in the first place.
# We do not need backwards compatibility with MoM, so we skip this 'generic' part, and just treat each dataproduct.
# See for dataproduct feedback: https://git.astron.nl/lofar2.0/cobalt/-/blob/main/CoInterface/src/LTAFeedback.cc#L107
spec_bf
=
spec
[
'
COBALT
'
].
get
(
'
beamformer
'
,{})
spec_tab_pipelines
=
spec_bf
.
get
(
'
tab_pipelines
'
,[])
spec_fe_pipelines
=
spec_bf
.
get
(
'
flyseye_pipelines
'
,[])
for
file_nr
,
dp
in
enumerate
(
dataproducts_beamformed
.
order_by
(
'
filename
'
).
all
()):
sap_spec
=
dp
.
sap
.
specifications_doc
# generic/common dp feedback
prefix
=
"
Observation.DataProducts.Output_Beamformed_[%d].
"
%
(
file_nr
,)
parset
.
add
(
prefix
+
"
fileFormat
"
,
"
HDF5
"
)
parset
.
add
(
prefix
+
"
filename
"
,
dp
.
filename
)
parset
.
add
(
prefix
+
"
location
"
,
subtask
.
cluster
.
name
+
'
:
'
+
dp
.
directory
)
#parset.add(prefix + "size", "0") # skip size, remains NULL in db, which is ok
parset
.
add
(
prefix
+
"
storageWriter
"
,
"
HDF5DEFAULT
"
)
parset
.
add
(
prefix
+
"
storageWriterVersion
"
,
spec
.
get
(
'
storagemanager
'
,
'
UNKNOWN
'
))
parset
.
add
(
prefix
+
"
percentageWritten
"
,
"
-1
"
)
# unknown
parset
.
add
(
prefix
+
"
beamformingSpectralLeakage
"
,
'
true
'
if
spec_bf
.
get
(
'
input_ppf
'
)
else
'
false
'
)
parset
.
add
(
prefix
+
"
startTime
"
,
formatDatetime
(
subtask
.
on_sky_start_time
))
# For now we do not support repointings, thus all starttimes for all dp's are the same
parset
.
add
(
prefix
+
"
duration
"
,
str
((
subtask
.
on_sky_stop_time
-
subtask
.
on_sky_start_time
).
total_seconds
()))
# beam specific dp feedback
beam_type
=
"
FlysEyeBeam
"
if
len
(
spec_bf
.
get
(
'
flyseye_pipelines
'
,
[]))
>
0
else
"
CoherentStokesBeam
"
if
dp
.
specifications_doc
.
get
(
'
coherent
'
,
False
)
else
"
IncoherentStokesBeam
"
beam_prefix
=
"
%s[0].
"
%
(
beam_type
,)
parset
.
add
(
prefix
+
"
beamPrefix
"
,
beam_prefix
)
beam_prefix
=
prefix
+
beam_prefix
parset
.
add
(
beam_prefix
+
"
SAP
"
,
str
(
dp
.
specifications_doc
[
'
identifiers
'
].
get
(
'
sap_index
'
,
0
)))
parset
.
add
(
beam_prefix
+
"
TAB
"
,
str
(
dp
.
specifications_doc
[
'
identifiers
'
].
get
(
'
tab_index
'
,
0
)))
parset
.
add
(
beam_prefix
+
"
pipeline
"
,
str
(
dp
.
specifications_doc
[
'
identifiers
'
].
get
(
'
pipeline_index
'
,
0
)))
parset
.
add
(
beam_prefix
+
"
pipelineTAB
"
,
str
(
dp
.
specifications_doc
[
'
identifiers
'
].
get
(
'
tab_index
'
,
0
)))
# same as tab??
# parset.add(beam_prefix + "samplingTime", str(format("%f") % (settings.sampleDuration() * stokesSet.nrChannels * stokesSet.timeIntegrationFactor)));
# parset.add(beam_prefix + "sampleType", spec_bf[''] stokesSet.quantizerSettings.enabled ? "integer" : "float");
# parset.add(beam_prefix + "sampleNrBits", str(format("%u") % (stokesSet.quantizerSettings.enabled ? stokesSet.quantizerSettings.nrBits : 32)));
#
# ostringstream centralFreqsStr;
# centralFreqsStr << "[";
# for (size_t i = f.firstSubbandIdx; i < f.lastSubbandIdx; ++i) {
# if (i > f.firstSubbandIdx)
# centralFreqsStr << ", ";
# centralFreqsStr << str(format("%.4lf") % settings.subbands[i].centralFrequency);
# }
# centralFreqsStr << "]";
#
# parset.add(beam_prefix + "centralFrequencies", centralFreqsStr.str());
#
# ostringstream stationSubbandsStr;
# stationSubbandsStr << "[";
# for (size_t i = f.firstSubbandIdx; i < f.lastSubbandIdx; ++i) {
# if (i > f.firstSubbandIdx)
# stationSubbandsStr << ", ";
# stationSubbandsStr << str(format("%u") % settings.subbands[i].stationIdx);
# }
# stationSubbandsStr << "]";
#
# parset.add(beam_prefix + "stationSubbands", stationSubbandsStr.str());
antenna_fields
=
[
f
[
'
station
'
]
+
f
[
'
field
'
]
for
f
in
sap_spec
[
'
antennas
'
][
'
fields
'
]]
antenna_fields_str
=
'
[
'
+
'
,
'
.
join
(
antenna_fields
)
+
'
]
'
parset
.
add
(
prefix
+
"
antennaFields
"
,
antenna_fields_str
)
parset
.
add
(
beam_prefix
+
"
antennaSet
"
,
sap_spec
[
'
antennas
'
][
'
antenna_set
'
])
parset
.
add
(
prefix
+
"
Pointing.directionType
"
,
sap_spec
[
'
pointing
'
][
'
direction_type
'
])
parset
.
add
(
prefix
+
"
Pointing.angle1
"
,
str
(
sap_spec
[
'
pointing
'
][
'
angle1
'
]))
parset
.
add
(
prefix
+
"
Pointing.angle2
"
,
str
(
sap_spec
[
'
pointing
'
][
'
angle2
'
]))
parset
.
add
(
prefix
+
"
Pointing.target
"
,
sap_spec
[
'
pointing
'
].
get
(
'
target
'
,
''
))
#
# parset.add(beam_prefix + "channelWidth", str(format("%f") % (settings.subbandWidth() / stokesSet.nrChannels)));
# parset.add(beam_prefix + "channelsPerSubband",str(format("%u") % stokesSet.nrChannels));
# parset.add(beam_prefix + "stokes", str(format("[%s]") % stokesVars[f.stokesNr]));
#
# const struct ObservationSettings::Direction &tabDir =
# f.pointingNr >= 0 ? tab.pointings[f.pointingNr].direction : tab.direction;
# const string &tabTarget =
# f.pointingNr >= 0 ? tab.pointings[f.pointingNr].target : tab.target;
#
# parset.add(beam_prefix + "Pointing.equinox", "J2000");
# parset.add(beam_prefix + "Pointing.coordType", "RA-DEC");
# parset.add(beam_prefix + "Pointing.directionType", tabDir.type);
# parset.add(beam_prefix + "Pointing.angle1", str(format("%f") % tabDir.angle1));
# parset.add(beam_prefix + "Pointing.angle2", str(format("%f") % tabDir.angle2));
# parset.add(beam_prefix + "Pointing.target", tabTarget);
#
# if (type == "CoherentStokesBeam") {
# parset.add(beam_prefix + "Offset.equinox", "J2000");
# parset.add(beam_prefix + "Offset.coordType", "RA-DEC");
# parset.add(beam_prefix + "Offset.directionType", tabDir.type);
# parset.add(beam_prefix + "Offset.angle1", str(format("%f") % (tabDir.angle1 - sap.direction.angle1)));
# parset.add(beam_prefix + "Offset.angle2", str(format("%f") % (tabDir.angle2 - sap.direction.angle2)));
#
# ostringstream antennaFieldNamesStr;
# antennaFieldNamesStr << settings.beamFormer.pipelines[tab.pipelineNr].antennaFieldNames;
# parset.add(beam_prefix + "antennaFields", antennaFieldNamesStr.str());
# } else if (type == "IncoherentStokesBeam") {
# ostringstream antennaFieldNamesStr;
# antennaFieldNamesStr << settings.beamFormer.pipelines[tab.pipelineNr].antennaFieldNames;
# parset.add(beam_prefix + "antennaFields", antennaFieldNamesStr.str());
# } else if (type == "FlysEyeBeam") {
# auto& antennaFieldName = settings.beamFormer.pipelines.at(tab.pipelineNr).antennaFieldNames.at(tab.localTabNr);
# parset.add(beam_prefix + "stationName", antennaFieldName.station);
# parset.add(beam_prefix + "antennaFieldName", antennaFieldName.antennaField);
#
# ostringstream antennaFieldNamesStr;
# antennaFieldNamesStr << "[" << antennaFieldName << "]";
# parset.add(beam_prefix + "antennaFields", antennaFieldNamesStr.str());
# }
return
parset
return
parset
...
...
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