Skip to content

Fix buffer n memory = 0 problem

Alvin Li requested to merge fix-stream-py-buffer-problem into master

Changed line 370 of gstlal/python/ from

if is_gap:


if is_gap or buf.n_memory() == 0

This is to fix a bug introduced to gstlal previously, which I believe it is when idq channel data was added into the pipeline as another stream. Especially, without this fix will cause errors when running gstlal_inspiral_calc_snr, which raises error

/usr/bin/gstlal_inspiral_calc_snr --mode 0 --reference-psd psd.xml.gz --track-psd  --gps-start-time 1381859994 --gps-end-time 1381860427 --start 1381860322 --end 1381860332 --psd-fft-length 32 --data-source frames --frame-cache frame.cache --coinc coinc.xml --outdir /home/ --svd-bank H1:/home/,L1:/home/ --channel-name H1=GDS-CALIB_STRAIN_CLEAN --channel-name=L1=GDS-CALIB_STRAIN_CLEAN --verbose
reading '/home/' ...                                              
writing '/tmp/tmpp18co4os.xml.gz' ...
writing '/tmp/tmplwdh8t19.xml.gz' ...
reading '/home/' ...                                              
writing '/tmp/tmpdi7lckq0.xml.gz' ...
writing '/tmp/tmp95ybj558.xml.gz' ...
reading 'coinc.xml' ...
Building pipeline...
Calculating SNR...
Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/gstlal/pipeparts/", line 424, in new_sample_handler                                                       
    return self.pull_buffers(elem)
  File "/usr/lib64/python3.6/site-packages/gstlal/pipeparts/", line 463, in pull_buffers                                                             
  File "/usr/lib64/python3.6/site-packages/gstlal/", line 230, in sample_handler                                                                   
    buf = self._pull_buffer(elem, caps=caps)
  File "/usr/lib64/python3.6/site-packages/gstlal/", line 392, in _pull_buffer                                                                     
    data = pipeio.array_from_audio_sample(sample)
  File "/usr/lib64/python3.6/site-packages/gstlal/", line 176, in array_from_audio_sample                                                          
    a = numpy.frombuffer(, dtype = numpy_dtype_from_caps(caps))
AttributeError: 'list' object has no attribute '__buffer__'

Merge request reports