Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lofar_text_generator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
Astronomy and Operations
SDC Operations
lofar_text_generator
Commits
ec8fff4f
Commit
ec8fff4f
authored
4 years ago
by
Sander ter Veen
Browse files
Options
Downloads
Patches
Plain Diff
Updated xmlgen to version 4.0.5, to include LV614.
parent
5530a6d8
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
xmlgen.py
+36
-17
36 additions, 17 deletions
xmlgen.py
with
36 additions
and
17 deletions
xmlgen.py
+
36
−
17
View file @
ec8fff4f
...
...
@@ -26,7 +26,7 @@
# Last change by : $Author: renting $
# Change date : $Date: 2016-05-18 11:47:57 +0200 (wo, 18 mei 2016) $
VERSION
=
"
4.0.
3
"
VERSION
=
"
4.0.
5
"
import
sys
,
getopt
,
time
from
xml.sax.saxutils
import
escape
as
XMLescape
...
...
@@ -49,13 +49,13 @@ WHICH_CS = ['IQUV', 'I', 'XXYY']
WEIGHTING_SCHEMES
=
[
'
uniform
'
,
'
superuniform
'
,
'
natural
'
,
'
briggs
'
,
'
briggsabs
'
,
'
radial
'
]
IMAGING_PIPELINE_TYPES
=
[
'
MSSS
'
,
'
standard
'
,
'
none
'
]
# MODES = ['Calobs','Calbeam','MultiObs']
PROCESSING
=
[
'
Preprocessing
'
,
'
Calibration
'
,
'
Pulsar
'
,
'
Imaging
'
,
'
LongBaseline
'
,
'
Prefactor
'
,
'
none
'
]
PROCESSING
=
[
'
Preprocessing
'
,
'
Calibration
'
,
'
Pulsar
'
,
'
Imaging
'
,
'
LongBaseline
'
,
'
Prefactor
'
,
'
PreprocessingNoFlagging
'
,
'
none
'
]
CALIBRATION_MODE
=
[
'
internal
'
,
'
external
'
,
'
none
'
]
ALL_STATIONS
=
'
CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509,DE601,DE602,DE603,DE604,DE605,FR606,SE607,UK608,DE609,PL610,PL611,PL612,IE613
'
ALL_STATIONS
=
'
CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509,DE601,DE602,DE603,DE604,DE605,FR606,SE607,UK608,DE609,PL610,PL611,PL612,IE613
,LV614
'
CORE_STATIONS
=
'
CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501
'
SUPERTERP_STATIONS
=
'
CS002,CS003,CS004,CS005,CS006,CS007
'
REMOTE_STATIONS
=
'
RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509
'
INTERNATIONAL_STATIONS
=
'
DE601,DE602,DE603,DE604,DE605,FR606,SE607,UK608,DE609,PL610,PL611,PL612,IE613
'
INTERNATIONAL_STATIONS
=
'
DE601,DE602,DE603,DE604,DE605,FR606,SE607,UK608,DE609,PL610,PL611,PL612,IE613
,LV614
'
NL_STATIONS
=
'
CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509
'
DEFAULT_TASKS_PER_NODE
=
11
DEFAULT_CORES_PER_TASK
=
2
...
...
@@ -395,7 +395,7 @@ def writeXMLObs(ofile, name, descr, topo, predecessor_topo, attrname, projname,
def
writeXMLBeam
(
ofile
,
name
,
description
,
topo
,
beamtype
,
target
,
ra
,
dec
,
subbands
,
flyseye
,
tabrings
,
tabringsize
,
tablist
,
dataproducts
,
status
):
tablist
,
dataproducts
,
status
,
equinox
=
"
J2000
"
):
print
(
r
"""
<item index=
"
0
"
>
<lofar:measurement xsi:type=
"
lofar:BFMeasurementType
"
>
<name>%s</name>
...
...
@@ -410,7 +410,7 @@ def writeXMLBeam(ofile, name, description, topo, beamtype, target, ra, dec, subb
<targetName>%s</targetName>
<ra>%s</ra>
<dec>%s</dec>
<equinox>
J2000
</equinox>
<equinox>
%s
</equinox>
<duration>0</duration>
<subbandsSpecification>
<subbands>%s</subbands>
...
...
@@ -430,8 +430,8 @@ def writeXMLBeam(ofile, name, description, topo, beamtype, target, ra, dec, subb
</resultDataProducts>
</lofar:measurement>
</item>
"""
%
(
name
,
description
,
topo
,
status
,
beamtype
,
target
,
ra
,
dec
,
subbands
,
writeBoolean
(
flyseye
)
,
tabrings
,
tabringsize
,
tablist
,
dataproducts
),
file
=
ofile
)
name
,
description
,
topo
,
status
,
beamtype
,
target
,
ra
,
dec
,
equinox
,
subbands
,
writeBoolean
(
flyseye
),
tabrings
,
tabringsize
,
tablist
,
dataproducts
),
file
=
ofile
)
def
writeXMLObsEnd
(
ofile
):
...
...
@@ -1660,7 +1660,9 @@ def readBlock(lines, projectName, blockNr):
"
globalTABrings
"
:
[],
"
coherentStokesData
"
:
False
,
"
flysEye
"
:
False
,
"
numberOfBitsPerSample
"
:
0
}
"
numberOfBitsPerSample
"
:
0
,
"
equinox
"
:
"
J2000
"
}
for
lineNr
,
cline
in
enumerate
(
lines
):
if
"
=
"
in
cline
and
not
cline
.
startswith
((
'
BBS
'
,
'
Demix
'
,
'
Pulsar
'
)):
# we skip beam and pipelines lines
...
...
@@ -1825,6 +1827,8 @@ def readBlock(lines, projectName, blockNr):
raise
GenException
(
"
the number of nodes parameter is not valid for BLOCK: %i
"
%
blockNr
)
elif
key
==
"
storagemanager
"
:
s
[
"
storagemanager
"
]
=
value
elif
key
==
"
equinox
"
:
s
[
"
equinox
"
]
=
value
else
:
raise
GenException
(
"
unknown key:
'
%s
'
in BLOCK: %i
"
%
(
key
,
blockNr
))
return
s
##settings
...
...
@@ -2107,6 +2111,13 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
# raise GenException('Prefactor mode currently does not support an internal calibration beam.')
else
:
tar_pipe_input_INST_topo
=
cal_pipe_calibrator_topology
+
'
.inst.dps
'
# 1.CPC.inst.dps
elif
processing
==
'
PreprocessingNoFlagging
'
:
tar_pipe_predecessor
=
tar_obs_topology
# 1.T
tar_pipe_input_INST_topo
=
''
# no input instrument models for these modes
cal_obs_pipe_default_template
=
"
Preprocessing Pipeline
"
cal_tar_pipe_default_template
=
"
Preprocessing Pipeline
"
cal_pipe_calibrator_description
=
"
Preprocessing
"
cal_pipe_target_description
=
"
Preprocessing
"
bfDataExtension
=
determineBfDataExtension
(
coherentStokesData
,
incoherentStokesData
)
...
...
@@ -2215,7 +2226,8 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
coherentStokesData
,
incoherentStokesData
,
settings
[
'
cluster
'
]),
status
)
status
,
settings
[
'
equinox
'
])
writeXMLObsEnd
(
ofile
)
# target start and end time:
...
...
@@ -2261,7 +2273,7 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
nr_cores_per_task
,
miscParameters
)
elif
processing
==
'
Preprocessing
'
:
elif
processing
in
[
'
Preprocessing
'
,
'
Preprocessing
NoFlagging
'
]
:
calibratorDemix
=
settings
[
'
calibratorDemix
'
]
for
i
in
range
(
0
,
len
(
calibratorDemix
)):
if
len
(
calibratorDemix
)
>
1
:
# TODO a cludge right now, but want to refactor how to call the writeXML soon
...
...
@@ -2429,7 +2441,8 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
coherentStokesData
,
incoherentStokesData
,
settings
[
'
cluster
'
]),
status
)
status
,
settings
[
'
equinox
'
])
# create the extra polarization beam?
if
"
create_extra_ncp_beam
"
in
settings
and
settings
[
"
create_extra_ncp_beam
"
]:
...
...
@@ -2450,7 +2463,8 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
coherentStokesData
,
incoherentStokesData
,
settings
[
'
cluster
'
]),
status
)
# FIXME missing parameters
status
,
settings
[
'
equinox
'
])
# FIXME missing parameters
# create a calibrator beam in the target observation?
if
settings
[
'
create_target_cal_beam
'
]:
...
...
@@ -2478,7 +2492,8 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
coherentStokesData
,
incoherentStokesData
,
settings
[
'
cluster
'
]),
status
)
status
,
settings
[
'
equinox
'
])
writeXMLObsEnd
(
ofile
)
...
...
@@ -2515,7 +2530,7 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
nr_cores_per_task
,
miscParameters
)
elif
processing
==
'
Preprocessing
'
:
elif
processing
in
[
'
Preprocessing
'
,
'
Preprocessing
NoFlagging
'
]
:
calibratorDemix
=
settings
[
'
calibratorDemix
'
]
for
i
in
range
(
0
,
len
(
calibratorDemix
)):
if
len
(
calibratorDemix
)
>
1
:
# TODO a cludge right now, but want to refactor how to call the writeXML soon
...
...
@@ -2678,7 +2693,8 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
coherentStokesData
,
incoherentStokesData
,
settings
[
'
cluster
'
]),
status
)
status
,
settings
[
'
equinox
'
])
writeXMLObsEnd
(
ofile
)
...
...
@@ -2711,6 +2727,9 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
elif
processing
==
'
Prefactor
'
:
tar_pipe_default_template
=
"
Calibration Pipeline Target
"
tar_pipe_description
=
"
Prefactor Target
"
elif
processing
==
'
PreprocessingNoFlagging
'
:
tar_pipe_default_template
=
"
PreprocessingNoFlagging Pipeline
"
tar_pipe_description
=
"
Preprocessing No Flagging
"
if
settings
[
'
writePackageTag
'
]:
tar_pipe_name
=
settings
[
'
packageTag
'
]
+
"
/
"
+
targetBeams
[
beamNr
][
2
]
+
"
/
"
+
str
(
repeatNr
)
+
"
.
"
+
\
...
...
@@ -2742,7 +2761,7 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
nr_cores_per_task
,
miscParameters
)
elif
processing
==
'
Preprocessing
'
:
elif
processing
in
[
'
Preprocessing
'
,
'
Preprocessing
NoFlagging
'
]
:
targetDemix
=
settings
[
'
targetDemix
'
]
for
i
in
range
(
0
,
len
(
targetDemix
[
beamNr
])):
if
len
(
targetDemix
[
...
...
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