Python API

salpa.fsalpa.params

salpa.fsalpa.params(fs_Hz=30000, probechans=384, extrachans=0, skip=0, lim=None, thr_rms=3.0, halfwidth=3.0, forcepeg=0.3, postblank=0.8, postblankinterruptible=False)

Pre-specify parameters for a SALPA run.

Parameters:
  • fs_Hz (integer) – Sampling rate of recording.

  • probechans (integer) – Number of electrode channels in recording.

  • extrachans (integer) – Number of auxiliary channels in recording.

  • skip (integer) – Number of scans to skip from beginning of file.

  • lim (integer or None) – Number of scans to process. (Zero or None means: unlimited.)

  • thr_rms (float) – Threshold for resuming normal operation after an artifact, specified in units of RMS noise for each channel.

  • halfwidth (float) – Half-width of the artifact fitter, in milliseconds.

  • forcepeg (float) – Enforced minimum duration of artifact, in milliseconds.

  • postblank (float) – Number of milliseconds of signal to be blanked after nominal end of artifact.

  • postblankinterruptible (bool) – If given, “blanking” specified by postblank is terminated early if the signal on a given channel crosses zero.

Returns:

The parameters, combined into a dict that can be passed to run().

Return type:

dict

salpa.fsalpa.run

salpa.fsalpa.run(ifn, ofn, pars, stim_ss=None)

Run SALPA on a file

Parameters:
  • ifn (str) – The file to use for input

  • ofn (str) – The file to use for output. (Warning: any preexisting file is overwritten.)

  • pars (dict) – Parameters for the SALPA process, constructed with params().

  • stim_ss (list or np.ndarray) – Optional: list of sample times at which an artifact is to be assumed. (E.g., times of electrical stimuli.) Times are measured in samples, not seconds.

Returns:

Nothing

Exception:

If the SALPA program fails to complete, an exception is raised.