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
a3db9eb8
Commit
a3db9eb8
authored
6 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
COB-56
: Added test to check for correct storage of UVW MEASINFO reference frame
parent
319129af
No related branches found
No related tags found
1 merge request
!6
Import cobalt2 into lofar4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
RTCP/Cobalt/OutputProc/test/CMakeLists.txt
+1
-1
1 addition, 1 deletion
RTCP/Cobalt/OutputProc/test/CMakeLists.txt
RTCP/Cobalt/OutputProc/test/tMeasurementSetFormat.cc
+54
-20
54 additions, 20 deletions
RTCP/Cobalt/OutputProc/test/tMeasurementSetFormat.cc
with
55 additions
and
21 deletions
RTCP/Cobalt/OutputProc/test/CMakeLists.txt
+
1
−
1
View file @
a3db9eb8
...
@@ -5,9 +5,9 @@ include(LofarCTest)
...
@@ -5,9 +5,9 @@ include(LofarCTest)
if
(
UNITTEST++_FOUND
)
if
(
UNITTEST++_FOUND
)
lofar_add_test
(
tSubbandWriter tSubbandWriter.cc
)
lofar_add_test
(
tSubbandWriter tSubbandWriter.cc
)
lofar_add_test
(
tOutputThread tOutputThread.cc
)
lofar_add_test
(
tOutputThread tOutputThread.cc
)
lofar_add_test
(
tMeasurementSetFormat tMeasurementSetFormat.cc
)
endif
()
endif
()
lofar_add_test
(
tMeasurementSetFormat tMeasurementSetFormat.cc
)
lofar_add_test
(
tMSWriterDAL tMSWriterDAL.cc
)
lofar_add_test
(
tMSWriterDAL tMSWriterDAL.cc
)
# The MS Writer needs the LOFAR Storage manager and static meta data files.
# The MS Writer needs the LOFAR Storage manager and static meta data files.
# For production, LOFARROOT is used, but build/source dir structure differs
# For production, LOFARROOT is used, but build/source dir structure differs
...
...
This diff is collapsed.
Click to expand it.
RTCP/Cobalt/OutputProc/test/tMeasurementSetFormat.cc
+
54
−
20
View file @
a3db9eb8
...
@@ -21,12 +21,16 @@
...
@@ -21,12 +21,16 @@
#include
<lofar_config.h>
#include
<lofar_config.h>
#include
<string>
#include
<string>
#include
<cstdio>
#include
<Common/LofarLogger.h>
#include
<Common/LofarLogger.h>
#include
<Common/Exception.h>
#include
<Common/Exception.h>
#include
<OutputProc/MeasurementSetFormat.h>
#include
<OutputProc/MeasurementSetFormat.h>
#include
<casacore/casa/IO/RegularFileIO.h>
#include
<casacore/casa/IO/RegularFileIO.h>
#include
<casacore/tables/Tables.h>
#include
<UnitTest++.h>
#include
<boost/format.hpp>
using
namespace
LOFAR
;
using
namespace
LOFAR
;
using
namespace
LOFAR
::
Cobalt
;
using
namespace
LOFAR
::
Cobalt
;
...
@@ -36,28 +40,58 @@ using namespace std;
...
@@ -36,28 +40,58 @@ using namespace std;
// Define handler that tries to print a backtrace.
// Define handler that tries to print a backtrace.
Exception
::
TerminateHandler
t
(
Exception
::
terminate
);
Exception
::
TerminateHandler
t
(
Exception
::
terminate
);
// create a MS using settings for subband 0 from a parset
void
createMS
(
const
string
&
parsetName
,
const
string
&
msName
)
{
Parset
parset
(
parsetName
);
MeasurementSetFormat
msf
(
parset
);
msf
.
addSubband
(
msName
,
0
);
// Also create the data file, otherwise it is not a true table.
RegularFileIO
file
(
String
(
msName
+
"/table.f0data"
),
ByteIO
::
New
);
}
string
getMeasInfoRef
(
const
string
&
msName
)
{
TableDesc
desc
;
Table
::
getLayout
(
desc
,
msName
);
ColumnDesc
&
col
(
desc
.
rwColumnDesc
(
"UVW"
));
TableRecord
rec
=
col
.
keywordSet
().
asRecord
(
"MEASINFO"
);
String
ref
;
rec
.
get
(
"Ref"
,
ref
);
return
ref
;
}
TEST
(
J2000
)
{
const
string
parsetName
=
"tMeasurementSetFormat.parset-j2000"
;
const
string
msName
=
"tMeasurementSetFormat_tmp-j2000.MS"
;
LOG_DEBUG_STR
(
"Testing "
<<
parsetName
);
createMS
(
parsetName
,
msName
);
CHECK_EQUAL
(
"J2000"
,
getMeasInfoRef
(
msName
));
}
TEST
(
SUN
)
{
const
string
parsetName
=
"tMeasurementSetFormat.parset-sun"
;
const
string
msName
=
"tMeasurementSetFormat_tmp-sun.MS"
;
LOG_DEBUG_STR
(
"Testing "
<<
parsetName
);
createMS
(
parsetName
,
msName
);
CHECK_EQUAL
(
"SUN"
,
getMeasInfoRef
(
msName
));
}
int
main
()
int
main
()
{
{
INIT_LOGGER
(
"tMeasurementSetFormat"
);
INIT_LOGGER
(
"tMeasurementSetFormat"
);
const
string
suffixes
[]
=
{
"-j2000"
,
"-sun"
};
return
UnitTest
::
RunAllTests
()
>
0
;
for
(
unsigned
i
=
0
;
i
<
sizeof
suffixes
/
sizeof
suffixes
[
0
];
i
++
)
{
const
string
parsetName
=
string
(
"tMeasurementSetFormat.parset"
)
+
suffixes
[
i
];
const
string
msName
=
string
(
"tMeasurementSetFormat_tmp"
)
+
suffixes
[
i
]
+
".MS"
;
LOG_DEBUG_STR
(
"Testing "
<<
parsetName
);
Parset
parset
(
parsetName
);
MeasurementSetFormat
msf
(
parset
);
msf
.
addSubband
(
msName
,
0
);
// Also create the data file, otherwise it is not a true table.
///FILE* file= fopen ("tMeasurementSetFormat_tmp.ms/f0data", "w");
///fclose (file);
RegularFileIO
file
(
String
(
msName
+
"/table.f0data"
),
ByteIO
::
New
);
}
return
0
;
}
}
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