ibllib.ephys.np2_converter

Classes

NP2Converter

Class used to 1.

class NP2Converter(ap_file, post_check=True, delete_original=False, compress=True)[source]

Bases: object

Class used to 1. Extract LFP data from NP2 data and 2. If NP2.4 split the data into individual shanks

init_params(nsamples=None, nwindow=None, extra=None, nshank=None)[source]

Initiliases parameters for processing.

Parameters
  • nsamples – the number of samples to process

  • nwindow – the number of samples in each window when iterating through nsamples

  • extra – extra string to add the individual shank folder names

  • nshank – number of shanks to process, must be a list [0], you would only want to

override this for testing purposes :return:

check_metadata()[source]

Checks the keys in meta data to see if we are trying to process an ap file that has already been split into shanks. If we are sets flag and prevents further processing occurring :return:

process(overwrite=False)[source]

Function to call to process NP2 data

Parameters

overwrite

Returns

check_NP24()[source]

Check that the splitting into shanks process has completed correctly. Compares the original file to the reconstructed file from the individual shanks

Returns

compress_NP24(overwrite=False, **kwargs)[source]

Compress spikeglx files :return:

compress_NP21(overwrite=False)[source]

Compress spikeglx files :return:

delete_NP24()[source]

Delete the original ap file that doesn’t has all shanks in one file

Returns

extract_lfp(chunk)[source]

Extracts LFP signal from full band signal, first applies low pass to anti-alias and LP, then downsamples

Parameters

chunk – portion of signal to extract LFP from

Returns

LFP signal

extract_lfp_sync(chunk_sync)[source]

Extracts downsampled signal of imec sync trace

Parameters

chunk_sync – portion of sync signal to downsample

Returns

downsampled sync signal