Pipepart element for file source
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 togstlal.pipeparts.source
that can take file paths and wrap into a cache source - Adds a
laltools
module to thegstlal.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!