18 Generate simulated Advanced LIGO h(t) based on ZERO DET, high power in
19 http://lhocds.ligo-wa.caltech.edu:8000/advligo/AdvLIGO_noise_curves
21 __author__ =
"Drew Keppel <drew.keppel@ligo.org>, Leo Singer <leo.singer@ligo.org>"
30 from gstlal
import pipeutil
32 from math
import cos, pi, sqrt
38 'Fake Advanced LIGO Source',
48 'Number of samples in each outgoing buffer',
49 0, gobject.G_MAXULONG, 16384 * 8 * 1,
50 gobject.PARAM_WRITABLE
55 'Instrument name (e.g., "H1")',
57 gobject.PARAM_WRITABLE
62 'Channel name (e.g., "LSC-STRAIN")',
64 gobject.PARAM_WRITABLE
69 gst.PadTemplate(
"src",
70 gst.PAD_SRC, gst.PAD_ALWAYS,
71 gst.caps_from_string(
"""
74 endianness = (int) BYTE_ORDER,
81 def do_set_property(self, prop, val):
82 if prop.name ==
'blocksize':
84 for elem
in self.iterate_sources():
85 elem.set_property(
'blocksize', val)
86 elif prop.name
in (
'instrument',
'channel-name'):
87 self.
__tags[prop.name] = val
88 tagstring =
','.join(
'%s="%s"' % kv
for kv
in self.__tags.iteritems())
89 self.__taginject.set_property(
'tags', tagstring)
94 Send SEEK and EOS events to the source elements, all others
95 to the by default bins send all events to the sink
100 if event.type
in (gst.EVENT_SEEK, gst.EVENT_EOS):
101 for elem
in self.iterate_sources():
102 success &= elem.send_event(event)
104 for elem
in self.iterate_sinks():
105 success &= elem.send_event(event)
110 super(lal_fakeadvligosrc, self).__init__()
112 self.
__tags = {
'units':
'strain'}
115 pipeutil.mkelems_in_bin(self,
116 (
'audiotestsrc', {
'wave':
'gaussian-noise',
'volume': 4e-28,
'samplesperbuffer': 16384}),
117 (
'audioiirfilter', {
'a': (1.,),
'b': (-1., 2*cos(2*pi*9.103/16384)*0.99995, -1.*0.99995**2)}),
119 pipeutil.mkelems_in_bin(self,
120 (
'audiotestsrc', {
'wave':
'gaussian-noise',
'volume': 1.1e-23,
'samplesperbuffer': 16384}),
121 (
'audiofirfilter', {
'kernel': (1., -1.)}),
123 pipeutil.mkelems_in_bin(self,
124 (
'audiotestsrc', {
'wave':
'gaussian-noise',
'volume': 1e-27,
'samplesperbuffer': 16384}),
125 (
'audioiirfilter', {
'a': (1.,),
'b': (-1.0, 2 * 0.999, -.999**2)}),
127 pipeutil.mkelems_in_bin(self,
128 (
'audiotestsrc', {
'wave':
'gaussian-noise',
'volume': 4e-26,
'samplesperbuffer': 16384}),
129 (
'audioiirfilter', {
'a': (1.,),
'b': (-1., 2*cos(2*pi*50./16384)*.87, -.87**2)}),
131 pipeutil.mkelems_in_bin(self,
132 (
'audiotestsrc', {
'wave':
'gaussian-noise',
'volume': 6.5e-24,
'samplesperbuffer': 16384}),
133 (
'audioiirfilter', {
'a': (1.,),
'b': (-1., -2*.45, -.45**2)}),
137 outputchain = pipeutil.mkelems_in_bin(self,
138 (
'lal_adder', {
'sync':
True}),
139 (
'audioamplify', {
'clipping-method': 3,
'amplification': sqrt(16384.)*3/4}),
144 chain[-1].link(outputchain[0])
147 self.add_pad(gst.ghost_pad_new_from_template(
'src', outputchain[-1].get_static_pad(
'src'), self.
__gsttemplates__[0]))
152 gobject.type_register(lal_fakeadvligosrc)
154 __gstelementfactory__ = (
155 lal_fakeadvligosrc.__name__,