17 """Generate simulated initial LIGO h(t)"""
18 __author__ =
"Drew Keppel <drew.keppel@ligo.org>"
28 from gstlal
import pipeutil
45 'Number of samples in each outgoing buffer',
46 0, gobject.G_MAXULONG, 16384 * 8 * 1,
47 gobject.PARAM_WRITABLE
52 'Instrument name (e.g., "H1")',
54 gobject.PARAM_WRITABLE
59 'Channel name (e.g., "LSC-STRAIN")',
61 gobject.PARAM_WRITABLE
66 gst.PadTemplate(
"src",
67 gst.PAD_SRC, gst.PAD_ALWAYS,
68 gst.caps_from_string(
"""
71 endianness = (int) BYTE_ORDER,
78 def do_set_property(self, prop, val):
79 if prop.name ==
'blocksize':
81 for elem
in self.iterate_sources():
82 elem.set_property(
'blocksize', val)
83 elif prop.name
in (
'instrument',
'channel-name'):
84 self.
__tags[prop.name] = val
85 tagstring =
','.join(
'%s="%s"' % kv
for kv
in self.__tags.iteritems())
86 self.__taginject.set_property(
'tags', tagstring)
91 Send SEEK and EOS events to the source elements, all others
92 to the by default bins send all events to the sink
97 if event.type
in (gst.EVENT_SEEK, gst.EVENT_EOS):
98 for elem
in self.iterate_sources():
99 success &= elem.send_event(event)
101 for elem
in self.iterate_sinks():
102 success &= elem.send_event(event)
107 super(lal_fakeligosrc, self).__init__()
109 self.
__tags = {
'units':
'strain'}
113 pipeutil.mkelems_in_bin(self,
114 (
'audiotestsrc', {
'wave':
'gaussian-noise',
'volume': 5.03407936516e-17,
'samplesperbuffer': 16384}),
115 *(((
'audioiirfilter', {
'a': (1.87140685e-05, 3.74281370e-05, 1.87140685e-05),
'b': (1., 1.98861643, -0.98869215)}),) * 14)
117 pipeutil.mkelems_in_bin(self,
118 (
'audiotestsrc', {
'wave':
'gaussian-noise',
'volume': 1.39238913312e-20,
'samplesperbuffer': 16384}),
119 (
'audioiirfilter', {
'a': (9.17933667e-07, 1.83586733e-06, 9.17933667e-07),
'b': (1., 1.99728828, -0.99729195)})
121 pipeutil.mkelems_in_bin(self,
122 (
'audiotestsrc', {
'wave':
'gaussian-noise',
'volume': 2.16333076528e-23,
'samplesperbuffer': 16384})
124 pipeutil.mkelems_in_bin(self,
125 (
'audiotestsrc', {
'wave':
'gaussian-noise',
'volume': 1.61077910675e-20,
'samplesperbuffer': 16384}),
126 (
'audioiirfilter', {
'a': (0.5591789, 0.5591789),
'b': (1., -0.1183578)}),
127 (
'audioiirfilter', {
'a': (0.03780506, -0.03780506),
'b': (1.0, -0.9243905)})
131 outputchain = pipeutil.mkelems_in_bin(self,
132 (
'lal_adder', {
'sync':
True}),
133 (
'audioamplify', {
'clipping-method': 3,
'amplification': 16384.**.5}),
138 chain[-1].link(outputchain[0])
141 self.add_pad(gst.ghost_pad_new_from_template(
'src', outputchain[-1].get_static_pad(
'src'), self.
__gsttemplates__[0]))
146 gobject.type_register(lal_fakeligosrc)
148 __gstelementfactory__ = (
149 lal_fakeligosrc.__name__,