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
c22163ef
Commit
c22163ef
authored
7 years ago
by
Patrick Godwin
Browse files
Options
Downloads
Patches
Plain Diff
gstlal_etg: added filtering of trigger production to only include times within frame segments
parent
98192758
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-ugly/bin/gstlal_etg
+37
-25
37 additions, 25 deletions
gstlal-ugly/bin/gstlal_etg
with
37 additions
and
25 deletions
gstlal-ugly/bin/gstlal_etg
+
37
−
25
View file @
c22163ef
...
...
@@ -37,14 +37,23 @@ import threading
import shutil
import traceback
import numpy
import gi
gi.require_version('Gst', '1.0')
from gi.repository import GObject, Gst
GObject.threads_init()
Gst.init(None)
import lal
from lal import LIGOTimeGPS
import numpy
from glue import iterutils
from glue import segments
from glue.ligolw import ligolw
from glue.ligolw import utils as ligolw_utils
from glue.ligolw.utils import process as ligolw_process
from glue.ligolw.utils import segments as ligolw_segments
from gstlal import pipeio
from gstlal import datasource
...
...
@@ -57,10 +66,6 @@ from gstlal import aggregator
from gstlal import idq_aggregator
from gstlal import httpinterface
from gstlal import bottle
from glue import iterutils
from glue.ligolw import ligolw
from glue.ligolw import utils as ligolw_utils
from glue.ligolw.utils import process as ligolw_process
#
# Make sure we have sufficient resources
...
...
@@ -183,6 +188,7 @@ class MultiChannelHandler(simplehandler.Handler):
self.out_path =
kwargs.pop("out_path")
self.instrument =
kwargs.pop("instrument")
self.keys =
kwargs.pop("keys")
self.frame_segments =
kwargs.pop("frame_segments")
#
set
initialization
time
if
options.data_source
in
("
framexmit
",
"
lvshm
")
:
...
...
@@ -354,27 +360,33 @@ class MultiChannelHandler(simplehandler.Handler):
Given
a
channel
,
rate
,
and
the
current
buffer
time
,
will
process
a
row
from
a
gstreamer
buffer.
"""
trigger_time =
row.end_time
+
row.end_time_ns
*
1
e-9
if
options.latency:
latency =
numpy.round(int(aggregator.now())
-
buftime
)
freq
,
q
,
duration =
self.basis_params[(channel,
rate
)][
row.channel_index
]
start_time =
trigger_time
-
duration
channel_tag =
('%s_%i_%i'
%(
channel
,
rate
/4,
rate
/2)).
replace
("
:
","
_
",1)
#
NOTE
#
Setting
stop
time
to
trigger
time
for
use
with
half
sine
gaussians
stop_time =
trigger_time
#
append
row
to
feature
vector
for
bottle
requests
etg_row =
{'timestamp':
buftime
,
'
channel
'
:
channel
,
'
rate
'
:
rate
,
'
start_time
'
:
start_time
,
'
stop_time
'
:
stop_time
,
'
trigger_time
'
:
trigger_time
,
'
frequency
'
:
freq
,
'
q
'
:
q
,
'
phase
'
:
row.phase
,
'
sigmasq
'
:
row.sigmasq
,
'
chisq
'
:
row.chisq
,
'
snr
'
:
row.snr
}
self.etg_event.append
(
etg_row
)
#
save
iDQ
compatible
data
if
options.save_hdf:
self.fdata.append
(
etg_row
,
key =
(channel,
rate
),
buftime =
buftime)
else:
#
if
segments
provided
,
ensure
that
trigger
falls
within
these
segments
if
self.frame_segments:
trigger_seg =
segments.segment(LIGOTimeGPS(row.end_time,
row.end_time_ns
),
LIGOTimeGPS
(
row.end_time
,
row.end_time_ns
))
if
not
self.frame_segments
or
self.frame_segments.intersects_segment
(
trigger_seg
)
:
trigger_time =
row.end_time
+
row.end_time_ns
*
1
e-9
if
options.latency:
self.fdata.append
("%20.9
f
\
t
%20.9
f
\
t
%20.9
f
\
t
%10.3
f
\
t
%8.3
f
\
t
%8.3
f
\
t
%8.3
f
\
t
%10.3
f
\
t
%
s
\
t
%.2
f
\
n
"
%
(
start_time
,
stop_time
,
trigger_time
,
freq
,
row.phase
,
q
,
row.chisq
,
row.snr
,
channel_tag
,
latency
))
latency =
numpy.round(int(aggregator.now())
-
buftime
)
freq
,
q
,
duration =
self.basis_params[(channel,
rate
)][
row.channel_index
]
start_time =
trigger_time
-
duration
channel_tag =
('%s_%i_%i'
%(
channel
,
rate
/4,
rate
/2)).
replace
("
:
","
_
",1)
#
NOTE
#
Setting
stop
time
to
trigger
time
for
use
with
half
sine
gaussians
stop_time =
trigger_time
#
append
row
to
feature
vector
for
bottle
requests
etg_row =
{'timestamp':
buftime
,
'
channel
'
:
channel
,
'
rate
'
:
rate
,
'
start_time
'
:
start_time
,
'
stop_time
'
:
stop_time
,
'
trigger_time
'
:
trigger_time
,
'
frequency
'
:
freq
,
'
q
'
:
q
,
'
phase
'
:
row.phase
,
'
sigmasq
'
:
row.sigmasq
,
'
chisq
'
:
row.chisq
,
'
snr
'
:
row.snr
}
self.etg_event.append
(
etg_row
)
#
save
iDQ
compatible
data
if
options.save_hdf:
self.fdata.append
(
etg_row
,
key =
(channel,
rate
),
buftime =
buftime)
else:
self.fdata.append
("%20.9
f
\
t
%20.9
f
\
t
%20.9
f
\
t
%10.3
f
\
t
%8.3
f
\
t
%8.3
f
\
t
%8.3
f
\
t
%10.3
f
\
t
%
s
\
n
"
%
(
start_time
,
stop_time
,
trigger_time
,
freq
,
row.phase
,
q
,
row.chisq
,
row.snr
,
channel_tag
))
if
options.latency:
self.fdata.append
("%20.9
f
\
t
%20.9
f
\
t
%20.9
f
\
t
%10.3
f
\
t
%8.3
f
\
t
%8.3
f
\
t
%8.3
f
\
t
%10.3
f
\
t
%
s
\
t
%.2
f
\
n
"
%
(
start_time
,
stop_time
,
trigger_time
,
freq
,
row.phase
,
q
,
row.chisq
,
row.snr
,
channel_tag
,
latency
))
else:
self.fdata.append
("%20.9
f
\
t
%20.9
f
\
t
%20.9
f
\
t
%10.3
f
\
t
%8.3
f
\
t
%8.3
f
\
t
%8.3
f
\
t
%10.3
f
\
t
%
s
\
n
"
%
(
start_time
,
stop_time
,
trigger_time
,
freq
,
row.phase
,
q
,
row.chisq
,
row.snr
,
channel_tag
))
def
to_trigger_file
(
self
,
buftime =
None):
...
...
@@ -721,7 +733,7 @@ for channel in channels:
if
options.verbose:
print
>
>sys.stderr, "attaching appsinks to pipeline..."
handler = MultiChannelHandler(mainloop, pipeline, basis_params = basis_params, description = options.description, out_path = options.out_path, instrument = instrument, keys = src.keys())
handler = MultiChannelHandler(mainloop, pipeline, basis_params = basis_params, description = options.description, out_path = options.out_path, instrument = instrument, keys = src.keys()
, frame_segments = data_source_info.frame_segments
)
appsync = LinkedAppSync(appsink_new_buffer = handler.bufhandler)
appsinks = set(appsync.add_sink(pipeline, src[(channel, rate)], name = "sink_%s_%s" % (rate, channel)) for (channel, rate) in src.keys())
...
...
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