gstlal 1.13.0
Loading...
Searching...
No Matches
gate_test_01.py
1#!/usr/bin/env python3
2# Copyright (C) 2014 Kipp Cannon
3#
4# This program is free software; you can redistribute it and/or modify it
5# under the terms of the GNU General Public License as published by the
6# Free Software Foundation; either version 2 of the License, or (at your
7# option) any later version.
8#
9# This program is distributed in the hope that it will be useful, but
10# WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
12# Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along
15# with this program; if not, write to the Free Software Foundation, Inc.,
16# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
18#
19# =============================================================================
20#
21# Preamble
22#
23# =============================================================================
24#
25
26
27import numpy
28import sys
29from gstlal import pipeparts
30import cmp_nxydumps
31import test_common
32
33
34#
35# =============================================================================
36#
37# Pipelines
38#
39# =============================================================================
40#
41
42
43def gate_test_01(pipeline, name):
44 #
45 # try changing these. test should still work!
46 #
47
48 rate = 2048 # Hz
49 gap_frequency = 13.0 # Hz
50 gap_threshold = 0.8 # of 1
51 buffer_length = 1.0 # seconds
52 test_duration = 10.0 # seconds
53
54 #
55 # build pipeline
56 #
57
58 head = test_common.gapped_test_src(pipeline, buffer_length = buffer_length, rate = rate, width = 64, test_duration = test_duration, gap_frequency = gap_frequency, gap_threshold = gap_threshold, control_dump_filename = "%s_control.dump" % name)
59 control = test_common.gapped_test_src(pipeline, buffer_length = buffer_length / 3, rate = rate, width = 32, test_duration = test_duration, gap_frequency = gap_frequency / 3, gap_threshold = gap_threshold, verbose = False)
60
61 head = pipeparts.mkgate(pipeline, head, control = control, threshold = float("+inf"))
62
63 pipeparts.mkfakesink(pipeline, head)
64
65 #
66 # done
67 #
68
69 return pipeline
70
71
72#
73# =============================================================================
74#
75# Main
76#
77# =============================================================================
78#
79
80
81test_common.build_and_run(gate_test_01, "gate_test_01a")
build_and_run(pipelinefunc, name, segment=None, **pipelinefunc_kwargs)
gapped_test_src(pipeline, buffer_length=1.0, rate=2048, width=64, channels=1, test_duration=10.0, wave=5, freq=0, gap_frequency=None, gap_threshold=None, control_dump_filename=None, tags=None, is_live=False, verbose=True)