Skip to content
GitLab
Explore
Sign in
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
b46db669
Commit
b46db669
authored
7 years ago
by
Tammo Jan Dijkema
Browse files
Options
Downloads
Patches
Plain Diff
Task #11410: merge task branch, DPPP ApplyCal can now handle RotationMeasure:*:phase_center
parent
da712c69
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/DP3/DPPP/src/OneApplyCal.cc
+26
-14
26 additions, 14 deletions
CEP/DP3/DPPP/src/OneApplyCal.cc
CEP/DP3/DPPP/test/tApplyCal2.run
+34
-0
34 additions, 0 deletions
CEP/DP3/DPPP/test/tApplyCal2.run
with
60 additions
and
14 deletions
CEP/DP3/DPPP/src/OneApplyCal.cc
+
26
−
14
View file @
b46db669
...
...
@@ -488,21 +488,34 @@ namespace LOFAR {
}
else
{
// Use ParmDB
for
(
uint
parmExprNum
=
0
;
parmExprNum
<
itsParmExprs
.
size
();
++
parmExprNum
)
{
// parmMap contains parameter values for all antennas
parmMap
=
itsParmDB
->
getValuesMap
(
itsParmExprs
[
parmExprNum
]
+
"*"
,
parmMap
=
itsParmDB
->
getValuesMap
(
itsParmExprs
[
parmExprNum
]
+
"
{:phase_center,}
*"
,
minFreq
,
maxFreq
,
freqInterval
,
bufStartTime
-
0.5
*
itsTimeInterval
,
itsLastTime
,
itsTimeInterval
,
true
);
string
parmExpr
=
itsParmExprs
[
parmExprNum
];
// Resolve {Common,}Bla to CommonBla or Bla
if
(
!
parmMap
.
empty
()
&&
itsParmExprs
[
parmExprNum
].
find
(
"{"
)
!=
std
::
string
::
npos
)
{
parmExpr
.
find
(
"{Common,}"
)
!=
string
::
npos
)
{
// Take the name of the first parm, e.g. Bla:CS001, and remove the antenna name
uint
colonPos
=
(
parmMap
.
begin
()
->
first
).
find
(
":"
);
itsParmExprs
[
parmExprNum
]
=
(
parmMap
.
begin
()
->
first
).
substr
(
0
,
colonPos
);
parmExpr
=
(
parmMap
.
begin
()
->
first
).
substr
(
0
,
colonPos
);
}
string
name_postfix
=
""
;
// Remove :phase_center postfix
if
(
!
parmMap
.
empty
())
{
// Take the name of the first parm, e.g. Bla:CS001, and remove the antenna name
// If necessary, append :phase_center
if
((
parmMap
.
begin
()
->
first
).
find
(
":phase_center"
)
!=
string
::
npos
)
{
name_postfix
=
":phase_center"
;
}
}
for
(
uint
ant
=
0
;
ant
<
numAnts
;
++
ant
)
{
parmIt
=
parmMap
.
find
(
itsParmExprs
[
parmExprNum
]
+
":"
+
info
().
antennaNames
()[
ant
]
);
parmIt
=
parmMap
.
find
(
parmExpr
+
":"
+
string
(
info
().
antennaNames
()[
ant
])
+
name_postfix
);
if
(
parmIt
!=
parmMap
.
end
())
{
parmvalues
[
parmExprNum
][
ant
].
swap
(
parmIt
->
second
);
...
...
@@ -511,24 +524,23 @@ namespace LOFAR {
Array
<
double
>
defValues
;
double
defValue
;
if
(
itsParmDB
->
getDefValues
(
itsParmExprs
[
parmExpr
Num
]
+
":"
+
info
().
antennaNames
()[
ant
]).
size
()
==
1
)
{
// Default for antenna
itsParmDB
->
getDefValues
(
itsParmExprs
[
parmExprNum
]
+
":"
+
info
().
antennaNames
()[
ant
]).
get
(
0
,
defValues
);
if
(
itsParmDB
->
getDefValues
(
parmExpr
+
":"
+
string
(
info
().
antennaNames
()[
ant
])
+
name_postfix
)
.
size
()
==
1
)
{
// Default for antenna
itsParmDB
->
getDefValues
(
string
(
itsParmExprs
[
parmExprNum
]
)
+
":"
+
string
(
info
().
antennaNames
()[
ant
])
+
name_postfix
)
.
get
(
0
,
defValues
);
ASSERT
(
defValues
.
size
()
==
1
);
defValue
=
defValues
.
data
()[
0
];
}
else
if
(
itsParmDB
->
getDefValues
(
itsParmExprs
[
parmExprNum
]).
size
()
==
1
)
{
//Default value
itsParmDB
->
getDefValues
(
itsParmExprs
[
parmExprNum
]).
get
(
0
,
defValues
);
else
if
(
itsParmDB
->
getDefValues
(
parmExpr
).
size
()
==
1
)
{
//Default value
itsParmDB
->
getDefValues
(
parmExpr
).
get
(
0
,
defValues
);
ASSERT
(
defValues
.
size
()
==
1
);
defValue
=
defValues
.
data
()[
0
];
}
else
if
(
itsParmExprs
[
parmExpr
Num
]
.
substr
(
0
,
5
)
==
"Gain:"
)
{
}
else
if
(
parmExpr
.
substr
(
0
,
5
)
==
"Gain:"
)
{
defValue
=
0.
;
}
else
{
THROW
(
Exception
,
"No parameter value found for "
+
itsParmExprs
[
parmExprNum
]
+
":"
+
info
().
antennaNames
()[
ant
]);
parmExpr
+
":"
+
string
(
info
().
antennaNames
()[
ant
])
+
name_postfix
)
;
}
parmvalues
[
parmExprNum
][
ant
].
resize
(
tfDomainSize
);
...
...
This diff is collapsed.
Click to expand it.
CEP/DP3/DPPP/test/tApplyCal2.run
+
34
−
0
View file @
b46db669
...
...
@@ -109,3 +109,37 @@ eval $cmd
$taqlexe
'select from tNDPPP-generic.MS where not(all(DATA~=9*DATA3))'
>
taql.out
diff taql.out taql.ref
||
exit
1
echo
;
echo
"Testing RotationAngle:*:phase_center values"
rm
-rf
tApplyCal.parmdb
parmdbm
<<
EOL
open table="tApplyCal.parmdb"
add RotationMeasure:CS001HBA0:phase_center values=[3.,3.,3.,3.], domain=[10e6, 200e6, 4472025735, 4972025795], shape=[2,2], shape=[2,2]
add RotationMeasure:CS002HBA0:phase_center values=[3.,3.,3.,3.], domain=[10e6, 200e6, 4472025735, 4972025795], shape=[2,2], shape=[2,2]
add RotationMeasure:CS002HBA1:phase_center values=[3.,3.,3.,3.], domain=[10e6, 200e6, 4472025735, 4972025795], shape=[2,2], shape=[2,2]
add RotationMeasure:CS004HBA1:phase_center values=[3.,3.,3.,3.], domain=[10e6, 200e6, 4472025735, 4972025795], shape=[2,2], shape=[2,2]
add RotationMeasure:RS106HBA:phase_center values=[3.,3.,3.,3.], domain=[10e6, 200e6, 4472025735, 4972025795], shape=[2,2], shape=[2,2]
add RotationMeasure:RS208HBA:phase_center values=[3.,3.,3.,3.], domain=[10e6, 200e6, 4472025735, 4972025795], shape=[2,2], shape=[2,2]
add RotationMeasure:RS305HBA:phase_center values=[3.,3.,3.,3.], domain=[10e6, 200e6, 4472025735, 4972025795], shape=[2,2], shape=[2,2]
add RotationMeasure:RS307HBA:phase_center values=[3.,3.,3.,3.], domain=[10e6, 200e6, 4472025735, 4972025795], shape=[2,2], shape=[2,2]
EOL
cmd
=
'NDPPP msin=tNDPPP-generic.MS msout=. msout.datacolumn=DATA3 steps=[applycal] applycal.parmdb=tApplyCal.parmdb applycal.correction=rotationmeasure showcounts=false'
echo
$cmd
eval
$cmd
echo
;
echo
"Testing RotationAngle:* values"
rm
-rf
tApplyCal.parmdb
parmdbm
<<
EOL
open table="tApplyCal.parmdb"
add RotationMeasure:CS001HBA0 values=[3.,3.,3.,3.], domain=[10e6, 200e6, 4472025735, 4972025795], shape=[2,2], shape=[2,2]
add RotationMeasure:CS002HBA0 values=[3.,3.,3.,3.], domain=[10e6, 200e6, 4472025735, 4972025795], shape=[2,2], shape=[2,2]
add RotationMeasure:CS002HBA1 values=[3.,3.,3.,3.], domain=[10e6, 200e6, 4472025735, 4972025795], shape=[2,2], shape=[2,2]
add RotationMeasure:CS004HBA1 values=[3.,3.,3.,3.], domain=[10e6, 200e6, 4472025735, 4972025795], shape=[2,2], shape=[2,2]
add RotationMeasure:RS106HBA values=[3.,3.,3.,3.], domain=[10e6, 200e6, 4472025735, 4972025795], shape=[2,2], shape=[2,2]
add RotationMeasure:RS208HBA values=[3.,3.,3.,3.], domain=[10e6, 200e6, 4472025735, 4972025795], shape=[2,2], shape=[2,2]
add RotationMeasure:RS305HBA values=[3.,3.,3.,3.], domain=[10e6, 200e6, 4472025735, 4972025795], shape=[2,2], shape=[2,2]
add RotationMeasure:RS307HBA values=[3.,3.,3.,3.], domain=[10e6, 200e6, 4472025735, 4972025795], shape=[2,2], shape=[2,2]
EOL
cmd
=
'NDPPP msin=tNDPPP-generic.MS msout=. msout.datacolumn=DATA3 steps=[applycal] applycal.parmdb=tApplyCal.parmdb applycal.correction=rotationmeasure showcounts=false'
echo
$cmd
eval
$cmd
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