pipeparts.source module¶
Module for producing source elements
- class pipeparts.source.AudioTestWaveform[source]¶
Bases:
object
Enumeration of test waveforms
- References:
- BlueNoise = 11¶
- GaussianNoise = 9¶
- PinkNoise = 6¶
- RedNoise = 10¶
- Saw = 2¶
- Silence = 4¶
- Sine = 0¶
- SineTable = 7¶
- Square = 1¶
- Ticks = 8¶
- Triangle = 3¶
- VioletNoise = 12¶
- WhiteNoise = 5¶
- class pipeparts.source.NDSChannelType[source]¶
Bases:
object
Enumeration of NDS channel types
- References:
Implementation: gstlal-ugly/gst/nds/ndssrc.c
- MinuteTrend = 'm-trend'¶
- Online = 'online'¶
- Raw = 'raw'¶
- Reduced = 'reduced'¶
- SecondTrend = 's-trend'¶
- TestPoint = 'test-pt'¶
- Unknown = 'unknown'¶
- class pipeparts.source.SrcDeferredLink(element, srcpadname, sinkpad)[source]¶
Bases:
object
A class that manages the task of watching for and connecting to new source pads by name. The inputs are an element, the name of the source pad to watch for on that element, and the sink pad (on a different element) to which the source pad should be linked when it appears.
The “pad-added” signal of the element will be used to watch for new pads, and if the “no-more-pads” signal is emitted by the element before the requested pad has appeared ValueError is raised.
- pipeparts.source.audio_test(pipeline: Pipeline, freq: float = 440, volume: float = 0.8, wave: int = 0, samples_per_buffer: int = 1024, **properties) Element [source]¶
AudioTestSrc can be used to generate basic audio signals. It support several different waveforms and allows to set the base frequency and volume. Some waveforms might use additional properties.
- Args:
- pipeline:
Gst.Pipeline, the pipeline to which the new element will be added
- freq:
float, Frequency of test signal. The sample rate needs to be at least 2 times higher.
- volume:
float, default 0.8, Volume of test signal
- wave:
- int, default 0, the type of waveform to produce. Options are:
sine (0) – Sine square (1) – Square saw (2) – Saw triangle (3) – Triangle silence (4) – Silence white-noise (5) – White uniform noise pink-noise (6) – Pink noise sine-table (7) – Sine table ticks (8) – Periodic Ticks gaussian-noise (9) – White Gaussian noise red-noise (10) – Red (brownian) noise blue-noise (11) – Blue noise violet-noise (12) – Violet noise
- samples_per_buffer:
int, default 1024, Number of samples in each outgoing buffer. Must be at least twice ‘freq’
**properties:
- References:
[1] https://gstreamer.freedesktop.org/documentation/audiotestsrc/index.html?gi-language=python
- Returns:
Element
- pipeparts.source.cache(pipeline: Pipeline, location: str, use_mmap: bool = True, **properties) Element [source]¶
Retrieve frame files from locations recorded in a LAL cache file.
- Args:
- pipeline:
Gst.Pipeline, the pipeline to which the new element will be added
- location:
str, Path to LAL cache file.
- use_mmap:
bool, default True, if True Use mmap() instead of read()
**properties:
- References:
Implementation: gstlal/gst/lal/gstlal_cachesrc.c
- Returns:
Element
- pipeparts.source.devshm(pipeline: Pipeline, shm_dirname: str, **properties) Element [source]¶
LIGO-Virgo /dev/shm frame file source element
- Args:
- pipeline:
Gst.Pipeline, the pipeline to which the new element will be added
- shm_dirname:
str, Shared memory directory name (full path). Suggestion: /dev/shm/kafka/L1_O3ReplayMDC
**properties:
- References:
Implementation: gstlal-ugly/gst/gds/devshmsrc.cc
- Returns:
Element
- pipeparts.source.fake(pipeline: Pipeline, instrument: str, channel_name: str, blocksize: Optional[int] = None, volume: float = 1e-20, is_live: bool = False, wave: int = 9, rate: int = 16384, **properties) Element [source]¶
Create an audio_test source with several additional, lal-specific caps specified
- Args:
- pipeline:
Gst.Pipeline, the pipeline to which the new element will be added
- instrument:
str, name of instrument
- channel_name:
str, name of input channel
- blocksize:
int, default 1 second * rate samples/second * 8
- volume:
float, default 1e-20, the sample volume
- is_live:
bool, default False, whether or not audio_test source will behave like live source
- wave:
int, default 9 (Gaussian Noise), see AudioTestWaveform enum for options
- rate:
int, default 16384, sample rate
**properties:
- Returns:
Element
- pipeparts.source.fake_aligo(pipeline: Pipeline, instrument: Optional[str] = None, channel_name: Optional[str] = None, blocksize: int = 131072) Element [source]¶
Fake Advanced LIGO Source
- Args:
- pipeline:
Gst.Pipeline, the pipeline to which the new element will be added
- instrument:
str, default None
- channel_name:
str, default None
- blocksize:
int, default 16384 * 8 * 1, Number of samples in each outgoing buffer
- References:
Implementation gstlal/gst/python/lal_fakeadvligosrc.py
- Returns:
Element
- pipeparts.source.fake_avirgo(pipeline: Pipeline, instrument: Optional[str] = None, channel_name: Optional[str] = None, blocksize: int = 131072) Element [source]¶
Fake Advanced Virgo Source
- Args:
- pipeline:
Gst.Pipeline, the pipeline to which the new element will be added
- instrument:
str, default None
- channel_name:
str, default None
- blocksize:
int, default 16384 * 8 * 1, Number of samples in each outgoing buffer
- References:
Implementation gstlal/gst/python/lal_fakeadvvirgosrc.py
- Returns:
Element
- pipeparts.source.fake_ligo(pipeline: Pipeline, instrument: Optional[str] = None, channel_name: Optional[str] = None, blocksize: int = 131072) Element [source]¶
Fake LIGO Source
- Args:
- pipeline:
Gst.Pipeline, the pipeline to which the new element will be added
- instrument:
str, default None
- channel_name:
str, default None
- blocksize:
int, default 16384 * 8 * 1, Number of samples in each outgoing buffer
- References:
Implementation gstlal/gst/python/lal_fakeligosrc.py
- Returns:
Element
- pipeparts.source.files(pipeline: Pipeline, paths: Iterable[Union[str, Path]], instrument: str, channel_name: str, cache_path: Optional[Union[str, Path]] = None) Element [source]¶
Create a source from a list of file paths
- Args:
- pipeline:
Gst.Pipeline, the pipeline to which the new element will be added
- paths:
Iterable[Path or str], the full paths to the frame files
- cache_path:
Path or str, default None, the path to write out the cache file if specified, else write to temporary directory
- Notes:
This is a convenience utility around cache source and framecppdemux that creates a cache file from a list of file paths
- Returns:
Element
- pipeparts.source.framexmit(pipeline: Pipeline, multicast_group: str = '0.0.0.0', port: int = 0, **properties) Element [source]¶
FrameXMIT based source element
- Args:
- pipeline:
Gst.Pipeline, the pipeline to which the new element will be added
- multicast_group:
str, default “0.0.0.0”, The address of multicast group to join. If no multicast address is supplied, the receiver will listen for UDP/IP broadcast transmissions at the specified port.
- port:
int, default 0, The local port on which to receive broadcasts (0 = allocate). These ports can be reused by multiple applications.
**properties:
- References:
Implementation: gstlal-ugly/gst/gds/framexmitsrc.cc
- Returns:
Element
- pipeparts.source.lvshm(pipeline: Pipeline, shm_name: str, **properties) Element [source]¶
LIGO-Virgo shared memory frame file source element
- Args:
- pipeline:
Gst.Pipeline, the pipeline to which the new element will be added
- shm_name:
str, Shared memory partition name. Suggestions: LHO_Data, LLO_Data, VIRGO_Data
**properties:
- References:
Implementation: gstlal-ugly/gst/gds/lvshmsrc.cc
- Returns:
Element
- pipeparts.source.nds(pipeline: Pipeline, host: str, instrument: str, channel_name: str, channel_type: str, blocksize: int = 131072, port: int = 31200) Element [source]¶
NDS-based src element
- Args:
- pipeline:
Gst.Pipeline, the pipeline to which the new element will be added
- host:
str, NDS1 or NDS2 remote host name or IP address
- instrument:
str, name of instrument
- channel_name:
str, Name of the desired NDS channel.
- channel_type:
str, Type of the desired NDS channel.
- blocksize:
int, default 16384 * 8 * 1, blocksize
- port:
int, NDS1 or NDS2 remote host port
- References:
Implementation: gstlal-ugly/gst/nds/ndssrc.c
- Returns:
Element
- pipeparts.source.segment(pipeline: Pipeline, segment_list: List[Tuple[LIGOTimeGPS, LIGOTimeGPS]], blocksize: int = 4096, invert_output: bool = False) Element [source]¶
The output is a buffer of boolean values specifying when a list of segments are on and off.
- Args:
- pipeline:
Gst.Pipeline, the pipeline to which the new element will be added
- segment_list:
Iterable[Tuple[TimeGPS, TimeGPS]], list of segment start / stop times
- blocksize:
int, default blocksize is 4096 seconds of unsigned integers at 1 Hz, e.g. segments without nanoseconds
- invert_output:
bool, default False, False = output is high in segments (default), True = output is low in segments
- References:
Implementation: gstlal/gst/lal/gstlal_segmentsrc.c
- Returns:
Element