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
b69e4a0e
Commit
b69e4a0e
authored
13 years ago
by
Ger van Diepen
Browse files
Options
Downloads
Patches
Plain Diff
Task #3054 Made it work on CEP2
parent
a63e1f30
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CEP/MS/src/expandcalps
+0
-2
0 additions, 2 deletions
CEP/MS/src/expandcalps
CEP/MS/src/mstools.py
+5
-5
5 additions, 5 deletions
CEP/MS/src/mstools.py
with
5 additions
and
7 deletions
CEP/MS/src/expandcalps
+
0
−
2
View file @
b69e4a0e
...
...
@@ -33,8 +33,6 @@ if __name__ == "__main__":
if
len
(
sys
.
argv
)
>
4
and
len
(
sys
.
argv
[
4
])
>
0
:
outname
=
[
sys
.
argv
[
4
]]
# Expand the parset.
print
inname
,
outname
exit
lmt
.
expandps
(
sys
.
argv
[
1
],
sys
.
argv
[
2
],
{
'
in
'
:
[(
inname
,
'
Input_Correlated
'
)],
'
out
'
:
[(
outname
,
'
Output_InstrumentModel
'
)]})
This diff is collapsed.
Click to expand it.
CEP/MS/src/mstools.py
+
5
−
5
View file @
b69e4a0e
...
...
@@ -267,9 +267,9 @@ def expandps (parsetin, parsetout, keymap, nsubbands=0, nodeindex=0):
ps
=
lofar
.
parameterset
.
parameterset
(
parsetin
)
pskeys
=
ps
.
keys
()
# See if nsubbands parameter is given; otherwise set to 1.
havesubbands
=
t
rue
havesubbands
=
T
rue
if
nsubbands
<=
0
:
havesubbands
=
f
alse
havesubbands
=
F
alse
nsubbands
=
1
# Check and initialize.
if
nodeindex
<
0
or
nodeindex
>=
nsubbands
:
...
...
@@ -290,13 +290,14 @@ def expandps (parsetin, parsetout, keymap, nsubbands=0, nodeindex=0):
raise
KeyError
,
"
keyword
"
+
keyin
+
"
not found in parset
"
+
parsetin
# Get the file name pattern
patterns
=
ps
.
getStringVector
(
keyin
)
ps
.
remove
(
keyin
)
else
:
patterns
=
keyin
locs
=
[]
names
=
[]
for
patt
in
patterns
:
# Get all nodes and file names
(
nodes
,
files
)
=
findDirs
(
p
s
.
getString
(
keyin
)
)
(
nodes
,
files
)
=
findDirs
(
p
att
)
##(nodes,files) = (['locus1','locus2'], ['/data/L1/L1a.MS','/data/L1/L1b.MS'])
# Split into location (node:dir/) and basename.
for
i
in
range
(
len
(
files
)):
...
...
@@ -315,7 +316,6 @@ def expandps (parsetin, parsetout, keymap, nsubbands=0, nodeindex=0):
newkey
=
'
ObsSW.Observation.DataProducts.
'
+
keyout
ps
.
add
(
newkey
+
'
.locations
'
,
str
(
locs
));
ps
.
add
(
newkey
+
'
.filenames
'
,
str
(
names
));
ps
.
remove
(
keyin
)
# Write nsubbands if needed.
if
havesubbands
:
...
...
@@ -333,6 +333,7 @@ def expandps (parsetin, parsetout, keymap, nsubbands=0, nodeindex=0):
if
keyin
not
in
pskeys
:
raise
KeyError
,
"
keyword
"
+
keyin
+
"
not found in parset
"
+
parsetin
name
=
ps
.
getString
(
keyin
)
ps
.
remove
(
keyin
)
else
:
if
len
(
keyin
)
!=
1
:
raise
KeyError
,
"
Output key
"
+
keyin
+
"
is not a string, thus should be a sequence of length 1
"
...
...
@@ -361,7 +362,6 @@ def expandps (parsetin, parsetout, keymap, nsubbands=0, nodeindex=0):
newkey
=
'
ObsSW.Observation.DataProducts.
'
+
keyout
ps
.
add
(
newkey
+
'
.locations
'
,
str
(
locs
));
ps
.
add
(
newkey
+
'
.filenames
'
,
str
(
names
));
ps
.
remove
(
keyin
)
# Check if all keymap keywords have been processed.
if
nrproc
!=
len
(
keymap
):
...
...
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