Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
psrdada_cpp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
MPIfR-BDG
psrdada_cpp
Commits
d17ea1c6
Commit
d17ea1c6
authored
6 years ago
by
Tobias Winchen
Browse files
Options
Downloads
Patches
Plain Diff
Added logging output for vdif header timestamp check
parent
597621e6
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
psrdada_cpp/effelsberg/edd/src/VLBI.cu
+11
-1
11 additions, 1 deletion
psrdada_cpp/effelsberg/edd/src/VLBI.cu
psrdada_cpp/effelsberg/edd/src/dummy_data_generator.cu
+1
-1
1 addition, 1 deletion
psrdada_cpp/effelsberg/edd/src/dummy_data_generator.cu
with
12 additions
and
2 deletions
psrdada_cpp/effelsberg/edd/src/VLBI.cu
+
11
−
1
View file @
d17ea1c6
...
@@ -134,14 +134,24 @@ void VDIFHeader::setStationId(uint32_t value) {
...
@@ -134,14 +134,24 @@ void VDIFHeader::setStationId(uint32_t value) {
}
}
void
VDIFHeader
::
setTimeReferencesFromTimestamp
(
size_t
sync_time
)
{
void
VDIFHeader
::
setTimeReferencesFromTimestamp
(
size_t
sync_time
)
{
BOOST_LOG_TRIVIAL
(
debug
)
<<
"Setting time reference from timestamp: "
<<
sync_time
;
boost
::
posix_time
::
ptime
pt
=
boost
::
posix_time
::
from_time_t
(
sync_time
);
boost
::
posix_time
::
ptime
pt
=
boost
::
posix_time
::
from_time_t
(
sync_time
);
BOOST_LOG_TRIVIAL
(
debug
)
<<
" - posix_time: "
<<
pt
;
boost
::
gregorian
::
date
epochBegin
(
pt
.
date
().
year
(),
boost
::
gregorian
::
date
epochBegin
(
pt
.
date
().
year
(),
((
pt
.
date
().
month
()
<=
6
)
?
1
:
7
),
1
);
((
pt
.
date
().
month
()
<=
6
)
?
1
:
7
),
1
);
setReferenceEpoch
((
epochBegin
.
year
()
-
2000
)
*
2
+
(
epochBegin
.
month
()
>=
7
));
BOOST_LOG_TRIVIAL
(
debug
)
<<
" - epochBegin: "
<<
epochBegin
;
int
refEpoch
=
(
epochBegin
.
year
()
-
2000
)
*
2
+
(
epochBegin
.
month
()
>=
7
);
if
(
refEpoch
<
0
)
{
BOOST_LOG_TRIVIAL
(
error
)
<<
"Cannot encode time before 1 Jan 2000 - received "
<<
pt
;
}
BOOST_LOG_TRIVIAL
(
debug
)
<<
" - reference epoch: "
<<
refEpoch
;
setReferenceEpoch
(
refEpoch
);
boost
::
posix_time
::
time_duration
delta
=
boost
::
posix_time
::
time_duration
delta
=
pt
-
boost
::
posix_time
::
ptime
(
epochBegin
);
pt
-
boost
::
posix_time
::
ptime
(
epochBegin
);
BOOST_LOG_TRIVIAL
(
debug
)
<<
" - time delta since epoch begin: "
<<
delta
<<
" = "
<<
delta
.
total_seconds
();
setSecondsFromReferenceEpoch
(
delta
.
total_seconds
());
setSecondsFromReferenceEpoch
(
delta
.
total_seconds
());
BOOST_LOG_TRIVIAL
(
debug
)
<<
" Time stamp: "
<<
sync_time
BOOST_LOG_TRIVIAL
(
debug
)
<<
" Time stamp: "
<<
sync_time
...
...
This diff is collapsed.
Click to expand it.
psrdada_cpp/effelsberg/edd/src/dummy_data_generator.cu
+
1
−
1
View file @
d17ea1c6
...
@@ -133,7 +133,7 @@ int main(int argc, char **argv) {
...
@@ -133,7 +133,7 @@ int main(int argc, char **argv) {
DadaOutputStream
sink
(
output_key
,
log
);
DadaOutputStream
sink
(
output_key
,
log
);
char
header
[
4096
];
char
header
[
4096
];
std
::
strcpy
(
header
,
"HEADER DADA
\n
HDR_VERSION 1.0
\n
HDR_SIZE 4096
\n
DADA_VERSION 1.0
\n
FILE_SIZE 2013265920
\n
NBIT 32
\n
NDIM 2
\n
NPOL 1
\n
NCHAN 4096
\n
RESOLUTION 1
\n
DSB 1
\n
SYNC_TIME 123456789
\n
SAMPLE_CLOCK_START 175671842316288
\n
"
);
std
::
strcpy
(
header
,
"HEADER DADA
\n
HDR_VERSION 1.0
\n
HDR_SIZE 4096
\n
DADA_VERSION 1.0
\n
FILE_SIZE 2013265920
\n
NBIT 32
\n
NDIM 2
\n
NPOL 1
\n
NCHAN 4096
\n
RESOLUTION 1
\n
DSB 1
\n
SYNC_TIME 123456789
0
\n
SAMPLE_CLOCK_START 175671842316288
\n
"
);
...
...
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