Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gstlal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
Duncan Macleod
gstlal
Commits
726bffc8
Commit
726bffc8
authored
5 years ago
by
Daichi Tsuna
Browse files
Options
Downloads
Patches
Plain Diff
string_triggergen.c: get PTS and DURATION for each buffer
parent
f510a54d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gstlal-burst/gst/lal/gstlal_string_triggergen.c
+29
-3
29 additions, 3 deletions
gstlal-burst/gst/lal/gstlal_string_triggergen.c
with
29 additions
and
3 deletions
gstlal-burst/gst/lal/gstlal_string_triggergen.c
+
29
−
3
View file @
726bffc8
...
...
@@ -211,6 +211,17 @@ static GstFlowReturn trigger_generator(GSTLALStringTriggergen *element, GstBuffe
length
=
get_available_samples
(
element
);
if
(
length
<
autocorrelation_length
(
element
->
autocorrelation_matrix
))
{
/* FIXME: PTS and duration are not necessarily correct.
* they're correct for now because we know how this element
* is used in the current pipeline, but in general this
* behaviour is not correct. right now, the adapter can
* only not have enough data at the start of a stream, but
* for general streams the adapter could get flushed in mid
* stream and then we might need to worry about what the
* last reported buffer's end time was. maybe. maybe not
*/
GST_BUFFER_PTS
(
outbuf
)
=
element
->
t0
;
GST_BUFFER_DURATION
(
outbuf
)
=
0
;
GST_BUFFER_OFFSET_END
(
outbuf
)
=
GST_BUFFER_OFFSET
(
outbuf
)
+
ntriggers
;
return
GST_FLOW_OK
;
}
...
...
@@ -225,11 +236,16 @@ static GstFlowReturn trigger_generator(GSTLALStringTriggergen *element, GstBuffe
/* compute the chisq norm if it doesn't exist */
if
(
!
element
->
autocorrelation_norm
)
element
->
autocorrelation_norm
=
gstlal_autocorrelation_chi2_compute_norms_string
(
element
->
autocorrelation_matrix
,
NULL
);
/* check that autocorrelation vector has odd number of samples */
g_assert
(
autocorrelation_length
(
element
->
autocorrelation_matrix
)
&
1
);
/* find events */
/* find events. earliest sample that can be a new trigger starts a
* little bit in from the start of the adapter because we are
* re-using data from the last iteration for \chi^2 calculation.
* the last sample that can be a new trigger is not at the end of
* the adapter's contents for the same reason */
snrsample
+=
(
autocorrelation_length
(
element
->
autocorrelation_matrix
)
-
1
)
/
2
*
element
->
num_templates
;
for
(
sample
=
(
autocorrelation_length
(
element
->
autocorrelation_matrix
)
-
1
)
/
2
;
sample
<
length
-
(
autocorrelation_length
(
element
->
autocorrelation_matrix
)
-
1
)
/
2
;
sample
++
){
LIGOTimeGPS
t
;
...
...
@@ -290,6 +306,16 @@ static GstFlowReturn trigger_generator(GSTLALStringTriggergen *element, GstBuffe
else
gst_buffer_remove_all_memory
(
outbuf
);
/*
* obtain PTS and DURATION of output buffer.
*/
GST_BUFFER_PTS
(
outbuf
)
=
element
->
t0
+
gst_util_uint64_scale_int_round
(
offset
+
(
autocorrelation_length
(
element
->
autocorrelation_matrix
)
-
1
)
/
2
-
element
->
offset0
,
GST_SECOND
,
GST_AUDIO_INFO_RATE
(
&
element
->
audio_info
));
for
(
channel
=
0
;
channel
<
element
->
num_templates
;
channel
++
)
if
(
element
->
bank
[
channel
].
snr
>
0
.
0
&&
(
GstClockTime
)
XLALGPSToINT8NS
(
&
element
->
bank
[
channel
].
peak_time
)
<
GST_BUFFER_PTS
(
outbuf
))
GST_BUFFER_PTS
(
outbuf
)
=
XLALGPSToINT8NS
(
&
element
->
bank
[
channel
].
peak_time
);
GST_BUFFER_DURATION
(
outbuf
)
=
element
->
t0
+
gst_util_uint64_scale_int_round
(
offset
+
length
-
(
autocorrelation_length
(
element
->
autocorrelation_matrix
)
-
1
)
/
2
-
element
->
offset0
,
GST_SECOND
,
GST_AUDIO_INFO_RATE
(
&
element
->
audio_info
))
-
GST_BUFFER_PTS
(
outbuf
);
GST_BUFFER_OFFSET_END
(
outbuf
)
=
GST_BUFFER_OFFSET
(
outbuf
)
+
ntriggers
;
return
GST_FLOW_OK
;
...
...
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