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
90b37098
Commit
90b37098
authored
14 years ago
by
Ger van Diepen
Browse files
Options
Downloads
Patches
Plain Diff
bug 1660:
Split create into create and fill
parent
4c5cd7b4
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
LCS/MSLofar/include/MSLofar/BeamTables.h
+8
-5
8 additions, 5 deletions
LCS/MSLofar/include/MSLofar/BeamTables.h
LCS/MSLofar/src/BeamTables.cc
+26
-18
26 additions, 18 deletions
LCS/MSLofar/src/BeamTables.cc
LCS/MSLofar/src/makebeamtables.cc
+2
-2
2 additions, 2 deletions
LCS/MSLofar/src/makebeamtables.cc
with
36 additions
and
25 deletions
LCS/MSLofar/include/MSLofar/BeamTables.h
+
8
−
5
View file @
90b37098
...
@@ -54,14 +54,17 @@ namespace LOFAR {
...
@@ -54,14 +54,17 @@ namespace LOFAR {
{
{
public:
public:
// Create
and fill
the subtables and attach them to the MS.
// Create the subtables and attach them to the MS.
static
void
create
(
casa
::
Table
&
ms
,
static
void
create
(
casa
::
Table
&
ms
,
const
string
&
antennaSet
,
const
string
&
antennaSetFileName
,
const
string
&
antennaFieldDir
,
const
string
&
iHBADeltaDir
,
bool
overwrite
=
false
);
bool
overwrite
=
false
);
// Fill the subtables. They should be empty.
static
void
fill
(
casa
::
Table
&
ms
,
const
string
&
antennaSet
,
const
string
&
antennaSetFileName
,
const
string
&
antennaFieldDir
,
const
string
&
iHBADeltaDir
);
// Write an AntennaField entry in the given row.
// Write an AntennaField entry in the given row.
static
void
writeAntField
(
MSAntennaFieldColumns
&
columns
,
int
rownr
,
static
void
writeAntField
(
MSAntennaFieldColumns
&
columns
,
int
rownr
,
int
antennaId
,
const
string
&
stationName
,
int
antennaId
,
const
string
&
stationName
,
...
...
This diff is collapsed.
Click to expand it.
LCS/MSLofar/src/BeamTables.cc
+
26
−
18
View file @
90b37098
...
@@ -41,25 +41,8 @@
...
@@ -41,25 +41,8 @@
using
namespace
LOFAR
;
using
namespace
LOFAR
;
using
namespace
casa
;
using
namespace
casa
;
void
BeamTables
::
create
(
Table
&
ms
,
void
BeamTables
::
create
(
Table
&
ms
,
bool
overwrite
)
const
string
&
antennaSetName
,
const
string
&
antennaSetFileName
,
const
string
&
antennaFieldDir
,
const
string
&
iHBADeltaDir
,
bool
overwrite
)
{
{
// Open the AntennaSets file.
AntennaSets
antennaSet
(
antennaSetFileName
);
// If needed, append a trailing slash to the directory names.
string
antFieldPath
(
antennaFieldDir
);
if
(
!
antFieldPath
.
empty
()
&&
antFieldPath
[
antFieldPath
.
size
()
-
1
]
!=
'/'
)
{
antFieldPath
.
append
(
"/"
);
}
string
hbaDeltaPath
(
iHBADeltaDir
);
if
(
!
hbaDeltaPath
.
empty
()
&&
hbaDeltaPath
[
hbaDeltaPath
.
size
()
-
1
]
!=
'/'
)
{
hbaDeltaPath
.
append
(
"/"
);
}
// If no overwrite, check if the subtables already exist.
// If no overwrite, check if the subtables already exist.
if
(
!
overwrite
)
{
if
(
!
overwrite
)
{
ASSERTSTR
(
!
ms
.
keywordSet
().
isDefined
(
"LOFAR_ANTENNA_FIELD"
),
ASSERTSTR
(
!
ms
.
keywordSet
().
isDefined
(
"LOFAR_ANTENNA_FIELD"
),
...
@@ -80,6 +63,31 @@ void BeamTables::create (Table& ms,
...
@@ -80,6 +63,31 @@ void BeamTables::create (Table& ms,
ms
.
rwKeywordSet
().
defineTable
(
"LOFAR_STATION"
,
statTab
);
ms
.
rwKeywordSet
().
defineTable
(
"LOFAR_STATION"
,
statTab
);
ms
.
rwKeywordSet
().
defineTable
(
"LOFAR_ANTENNA_FIELD"
,
antfTab
);
ms
.
rwKeywordSet
().
defineTable
(
"LOFAR_ANTENNA_FIELD"
,
antfTab
);
ms
.
rwKeywordSet
().
defineTable
(
"LOFAR_ELEMENT_FAILURE"
,
failTab
);
ms
.
rwKeywordSet
().
defineTable
(
"LOFAR_ELEMENT_FAILURE"
,
failTab
);
}
void
BeamTables
::
fill
(
Table
&
ms
,
const
string
&
antennaSetName
,
const
string
&
antennaSetFileName
,
const
string
&
antennaFieldDir
,
const
string
&
iHBADeltaDir
)
{
// Open the AntennaSets file.
AntennaSets
antennaSet
(
antennaSetFileName
);
// If needed, append a trailing slash to the directory names.
string
antFieldPath
(
antennaFieldDir
);
if
(
!
antFieldPath
.
empty
()
&&
antFieldPath
[
antFieldPath
.
size
()
-
1
]
!=
'/'
)
{
antFieldPath
.
append
(
"/"
);
}
string
hbaDeltaPath
(
iHBADeltaDir
);
if
(
!
hbaDeltaPath
.
empty
()
&&
hbaDeltaPath
[
hbaDeltaPath
.
size
()
-
1
]
!=
'/'
)
{
hbaDeltaPath
.
append
(
"/"
);
}
// Open the subtables.
MSStation
statTab
(
ms
.
keywordSet
().
asTable
(
"LOFAR_STATION"
));
MSAntennaField
antfTab
(
ms
.
keywordSet
().
asTable
(
"LOFAR_ANTENNA_FIELD"
));
ASSERTSTR
(
statTab
.
nrow
()
==
0
&&
antfTab
.
nrow
()
==
0
,
"LOFAR_STATION and LOFAR_ANTENNA_FIELD subtables should be empty"
);
// Create the column objects of those tables.
// Create the column objects of those tables.
MSStationColumns
statCols
(
statTab
);
MSStationColumns
statCols
(
statTab
);
MSAntennaFieldColumns
antfCols
(
antfTab
);
MSAntennaFieldColumns
antfCols
(
antfTab
);
...
...
This diff is collapsed.
Click to expand it.
LCS/MSLofar/src/makebeamtables.cc
+
2
−
2
View file @
90b37098
...
@@ -62,8 +62,8 @@ int main (int argc, char* argv[])
...
@@ -62,8 +62,8 @@ int main (int argc, char* argv[])
String
hbaDeltaDir
=
inputs
.
getString
(
"ihbadeltadir"
);
String
hbaDeltaDir
=
inputs
.
getString
(
"ihbadeltadir"
);
Bool
overwrite
=
inputs
.
getBool
(
"overwrite"
);
Bool
overwrite
=
inputs
.
getBool
(
"overwrite"
);
MeasurementSet
ms
(
msName
,
Table
::
Update
);
MeasurementSet
ms
(
msName
,
Table
::
Update
);
BeamTables
::
create
(
ms
,
antSet
,
antSetFile
,
BeamTables
::
create
(
ms
,
overwrite
);
antFieldDir
,
hbaDeltaDir
,
overwrite
);
BeamTables
::
fill
(
ms
,
antSet
,
antSetFile
,
antFieldDir
,
hbaDeltaDir
);
}
catch
(
std
::
exception
&
x
)
{
}
catch
(
std
::
exception
&
x
)
{
cout
<<
"Unexpected exception: "
<<
x
.
what
()
<<
endl
;
cout
<<
"Unexpected exception: "
<<
x
.
what
()
<<
endl
;
return
1
;
return
1
;
...
...
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