ibllib.dsp.voltage

Module to work with raw voltage traces. Spike sorting pre-processing functions.

Functions

agc

Automatic gain control :param x: seismic array (sample last dimension) :param wl: window length (secs) :param si: sampling interval (secs) :param epsilon: whitening (useful mainly for synthetic data) :return:

destripe

Super Car (super slow also…) - far from being set in stone but a good workflow example :param x: demultiplexed array (ntraces, nsample) :param fs: sampling frequency :param neuropixel_version (optional): 1 or 2. Useful for the ADC shift correction. If None, no correction is applied :param tr_sel: index array for the first axis of x indicating the selected traces. On a full workflow, one should scan sparingly the full file to get a robust estimate of the selection. If None, and estimation is done using only the current batch is provided for convenience but should be avoided in production. :param butter_kwargs: (optional, None) butterworth params, see the code for the defaults dict :param fk_kwargs: (optional, None) FK params, see the code for the defaults dict :return: x, filtered array.

fk

Frequency-wavenumber filter: filters apparent plane-waves velocity :param x: the input array to be filtered.

reject_channels

Computes the :param x: demultiplexed array (ntraces, nsample) :param fs: sampling frequency (Hz) :param trx: number of traces each side (1) :param butt kwargs (optional, None), butt_kwargs = {‘N’: 4, ‘Wn’: 0.05, ‘btype’: ‘lp’} :param threshold: r value below which a channel is rejected :return:

reject_channels(x, fs, butt_kwargs=None, threshold=0.6, trx=1)[source]

Computes the :param x: demultiplexed array (ntraces, nsample) :param fs: sampling frequency (Hz) :param trx: number of traces each side (1) :param butt kwargs (optional, None), butt_kwargs = {‘N’: 4, ‘Wn’: 0.05, ‘btype’: ‘lp’} :param threshold: r value below which a channel is rejected :return:

agc(x, wl=0.5, si=0.002, epsilon=1e-08)[source]

Automatic gain control :param x: seismic array (sample last dimension) :param wl: window length (secs) :param si: sampling interval (secs) :param epsilon: whitening (useful mainly for synthetic data) :return:

fk(x, si=0.002, dx=1, vbounds=None, btype='highpass', ntr_pad=0, ntr_tap=None, lagc=0.5, collection=None, kfilt=None)[source]

Frequency-wavenumber filter: filters apparent plane-waves velocity :param x: the input array to be filtered. dimension, the filtering is considering axis=0: spatial dimension, axis=1 temporal dimension. (ntraces, ns) :param si: sampling interval (secs) :param dx: spatial interval (usually meters) :param vbounds: velocity high pass [v1, v2], cosine taper from 0 to 1 between v1 and v2 :param btype: {‘lowpass’, ‘highpass’}, velocity filter : defaults to highpass :param ntr_pad: padding will add ntr_padd mirrored traces to each side :param ntr_tap: taper (if None, set to ntr_pad) :param lagc: length of agc in seconds. If set to None or 0, no agc :param kfilt: optional (None) if kfilter is applied, parameters as dict (bounds are in m-1 according to the dx parameter) kfilt = {‘bounds’: [0.05, 0.1], ‘btype’, ‘highpass’} :param collection: vector length ntraces. Each unique value set of traces is a collection on which the FK filter will run separately (shot gaters, receiver gathers) :return:

destripe(x, fs, tr_sel=None, neuropixel_version=1, butter_kwargs=None, fk_kwargs=None)[source]

Super Car (super slow also…) - far from being set in stone but a good workflow example :param x: demultiplexed array (ntraces, nsample) :param fs: sampling frequency :param neuropixel_version (optional): 1 or 2. Useful for the ADC shift correction. If None,

no correction is applied

Parameters
  • tr_sel – index array for the first axis of x indicating the selected traces. On a full workflow, one should scan sparingly the full file to get a robust estimate of the selection. If None, and estimation is done using only the current batch is provided for convenience but should be avoided in production.

  • butter_kwargs – (optional, None) butterworth params, see the code for the defaults dict

  • fk_kwargs – (optional, None) FK params, see the code for the defaults dict

Returns

x, filtered array