Package pylal :: Module seriesutils
[hide private]
[frames] | no frames]

Module seriesutils

source code

This module provides a bunch of user-friendly wrappers to the SWIG-bound REAL8TimeSeries and REAL8FrequencySeries objects and their associated functions.

Functions [hide private]
 
fromarray(array, name="", epoch=lal.LIGOTimeGPS(), f0=0, deltaT=1, sampleUnits=lal.DimensionlessUnit, frequencyseries=False)
Convert numpy.array to REAL8TimeSeries.
source code
 
fromNDS(chname, start, duration, server="nds.ligo.caltech.edu", port=31200)
Read data from NDS into a REAL?TimeSeries
source code
 
fromframefile(framefile, chname, start=-1, duration=1, datatype=-1, verbose=False)
Read data from the GWF format framefile into a REAL?TimeSeries.
source code
 
fromlalcache(cache, chname, start=-1, duration=1, datatype=-1, verbose=False)
Read data from a cache object into a REAL?TimeSeries.
source code
 
fromFrStream(stream, chname, start=-1, duration=1, datatype=-1, verbose=False)
Read data from the lalframe.LALFrStream object stream into a REAL?TimeSeries.
source code
 
resample(series, rate, inplace=True)
Resample a REAL?TimeSeries to the new rate (Hertz).
source code
 
highpass(series, frequency, amplitude=0.9, filtorder=8, inplace=True)
Apply Butterworth high pass filter to REAL?TimeSeries.
source code
 
lowpass(series, frequency, amplitude=0.9, filtorder=8, inplace=True)
Apply Butterworth low pass filter to REAL?TimeSeries.
source code
 
bandpass(series, fmin, fmax, amplitude=0.9, filtorder=8, inplace=True)
Apply Butterworth band pass filter to REAL?TimeSeries.
source code
 
duplicate(series)
Duplicate a TimeSeries or FrequencySeries.
source code
 
compute_average_spectrum(series, seglen, stride, window=None, plan=None, average='medianmean', unit=lal.StrainUnit)
Calculate the average (power) spectrum of the given REAL?TimeSeries
source code
 
compute_average_spectrogram(series, step, seglen, stride, window=None, plan=None, average='medianmean', unit=lal.StrainUnit)
Compute the average (power) spectrogram of the given REAL?TimeSeries by stacking together average spectra for each timestep.
source code
 
typecode(t)
Return LAL type code for this type string.
source code
 
gluecache_to_FrCache(cache)
Convert a glue.lal.Cache object to a lalframe.FrCache object.
source code
Variables [hide private]
  _typestr = {lal.I2_TYPE_CODE: 'INT2', lal.I4_TYPE_CODE: 'INT4'...
Function Details [hide private]

fromarray(array, name="", epoch=lal.LIGOTimeGPS(), f0=0, deltaT=1, sampleUnits=lal.DimensionlessUnit, frequencyseries=False)

source code 

Convert numpy.array to REAL8TimeSeries. Use frequencyseries to return
REAL8FrequencySeries.

Arguments:

    array : numpy.array
        input data array

Keyword arguments:

    name : str
        name of data source
    epoch : lal.LIGOTimeGPS
        GPS start time for array
    deltaT : float
        sampling time for data (or frequency spacing for FrequencySeries)
    f0 : float
        lower frequency limit for data
    sampleUnits : lal.Unit
        amplitude unit for array

fromframefile(framefile, chname, start=-1, duration=1, datatype=-1, verbose=False)

source code 

Read data from the GWF format framefile into a REAL?TimeSeries.
Restrict data with the gpsstart and duration parameters.

Arguments:

    framefile : str
        path to input frame file
    chname : str
        name of channel to read

Keyword arguments:

    start : lal.LIGOTimeGPS
        GPS start time of requested data
    duration : float
        length of requested data series in seconds
    datatype : int
        LAL enum for requested datatype, -1 == read from frame metadata
    verbose : [ True | False ]
        verbose output

fromlalcache(cache, chname, start=-1, duration=1, datatype=-1, verbose=False)

source code 

Read data from a cache object into a REAL?TimeSeries.
Restrict data with the gpsstart and duration parameters.

Arguments:

    cache : [ filepath | file | glue.lal.Cache | lalframe.FrCache ]
        object to be read to lalframe.FrCache
    chname : str
        name of channel to read

Keyword arguments:

    start : lal.LIGOTimeGPS
        GPS start time of requested data
    duration : float
        length of requested data series in seconds
    datatype : int
        LAL enum for requested datatype, -1 == read from frame metadata
    verbose : [ True | False ]
        verbose output

fromFrStream(stream, chname, start=-1, duration=1, datatype=-1, verbose=False)

source code 

Read data from the lalframe.LALFrStream object stream into a REAL?TimeSeries.
Restrict data with the gpsstart and duration parameters.

Arguments:

    stream : lalframe.FrStream
        frame stream to read
    chname : str
        name of channel to read

Keyword arguments:

    start : lal.LIGOTimeGPS
        GPS start time of requested data
    duration : float
        length of requested data series in seconds
    datatype : int
        LAL enum for requested datatype, -1 == read from frame metadata
    verbose : [ True | False ]
        verbose output

resample(series, rate, inplace=True)

source code 

Resample a REAL?TimeSeries to the new rate (Hertz). By default resampling
is done in-place and a copy of the series is returned, but if requested
the original series is duplicated before resampling and so is unaffected.

Arguments:

    series : swiglal.REAL?TimeSeries
        input timeseries to resample
    rate : float
        sampling rate (Hertz) to resample to

Keyword arguments:

    inplace : [ True | False ]
        perform resampling inplace on input series, default: True.
        If False, input series is duplicated and so is left in the original
        state.

highpass(series, frequency, amplitude=0.9, filtorder=8, inplace=True)

source code 

Apply Butterworth high pass filter to REAL?TimeSeries.

Arguments:

    series : swiglal.REAL?TimeSeries
        input series to highpass
    frequency : float
        frequency below which to attenuate

Keyword arguments:

    amplitude : float
        desired amplitude response of filter
    filtorder : int
        desired order of filter
    inplace : [ True | False ]
        perform resampling inplace on input series, default: True.
        If False, input series is duplicated and so is left in the original
        state.

lowpass(series, frequency, amplitude=0.9, filtorder=8, inplace=True)

source code 

Apply Butterworth low pass filter to REAL?TimeSeries.

Arguments:

    series : swiglal.REAL?TimeSeries
        input series to lowpass
    frequency : float
        frequency above which to attenuate

Keyword arguments:

    amplitude : float
        desired amplitude response of filter
    filtorder : int
        desired order of filter
    inplace : [ True | False ]
        perform resampling inplace on input series, default: True.
        If False, input series is duplicated and so is left in the original
        state.

bandpass(series, fmin, fmax, amplitude=0.9, filtorder=8, inplace=True)

source code 

Apply Butterworth band pass filter to REAL?TimeSeries.

Arguments:

    series : swiglal.REAL?TimeSeries
        input series to lowpass
    fmin : float
        frequency below which to attenuate
    fmax : float
        frequency above which to attenuate

Keyword arguments:

    amplitude : float
      desired amplitude response of filter
    filtorder : int
       desired order of filter

duplicate(series)

source code 

Duplicate a TimeSeries or FrequencySeries.

Arguments:

    series : [ TimeSeries | FrequencySeries ]
        input series to duplicate

compute_average_spectrum(series, seglen, stride, window=None, plan=None, average='medianmean', unit=lal.StrainUnit)

source code 

Calculate the average (power) spectrum of the given REAL?TimeSeries

Arguments:

    seglen : int
        length of FFT (in samples)
    stride : int
        gap between FFTs (in samples)

Keyword arguments:

    window : lal.REAL8Window
        swiglal window
    plan : lal.REAL8FFTPlan
        plan for FFT
    spectrum : [ 'median' | 'medianmean' | 'welch' ]
        averaging method for spectrum, default: 'medianmean'
    unit : lal.Unit
        LAL unit for data

compute_average_spectrogram(series, step, seglen, stride, window=None, plan=None, average='medianmean', unit=lal.StrainUnit)

source code 

Compute the average (power) spectrogram of the given REAL?TimeSeries by
stacking together average spectra for each timestep.

Arguments:

    series : REAL8TimeSeries
        input data
    step : int
        length of single average spectrum (in samples)
    seglen : int
        length of FFT (in samples)
    stride : int
        gap between FFTs (in samples)

Keyword arguments:

    window : lal.REAL8Window
        swiglal window
    plan : lal.REAL8FFTPlan
        plan for FFT
    spectrum : [ 'median' | 'medianmean' | 'welch' ]
        averaging method for spectrum, default: 'medianmean'
    unit : lal.Unit
        LAL unit for data

gluecache_to_FrCache(cache)

source code 

Convert a glue.lal.Cache object to a lalframe.FrCache object.
Writes cache to temporary file and reads to FrCache.

Arguments:

    cache : glue.lal.Cache
        LAL cache object from GLUE to convert


Variables Details [hide private]

_typestr

Value:
{lal.I2_TYPE_CODE: 'INT2', lal.I4_TYPE_CODE: 'INT4', lal.I8_TYPE_CODE:\
 'INT8', lal.U2_TYPE_CODE: 'UINT2', lal.U4_TYPE_CODE: 'UINT4', lal.U8_\
TYPE_CODE: 'UINT8', lal.S_TYPE_CODE: 'REAL4', lal.D_TYPE_CODE: 'REAL8'\
, lal.C_TYPE_CODE: 'COMPLEX8', lal.Z_TYPE_CODE: 'COMPLEX16',}