Skip to content

Pipepart element for file source

James Kennington requested to merge feature-file-source-utility-proper into master

Motivation

Prior to this MR, it was surprisingly difficult / opaque as to how to wrap a gwf file as a gstreamer source element. This MR adds a convenience utility for constructing such an element from an arbitrary collection of gwf files. Note: this MR is a fixed version of !118 (closed)

Changes

  • Adds a files function to gstlal.pipeparts.source that can take file paths and wrap into a cache source
  • Adds a laltools module to the gstlal.utilities subpackage, with a function for creating lal cache entries
  • Adds tests for new features

Related Issues

Closes: #86 (closed)

Examples

Creating a source from a gwf file

from gstlal.pipeparts import source

# Using a sample data file added to the repo for testing
# at location gstlal/gstlal/tests/data/

file = 'path/to/gstlal/gstlal/tests/data/L-L1_GWOSC_O3a_4KHZ_R1-1238437888-4096.gwf'
src = source.files(pipeline, paths=[file], instrument='L1', channel_name='4KHZ_R1')

# Build rest of pipeline!

Merge request reports

Loading