From eff1954b0df4efc3c21f5b4acf761d20633fdee1 Mon Sep 17 00:00:00 2001 From: Georg Raiser Date: Mon, 28 Oct 2024 17:19:14 +0000 Subject: [PATCH] channel reordering fix (#48) * channel reordering fix * flake8 fixes * bugfix: returning channel index when required on standard probe geometry * bugfixes * wip test cases sorting * fix tests for the re-ordering on read * prepare release 1.5.0 * add back the decompress to scratch * add DC offset removal in channel plots - CI 3.13 on hold * NP2 splitting does not use the spikeglx splitting --------- Co-authored-by: olivier --- .github/workflows/tests.yaml | 2 +- .gitignore | 3 + README.md | 1 + release_notes.md | 6 + setup.py | 4 +- src/ibldsp/plots.py | 1 + src/ibldsp/raw_metrics.py | 2 +- src/ibldsp/voltage.py | 4 +- src/neuropixel.py | 31 +- src/spikeglx.py | 104 ++++-- src/tests/{unit/cpu => }/__init__.py | 0 .../_spikeglx_ephysData_g0_t0.imec0.ap.meta | 50 +++ .../_spikeglx_ephysData_g0_t0.imec0.ap.meta | 50 +++ .../_spikeglx_ephysData_g0_t0.imec0.ap.meta | 51 +++ .../_spikeglx_ephysData_g0_t0.imec0.ap.ch | 25 ++ .../_spikeglx_ephysData_g0_t0.imec0.ap.meta | 51 +++ .../fixtures/sample3A_376_channels.ap.meta | 0 .../fixtures/sample3A_g0_t0.imec.ap.meta | 0 .../fixtures/sample3A_g0_t0.imec.lf.meta | 0 .../fixtures/sample3A_g0_t0.imec.wiring.json | 0 .../sample3A_short_g0_t0.imec.ap.meta | 0 .../fixtures/sample3B2_exported.imec0.ap.meta | 0 .../cpu => }/fixtures/sample3B_catgt.ap.meta | 0 .../fixtures/sample3B_g0_t0.imec1.ap.meta | 0 .../fixtures/sample3B_g0_t0.imec1.lf.meta | 0 .../fixtures/sample3B_g0_t0.nidq.meta | 0 .../fixtures/sample3B_g0_t0.nidq.wiring.json | 0 .../fixtures/sample3B_version202304.ap.meta | 0 .../fixtures/sampleNP2.1_g0_t0.imec.ap.meta | 0 .../fixtures/sampleNP2.1_prototype.ap.meta | 0 .../sampleNP2.4_1shank_g0_t0.imec.ap.meta | 0 ...leNP2.4_4shanks_appVersion20230905.ap.meta | 0 .../sampleNP2.4_4shanks_g0_t0.imec.ap.meta | 0 ...4shanks_while_acquiring_incomplete.ap.meta | 0 .../sampleNPultra_g0_t0.imec0.ap.meta | 0 .../fixtures/waveform_sample/test_arr_in.npy | Bin .../waveform_sample/test_arr_peak.npy | Bin .../fixtures/waveform_sample/test_df.csv | 0 .../waveform_sample/test_df_wavinfo.csv | 0 .../{unit/gpu => integration}/__init__.py | 0 .../integration/{cpu => }/csd_experiments.py | 2 +- .../integration/{cpu => }/test_destripe.py | 0 src/tests/unit/__init__.py | 0 src/tests/unit/gpu/test_filter_gpu.py | 23 -- src/tests/unit/gpu/test_fourier.py | 19 - src/tests/unit/test_ephys_np2.py | 351 ++++++++++++++++++ src/tests/unit/{cpu => }/test_ibldsp.py | 5 +- src/tests/unit/{cpu => }/test_neuropixel.py | 0 src/tests/unit/{cpu => }/test_spikeglx.py | 12 +- src/tests/unit/{cpu => }/test_waveforms.py | 8 +- 50 files changed, 683 insertions(+), 122 deletions(-) rename src/tests/{unit/cpu => }/__init__.py (100%) create mode 100755 src/tests/fixtures/np2split/NP1_meta/_spikeglx_ephysData_g0_t0.imec0.ap.meta create mode 100755 src/tests/fixtures/np2split/NP21_meta/_spikeglx_ephysData_g0_t0.imec0.ap.meta create mode 100755 src/tests/fixtures/np2split/NP24_meta/_spikeglx_ephysData_g0_t0.imec0.ap.meta create mode 100755 src/tests/fixtures/np2split/_spikeglx_ephysData_g0_t0.imec0.ap.ch create mode 100755 src/tests/fixtures/np2split/_spikeglx_ephysData_g0_t0.imec0.ap.meta rename src/tests/{unit/cpu => }/fixtures/sample3A_376_channels.ap.meta (100%) rename src/tests/{unit/cpu => }/fixtures/sample3A_g0_t0.imec.ap.meta (100%) rename src/tests/{unit/cpu => }/fixtures/sample3A_g0_t0.imec.lf.meta (100%) rename src/tests/{unit/cpu => }/fixtures/sample3A_g0_t0.imec.wiring.json (100%) rename src/tests/{unit/cpu => }/fixtures/sample3A_short_g0_t0.imec.ap.meta (100%) rename src/tests/{unit/cpu => }/fixtures/sample3B2_exported.imec0.ap.meta (100%) rename src/tests/{unit/cpu => }/fixtures/sample3B_catgt.ap.meta (100%) rename src/tests/{unit/cpu => }/fixtures/sample3B_g0_t0.imec1.ap.meta (100%) rename src/tests/{unit/cpu => }/fixtures/sample3B_g0_t0.imec1.lf.meta (100%) rename src/tests/{unit/cpu => }/fixtures/sample3B_g0_t0.nidq.meta (100%) rename src/tests/{unit/cpu => }/fixtures/sample3B_g0_t0.nidq.wiring.json (100%) rename src/tests/{unit/cpu => }/fixtures/sample3B_version202304.ap.meta (100%) rename src/tests/{unit/cpu => }/fixtures/sampleNP2.1_g0_t0.imec.ap.meta (100%) rename src/tests/{unit/cpu => }/fixtures/sampleNP2.1_prototype.ap.meta (100%) rename src/tests/{unit/cpu => }/fixtures/sampleNP2.4_1shank_g0_t0.imec.ap.meta (100%) rename src/tests/{unit/cpu => }/fixtures/sampleNP2.4_4shanks_appVersion20230905.ap.meta (100%) rename src/tests/{unit/cpu => }/fixtures/sampleNP2.4_4shanks_g0_t0.imec.ap.meta (100%) rename src/tests/{unit/cpu => }/fixtures/sampleNP2.4_4shanks_while_acquiring_incomplete.ap.meta (100%) rename src/tests/{unit/cpu => }/fixtures/sampleNPultra_g0_t0.imec0.ap.meta (100%) rename src/tests/{unit/cpu => }/fixtures/waveform_sample/test_arr_in.npy (100%) rename src/tests/{unit/cpu => }/fixtures/waveform_sample/test_arr_peak.npy (100%) rename src/tests/{unit/cpu => }/fixtures/waveform_sample/test_df.csv (100%) rename src/tests/{unit/cpu => }/fixtures/waveform_sample/test_df_wavinfo.csv (100%) rename src/tests/{unit/gpu => integration}/__init__.py (100%) rename src/tests/integration/{cpu => }/csd_experiments.py (98%) rename src/tests/integration/{cpu => }/test_destripe.py (100%) create mode 100644 src/tests/unit/__init__.py delete mode 100644 src/tests/unit/gpu/test_filter_gpu.py delete mode 100644 src/tests/unit/gpu/test_fourier.py create mode 100644 src/tests/unit/test_ephys_np2.py rename src/tests/unit/{cpu => }/test_ibldsp.py (99%) rename src/tests/unit/{cpu => }/test_neuropixel.py (100%) rename src/tests/unit/{cpu => }/test_spikeglx.py (98%) rename src/tests/unit/{cpu => }/test_waveforms.py (98%) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 12e3474..52b8792 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest"] - python-version: ["3.9", "3.10"] + python-version: ["3.10"] steps: - name: Checkout ibl-neuropixel repo uses: actions/checkout@v3 diff --git a/.gitignore b/.gitignore index b6e4761..d1839bb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# repo specific stuff +src/tests/fixtures/np2split/*.*bin* + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/README.md b/README.md index 21d369a..1c5dc42 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ Collection of tools to handle Neuropixel 1.0 and 2.0 data (documentation coming soon...) ## Installation +Minimum Python version supported is 3.10 `pip install ibl-neuropixel` diff --git a/release_notes.md b/release_notes.md index 1a802e4..66a4a8c 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,3 +1,9 @@ +# 1.5 + +## 1.5.0 2024-10-24 +- Automatic sorting per shank / row / col +- Minimum Python version is 3.10 + # 1.4 ## 1.4.0 2024-10-05 diff --git a/setup.py b/setup.py index 34daece..5344bfa 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name="ibl-neuropixel", - version="1.4.0", + version="1.5.0", author="The International Brain Laboratory", description="Collection of tools for Neuropixel 1.0 and 2.0 probes data", long_description=long_description, @@ -27,5 +27,5 @@ packages=setuptools.find_packages(where="src", exclude=["tests"]), include_package_data=True, py_modules=["spikeglx", "neuropixel"], - python_requires=">=3.8", + python_requires=">=3.10", ) diff --git a/src/ibldsp/plots.py b/src/ibldsp/plots.py index 4434b6a..e551105 100644 --- a/src/ibldsp/plots.py +++ b/src/ibldsp/plots.py @@ -9,6 +9,7 @@ def show_channels_labels(raw, fs, channel_labels, xfeats, similarity_threshold, :return: """ nc, ns = raw.shape + raw = raw - np.mean(raw, axis=-1)[:, np.newaxis] # removes DC offset ns_plot = np.minimum(ns, 3000) vaxis_uv = 250 if fs < 2600 else 75 fig, ax = plt.subplots(1, 5, figsize=(18, 6), gridspec_kw={'width_ratios': [1, 1, 1, 8, .2]}) diff --git a/src/ibldsp/raw_metrics.py b/src/ibldsp/raw_metrics.py index d382752..48ab6a1 100644 --- a/src/ibldsp/raw_metrics.py +++ b/src/ibldsp/raw_metrics.py @@ -112,7 +112,7 @@ def compute_raw_features_snippet(sr_ap, sr_lf, t0, t1, filter_ap=None, filter_lf dc_offset = np.mean(raw, axis=1) channel_labels, xfeats_raw = detect_bad_channels(raw, **detect_kwargs[band]) butter = scipy.signal.sosfiltfilt(filters[band], raw) - destriped = destripe_fn[band](raw, fs=sr.fs, channel_labels=channel_labels) + destriped = destripe_fn[band](raw, fs=sr.fs, h=sr.geometry, channel_labels=channel_labels) # compute same channel feats for destripe _, xfeats_destriped = detect_bad_channels(destriped, **detect_kwargs[band]) diff --git a/src/ibldsp/voltage.py b/src/ibldsp/voltage.py index 82b04d6..e68aad3 100644 --- a/src/ibldsp/voltage.py +++ b/src/ibldsp/voltage.py @@ -378,7 +378,7 @@ def destripe( return x -def destripe_lfp(x, fs, channel_labels=None, butter_kwargs=None, k_filter=False): +def destripe_lfp(x, fs, h=None, channel_labels=None, butter_kwargs=None, k_filter=False): """ Wrapper around the destripe function with some default parameters to destripe the LFP band See help destripe function for documentation @@ -389,7 +389,7 @@ def destripe_lfp(x, fs, channel_labels=None, butter_kwargs=None, k_filter=False) butter_kwargs = {"N": 3, "Wn": [0.5, 300], "btype": "bandpass", "fs": fs} if butter_kwargs is None else butter_kwargs if channel_labels is True: channel_labels, _ = detect_bad_channels(x, fs=fs, psd_hf_threshold=1.4) - return destripe(x, fs, butter_kwargs=butter_kwargs, k_filter=k_filter, channel_labels=channel_labels) + return destripe(x, fs, h=h, butter_kwargs=butter_kwargs, k_filter=k_filter, channel_labels=channel_labels) def decompress_destripe_cbin( diff --git a/src/neuropixel.py b/src/neuropixel.py index 6cb2b0a..a8cd2f7 100644 --- a/src/neuropixel.py +++ b/src/neuropixel.py @@ -259,7 +259,7 @@ def __init__(self, ap_file, post_check=True, delete_original=False, compress=Tru split into shanks (only applicable to NP2.4) """ self.ap_file = Path(ap_file) - self.sr = spikeglx.Reader(ap_file) + self.sr = spikeglx.Reader(ap_file, sort=False) self.post_check = post_check self.compress = compress self.delete_original = delete_original @@ -299,7 +299,7 @@ def init_params(self, nsamples=None, nwindow=None, extra=None, nshank=None): ] # Low pass filter (acts as both anti-aliasing and LP filter) - butter_lp_kwargs = {"N": 2, "Wn": 1000 / 2500 / 2, "btype": "lowpass"} + butter_lp_kwargs = {"N": 2, "Wn": 1000 / self.fs_lf / 2, "btype": "lowpass"} self.sos_lp = scipy.signal.butter(**butter_lp_kwargs, output="sos") # Number of ap channels @@ -408,7 +408,6 @@ def _prepare_files_NP24(self, overwrite=False): :param overwrite: set to True to force rerunning even if lf.bin file already exists :return: """ - chn_info = spikeglx._map_channels_from_meta(self.sr.meta) n_shanks = self.nshank or np.unique(chn_info["shank"]).astype(np.int16) label = self.ap_file.parent.parts[-1] @@ -552,21 +551,17 @@ def check_NP24(self): :return: """ for sh in self.shank_info.keys(): - self.shank_info[sh]["sr"] = spikeglx.Reader(self.shank_info[sh]["ap_file"]) - + self.shank_info[sh]["sr"] = spikeglx.Reader(self.shank_info[sh]["ap_file"], sort=False) wg = WindowGenerator(self.nsamples, self.samples_window, 0) for first, last in wg.firstlast: expected = self.sr[first:last, :] chunk = np.zeros_like(expected) for ish, sh in enumerate(self.shank_info.keys()): + srs = self.shank_info[sh]["sr"] if ish == 0: - chunk[:, self.shank_info[sh]["chns"]] = self.shank_info[sh]["sr"][ - first:last, : - ] + chunk[:, self.shank_info[sh]["chns"]] = srs[first:last, :] else: - chunk[:, self.shank_info[sh]["chns"][:-1]] = self.shank_info[sh][ - "sr" - ][first:last, :-1] + chunk[:, self.shank_info[sh]["chns"][:-1]] = srs[first:last, :-1] assert np.array_equal( expected, chunk ), "data in original file and split files do no match" @@ -898,9 +893,8 @@ def _prepare_files(self): for iF, fold in enumerate(folders): ap_file = next(fold.glob("*ap.*bin")) _shank_info = {} - _shank_info["ap_file"] = ap_file - sr = spikeglx.Reader(ap_file) + sr = spikeglx.Reader(ap_file, sort=False) sh = sr.meta.get(f"{self.np_version}_shank") _shank_info["sr"] = sr _shank_info["chns"] = self._get_chans(sr.meta) @@ -950,14 +944,9 @@ def _reconstruct(self): chunk = np.zeros((ns, self.nch), dtype=np.int16) for ish, sh in enumerate(self.shank_info.keys()): if ish == 0: - chunk[:, self.shank_info[sh]["chns"]] = self.shank_info[sh][ - "sr" - ]._raw[first:last, :] + chunk[:, self.shank_info[sh]["chns"]] = self.shank_info[sh]["sr"]._raw[first:last, :] else: - chunk[:, self.shank_info[sh]["chns"][:-1]] = self.shank_info[sh][ - "sr" - ]._raw[first:last, :-1] - + chunk[:, self.shank_info[sh]["chns"][:-1]] = self.shank_info[sh]["sr"]._raw[first:last, :-1] chunk.tofile(file_out) # close the sglx instances once we are done converting @@ -1005,7 +994,7 @@ def compress_file(self, **kwargs): :return: """ - sr = spikeglx.Reader(self.save_file) + sr = spikeglx.Reader(self.save_file, sort=False) cbin_file = sr.compress_file(**kwargs) sr.close() self.save_file.unlink() diff --git a/src/spikeglx.py b/src/spikeglx.py index b7cfa3c..5a17818 100644 --- a/src/spikeglx.py +++ b/src/spikeglx.py @@ -16,7 +16,7 @@ SAMPLE_SIZE = 2 # int16 DEFAULT_BATCH_SIZE = 1e6 -_logger = logging.getLogger(__name__) +_logger = logging.getLogger("ibllib") def _get_companion_file(sglx_file, pattern='.meta'): @@ -64,12 +64,16 @@ def __init__( ignore_warnings=False, meta_file=None, ch_file=None, + sort=True ): """ An interface for reading data from a SpikeGLX file :param sglx_file: Path to a SpikeGLX file (compressed or otherwise), or to a meta-data file :param open: when True the file is opened + :param sort: (True) by default always return channels sorted by shank, row and column. If set to false, + the data will be returned as written on disk, for NP2 versions this may result in interleaved shanks """ + self.geometry = None self.ignore_warnings = ignore_warnings sglx_file = Path(sglx_file) meta_file = meta_file or _get_companion_file(sglx_file, '.meta') @@ -125,6 +129,10 @@ def __init__( self.meta = read_meta_data(meta_file) self.channel_conversion_sample2v = _conversion_sample2v_from_meta(self.meta) self._raw = None + self.geometry, order = geometry_from_meta(self.meta, return_index=True, sort=sort) + self.raw_channel_order = np.arange(self.nc) + if self.geometry is not None: # nidq files won't return any geometry here + self.raw_channel_order[:order.size] = order if open and self.file_bin: self.open() @@ -190,14 +198,6 @@ def __getitem__(self, item): def sample2volts(self): return self.channel_conversion_sample2v[self.type] - @property - def geometry(self): - """ - Gets the geometry, ie. the full trace header for the recording - :return: dictionary with keys 'row', 'col', 'ind', 'shank', 'adc', 'x', 'y', 'sample_shift' - """ - return _geometry_from_meta(self.meta) - @property def shape(self): return self.ns, self.nc @@ -270,7 +270,7 @@ def range_volts(self): :return: [nc, ] array of float32 (V) """ if not self.meta: - return self.sample2volts * np.NaN + return self.sample2volts * np.nan maxint = _get_max_int_from_meta(self.meta) return self.sample2volts * maxint @@ -283,7 +283,9 @@ def read(self, nsel=slice(0, 10000), csel=slice(None), sync=True): """ if not self.is_open: raise IOError("Reader not open; call `open` before `read`") - darray = self._raw[nsel, csel].astype(np.float32, copy=True) + if hasattr(self, 'raw_channel_order'): + csel = self.raw_channel_order[csel] + darray = self._raw[nsel, :].astype(np.float32, copy=True)[..., csel] darray *= self.channel_conversion_sample2v[self.type][csel] if sync: return darray, self.read_sync(nsel) @@ -376,27 +378,6 @@ def compress_file(self, keep_original=True, **kwargs): self.file_bin = file_out return file_out - def decompress_to_scratch(self, scratch_dir=None): - """ - Decompresses the file to a temporary directory - Copy over the metadata file - """ - if scratch_dir is None: - bin_file = Path(self.file_bin).with_suffix('.bin') - else: - scratch_dir.mkdir(exist_ok=True, parents=True) - bin_file = Path(scratch_dir).joinpath(self.file_bin.name).with_suffix('.bin') - shutil.copy(self.file_meta_data, bin_file.with_suffix('.meta')) - if not bin_file.exists(): - t0 = time.time() - _logger.info('File is compressed, decompressing to a temporary file...') - self.decompress_file( - keep_original=True, out=bin_file.with_suffix('.bin_temp'), check_after_decompress=False, overwrite=True - ) - shutil.move(bin_file.with_suffix('.bin_temp'), bin_file) - _logger.info(f"Decompression complete: {time.time() - t0:.2f}s") - return bin_file - def decompress_file(self, keep_original=True, **kwargs): """ Decompresses a mtscomp file @@ -419,6 +400,27 @@ def decompress_file(self, keep_original=True, **kwargs): self.file_bin = kwargs["out"] return kwargs["out"] + def decompress_to_scratch(self, scratch_dir=None): + """ + Decompresses the file to a temporary directory + Copy over the metadata file + """ + if scratch_dir is None: + bin_file = Path(self.file_bin).with_suffix('.bin') + else: + scratch_dir.mkdir(exist_ok=True, parents=True) + bin_file = Path(scratch_dir).joinpath(self.file_bin.name).with_suffix('.bin') + shutil.copy(self.file_meta_data, bin_file.with_suffix('.meta')) + if not bin_file.exists(): + t0 = time.time() + _logger.info('File is compressed, decompressing to a temporary file...') + self.decompress_file( + keep_original=True, out=bin_file.with_suffix('.bin_temp'), check_after_decompress=False, overwrite=True + ) + shutil.move(bin_file.with_suffix('.bin_temp'), bin_file) + _logger.info(f"Decompression complete: {time.time() - t0:.2f}s") + return bin_file + def verify_hash(self): """ Computes SHA-1 hash and returns True if it matches metadata, False otherwise @@ -620,7 +622,7 @@ def _get_nchannels_from_meta(md): def _get_nshanks_from_meta(md): - th = _geometry_from_meta(md) + th = geometry_from_meta(md) return len(np.unique(th["shank"])) @@ -658,19 +660,30 @@ def _split_geometry_into_shanks(th, meta_data): return th -def _geometry_from_meta(meta_data): +def geometry_from_meta(meta_data, return_index=False, nc=384, sort=True): """ Gets the geometry, ie. the full trace header for the recording :param meta_data: meta_data dictionary as read by ibllib.io.spikeglx.read_meta_data + :param return_index: (False): flag to optionally return the sorted indices + :param sort: (True) sort the geometry by shank row col + :param nc: number of channels if geometry is not in the metadata file :return: dictionary with keys 'row', 'col', 'ind', 'shank', 'adc', 'x', 'y', 'sample_shift' """ cm = _map_channels_from_meta(meta_data) major_version = _get_neuropixel_major_version_from_meta(meta_data) - if cm is None: + if cm is None or all(map(lambda x: x is None, cm.values())): _logger.warning("Meta data doesn't have geometry (snsShankMap/snsGeomMap field), returning defaults") + if major_version is None: + if return_index: + return None, None + else: + return None th = neuropixel.trace_header(version=major_version) th["flag"] = th["x"] * 0 + 1.0 - return th + if return_index: + return th, np.arange(nc) + else: + return th th = cm.copy() # as of 2023-04 spikeglx stores only x, y coordinates of sites in UM and no col / row. Here # we convert to col / row for consistency with previous versions @@ -679,21 +692,30 @@ def _geometry_from_meta(meta_data): # there is a 20um offset between the probe tip and the first site in the coordinate conversion if major_version == 1: th["x"] = 70 - (th["x"]) - th["y"] += 20 th.update(neuropixel.xy2rc(th["x"], th["y"], version=major_version)) else: # the spike sorting channel maps have a flipped version of the channel map if major_version == 1: - th["col"] = -cm["col"] * 2 + 2 + np.mod(cm["row"], 2) + th["col"] = - cm["col"] * 2 + 2 + np.mod(cm["row"], 2) th.update(neuropixel.rc2xy(th["row"], th["col"], version=major_version)) th["sample_shift"], th["adc"] = neuropixel.adc_shifts( version=major_version, nc=th["col"].size ) th = _split_geometry_into_shanks(th, meta_data) th["ind"] = np.arange(th["col"].size) - - return th + if sort: + # here we sort the channels by shank, row and -col, this preserves the original NP1 + # order while still allowing to deal with creative imro tables in NP2 + sort_keys = np.c_[-th['col'], th['row'], th['shank']] + inds = np.lexsort(sort_keys.T) + th = {k: v[inds] for k, v in th.items()} + else: + inds = np.arange(th['col'].size) + if return_index: + return th, inds + else: + return th def read_geometry(meta_file): @@ -702,7 +724,7 @@ def read_geometry(meta_file): :param meta_file: :return: dictionary with keys 'shank', 'col', 'row', 'flag', 'x', 'y', 'sample_shift', 'adc', 'ind' """ - return _geometry_from_meta(read_meta_data(meta_file)) + return geometry_from_meta(read_meta_data(meta_file)) def _map_channels_from_meta(meta_data): diff --git a/src/tests/unit/cpu/__init__.py b/src/tests/__init__.py similarity index 100% rename from src/tests/unit/cpu/__init__.py rename to src/tests/__init__.py diff --git a/src/tests/fixtures/np2split/NP1_meta/_spikeglx_ephysData_g0_t0.imec0.ap.meta b/src/tests/fixtures/np2split/NP1_meta/_spikeglx_ephysData_g0_t0.imec0.ap.meta new file mode 100755 index 0000000..64c81cc --- /dev/null +++ b/src/tests/fixtures/np2split/NP1_meta/_spikeglx_ephysData_g0_t0.imec0.ap.meta @@ -0,0 +1,50 @@ +acqApLfSy=384,384,1 +appVersion=20200520 +fileCreateTime=2021-07-28T20:00:30 +fileName=D:/iblrig_data/Subjects/NR_0013/2021-07-28/001/raw_ephys_data/_spikeglx_ephysData_g0/_spikeglx_ephysData_g0_imec0/_spikeglx_ephysData_g0_t0.imec0.ap.bin +fileSHA1=A386257F0D1E4E938BD0F5CFBC967008FF0F6D8E +fileSizeBytes=23100000 +fileTimeSecs=1 +firstSample=110884048 +gateMode=Immediate +imAiRangeMax=0.6 +imAiRangeMin=-0.6 +imCalibrated=true +imDatApi=1.20 +imDatBs_fw=1.1.128 +imDatBsc_fw=1.0.151 +imDatBsc_hw=1.9 +imDatBsc_pn=NP2_QBSC_00 +imDatBsc_sn=113 +imDatFx_hw=1.2 +imDatFx_pn=NP2_FLEX_0 +imDatHs_fw=5.1 +imDatHs_pn=NP2_HS_30 +imDatHs_sn=1295 +imDatPrb_pn=PRB_1_4_0480_1 +imDatPrb_port=1 +imDatPrb_slot=3 +imDatPrb_sn=18005108181 +imDatPrb_type=0 +imLEDEnable=false +imMaxInt=512 +imRoFile=D:/iblrig_data/Subjects/NR_0003/2020-11-22/001/default.imro +imSampRate=29999.757983 +imStdby= +imTrgRising=true +imTrgSource=0 +nDataDirs=1 +nSavedChans=385 +snsApLfSy=384,0,1 +snsSaveChanSubset=0:383,768 +syncImInputSlot=3 +syncSourceIdx=3 +syncSourcePeriod=1 +trigMode=Immediate +typeImEnabled=1 +typeNiEnabled=1 +typeThis=imec +userNotes= +~imroTbl=(0,384)(0 0 0 500 250 1)(1 0 0 500 250 1)(2 0 0 500 250 1)(3 0 0 500 250 1)(4 0 0 500 250 1)(5 0 0 500 250 1)(6 0 0 500 250 1)(7 0 0 500 250 1)(8 0 0 500 250 1)(9 0 0 500 250 1)(10 0 0 500 250 1)(11 0 0 500 250 1)(12 0 0 500 250 1)(13 0 0 500 250 1)(14 0 0 500 250 1)(15 0 0 500 250 1)(16 0 0 500 250 1)(17 0 0 500 250 1)(18 0 0 500 250 1)(19 0 0 500 250 1)(20 0 0 500 250 1)(21 0 0 500 250 1)(22 0 0 500 250 1)(23 0 0 500 250 1)(24 0 0 500 250 1)(25 0 0 500 250 1)(26 0 0 500 250 1)(27 0 0 500 250 1)(28 0 0 500 250 1)(29 0 0 500 250 1)(30 0 0 500 250 1)(31 0 0 500 250 1)(32 0 0 500 250 1)(33 0 0 500 250 1)(34 0 0 500 250 1)(35 0 0 500 250 1)(36 0 0 500 250 1)(37 0 0 500 250 1)(38 0 0 500 250 1)(39 0 0 500 250 1)(40 0 0 500 250 1)(41 0 0 500 250 1)(42 0 0 500 250 1)(43 0 0 500 250 1)(44 0 0 500 250 1)(45 0 0 500 250 1)(46 0 0 500 250 1)(47 0 0 500 250 1)(48 0 0 500 250 1)(49 0 0 500 250 1)(50 0 0 500 250 1)(51 0 0 500 250 1)(52 0 0 500 250 1)(53 0 0 500 250 1)(54 0 0 500 250 1)(55 0 0 500 250 1)(56 0 0 500 250 1)(57 0 0 500 250 1)(58 0 0 500 250 1)(59 0 0 500 250 1)(60 0 0 500 250 1)(61 0 0 500 250 1)(62 0 0 500 250 1)(63 0 0 500 250 1)(64 0 0 500 250 1)(65 0 0 500 250 1)(66 0 0 500 250 1)(67 0 0 500 250 1)(68 0 0 500 250 1)(69 0 0 500 250 1)(70 0 0 500 250 1)(71 0 0 500 250 1)(72 0 0 500 250 1)(73 0 0 500 250 1)(74 0 0 500 250 1)(75 0 0 500 250 1)(76 0 0 500 250 1)(77 0 0 500 250 1)(78 0 0 500 250 1)(79 0 0 500 250 1)(80 0 0 500 250 1)(81 0 0 500 250 1)(82 0 0 500 250 1)(83 0 0 500 250 1)(84 0 0 500 250 1)(85 0 0 500 250 1)(86 0 0 500 250 1)(87 0 0 500 250 1)(88 0 0 500 250 1)(89 0 0 500 250 1)(90 0 0 500 250 1)(91 0 0 500 250 1)(92 0 0 500 250 1)(93 0 0 500 250 1)(94 0 0 500 250 1)(95 0 0 500 250 1)(96 0 0 500 250 1)(97 0 0 500 250 1)(98 0 0 500 250 1)(99 0 0 500 250 1)(100 0 0 500 250 1)(101 0 0 500 250 1)(102 0 0 500 250 1)(103 0 0 500 250 1)(104 0 0 500 250 1)(105 0 0 500 250 1)(106 0 0 500 250 1)(107 0 0 500 250 1)(108 0 0 500 250 1)(109 0 0 500 250 1)(110 0 0 500 250 1)(111 0 0 500 250 1)(112 0 0 500 250 1)(113 0 0 500 250 1)(114 0 0 500 250 1)(115 0 0 500 250 1)(116 0 0 500 250 1)(117 0 0 500 250 1)(118 0 0 500 250 1)(119 0 0 500 250 1)(120 0 0 500 250 1)(121 0 0 500 250 1)(122 0 0 500 250 1)(123 0 0 500 250 1)(124 0 0 500 250 1)(125 0 0 500 250 1)(126 0 0 500 250 1)(127 0 0 500 250 1)(128 0 0 500 250 1)(129 0 0 500 250 1)(130 0 0 500 250 1)(131 0 0 500 250 1)(132 0 0 500 250 1)(133 0 0 500 250 1)(134 0 0 500 250 1)(135 0 0 500 250 1)(136 0 0 500 250 1)(137 0 0 500 250 1)(138 0 0 500 250 1)(139 0 0 500 250 1)(140 0 0 500 250 1)(141 0 0 500 250 1)(142 0 0 500 250 1)(143 0 0 500 250 1)(144 0 0 500 250 1)(145 0 0 500 250 1)(146 0 0 500 250 1)(147 0 0 500 250 1)(148 0 0 500 250 1)(149 0 0 500 250 1)(150 0 0 500 250 1)(151 0 0 500 250 1)(152 0 0 500 250 1)(153 0 0 500 250 1)(154 0 0 500 250 1)(155 0 0 500 250 1)(156 0 0 500 250 1)(157 0 0 500 250 1)(158 0 0 500 250 1)(159 0 0 500 250 1)(160 0 0 500 250 1)(161 0 0 500 250 1)(162 0 0 500 250 1)(163 0 0 500 250 1)(164 0 0 500 250 1)(165 0 0 500 250 1)(166 0 0 500 250 1)(167 0 0 500 250 1)(168 0 0 500 250 1)(169 0 0 500 250 1)(170 0 0 500 250 1)(171 0 0 500 250 1)(172 0 0 500 250 1)(173 0 0 500 250 1)(174 0 0 500 250 1)(175 0 0 500 250 1)(176 0 0 500 250 1)(177 0 0 500 250 1)(178 0 0 500 250 1)(179 0 0 500 250 1)(180 0 0 500 250 1)(181 0 0 500 250 1)(182 0 0 500 250 1)(183 0 0 500 250 1)(184 0 0 500 250 1)(185 0 0 500 250 1)(186 0 0 500 250 1)(187 0 0 500 250 1)(188 0 0 500 250 1)(189 0 0 500 250 1)(190 0 0 500 250 1)(191 0 0 500 250 1)(192 0 0 500 250 1)(193 0 0 500 250 1)(194 0 0 500 250 1)(195 0 0 500 250 1)(196 0 0 500 250 1)(197 0 0 500 250 1)(198 0 0 500 250 1)(199 0 0 500 250 1)(200 0 0 500 250 1)(201 0 0 500 250 1)(202 0 0 500 250 1)(203 0 0 500 250 1)(204 0 0 500 250 1)(205 0 0 500 250 1)(206 0 0 500 250 1)(207 0 0 500 250 1)(208 0 0 500 250 1)(209 0 0 500 250 1)(210 0 0 500 250 1)(211 0 0 500 250 1)(212 0 0 500 250 1)(213 0 0 500 250 1)(214 0 0 500 250 1)(215 0 0 500 250 1)(216 0 0 500 250 1)(217 0 0 500 250 1)(218 0 0 500 250 1)(219 0 0 500 250 1)(220 0 0 500 250 1)(221 0 0 500 250 1)(222 0 0 500 250 1)(223 0 0 500 250 1)(224 0 0 500 250 1)(225 0 0 500 250 1)(226 0 0 500 250 1)(227 0 0 500 250 1)(228 0 0 500 250 1)(229 0 0 500 250 1)(230 0 0 500 250 1)(231 0 0 500 250 1)(232 0 0 500 250 1)(233 0 0 500 250 1)(234 0 0 500 250 1)(235 0 0 500 250 1)(236 0 0 500 250 1)(237 0 0 500 250 1)(238 0 0 500 250 1)(239 0 0 500 250 1)(240 0 0 500 250 1)(241 0 0 500 250 1)(242 0 0 500 250 1)(243 0 0 500 250 1)(244 0 0 500 250 1)(245 0 0 500 250 1)(246 0 0 500 250 1)(247 0 0 500 250 1)(248 0 0 500 250 1)(249 0 0 500 250 1)(250 0 0 500 250 1)(251 0 0 500 250 1)(252 0 0 500 250 1)(253 0 0 500 250 1)(254 0 0 500 250 1)(255 0 0 500 250 1)(256 0 0 500 250 1)(257 0 0 500 250 1)(258 0 0 500 250 1)(259 0 0 500 250 1)(260 0 0 500 250 1)(261 0 0 500 250 1)(262 0 0 500 250 1)(263 0 0 500 250 1)(264 0 0 500 250 1)(265 0 0 500 250 1)(266 0 0 500 250 1)(267 0 0 500 250 1)(268 0 0 500 250 1)(269 0 0 500 250 1)(270 0 0 500 250 1)(271 0 0 500 250 1)(272 0 0 500 250 1)(273 0 0 500 250 1)(274 0 0 500 250 1)(275 0 0 500 250 1)(276 0 0 500 250 1)(277 0 0 500 250 1)(278 0 0 500 250 1)(279 0 0 500 250 1)(280 0 0 500 250 1)(281 0 0 500 250 1)(282 0 0 500 250 1)(283 0 0 500 250 1)(284 0 0 500 250 1)(285 0 0 500 250 1)(286 0 0 500 250 1)(287 0 0 500 250 1)(288 0 0 500 250 1)(289 0 0 500 250 1)(290 0 0 500 250 1)(291 0 0 500 250 1)(292 0 0 500 250 1)(293 0 0 500 250 1)(294 0 0 500 250 1)(295 0 0 500 250 1)(296 0 0 500 250 1)(297 0 0 500 250 1)(298 0 0 500 250 1)(299 0 0 500 250 1)(300 0 0 500 250 1)(301 0 0 500 250 1)(302 0 0 500 250 1)(303 0 0 500 250 1)(304 0 0 500 250 1)(305 0 0 500 250 1)(306 0 0 500 250 1)(307 0 0 500 250 1)(308 0 0 500 250 1)(309 0 0 500 250 1)(310 0 0 500 250 1)(311 0 0 500 250 1)(312 0 0 500 250 1)(313 0 0 500 250 1)(314 0 0 500 250 1)(315 0 0 500 250 1)(316 0 0 500 250 1)(317 0 0 500 250 1)(318 0 0 500 250 1)(319 0 0 500 250 1)(320 0 0 500 250 1)(321 0 0 500 250 1)(322 0 0 500 250 1)(323 0 0 500 250 1)(324 0 0 500 250 1)(325 0 0 500 250 1)(326 0 0 500 250 1)(327 0 0 500 250 1)(328 0 0 500 250 1)(329 0 0 500 250 1)(330 0 0 500 250 1)(331 0 0 500 250 1)(332 0 0 500 250 1)(333 0 0 500 250 1)(334 0 0 500 250 1)(335 0 0 500 250 1)(336 0 0 500 250 1)(337 0 0 500 250 1)(338 0 0 500 250 1)(339 0 0 500 250 1)(340 0 0 500 250 1)(341 0 0 500 250 1)(342 0 0 500 250 1)(343 0 0 500 250 1)(344 0 0 500 250 1)(345 0 0 500 250 1)(346 0 0 500 250 1)(347 0 0 500 250 1)(348 0 0 500 250 1)(349 0 0 500 250 1)(350 0 0 500 250 1)(351 0 0 500 250 1)(352 0 0 500 250 1)(353 0 0 500 250 1)(354 0 0 500 250 1)(355 0 0 500 250 1)(356 0 0 500 250 1)(357 0 0 500 250 1)(358 0 0 500 250 1)(359 0 0 500 250 1)(360 0 0 500 250 1)(361 0 0 500 250 1)(362 0 0 500 250 1)(363 0 0 500 250 1)(364 0 0 500 250 1)(365 0 0 500 250 1)(366 0 0 500 250 1)(367 0 0 500 250 1)(368 0 0 500 250 1)(369 0 0 500 250 1)(370 0 0 500 250 1)(371 0 0 500 250 1)(372 0 0 500 250 1)(373 0 0 500 250 1)(374 0 0 500 250 1)(375 0 0 500 250 1)(376 0 0 500 250 1)(377 0 0 500 250 1)(378 0 0 500 250 1)(379 0 0 500 250 1)(380 0 0 500 250 1)(381 0 0 500 250 1)(382 0 0 500 250 1)(383 0 0 500 250 1) +~snsChanMap=(384,384,1)(AP0;0:0)(AP1;1:1)(AP2;2:2)(AP3;3:3)(AP4;4:4)(AP5;5:5)(AP6;6:6)(AP7;7:7)(AP8;8:8)(AP9;9:9)(AP10;10:10)(AP11;11:11)(AP12;12:12)(AP13;13:13)(AP14;14:14)(AP15;15:15)(AP16;16:16)(AP17;17:17)(AP18;18:18)(AP19;19:19)(AP20;20:20)(AP21;21:21)(AP22;22:22)(AP23;23:23)(AP24;24:24)(AP25;25:25)(AP26;26:26)(AP27;27:27)(AP28;28:28)(AP29;29:29)(AP30;30:30)(AP31;31:31)(AP32;32:32)(AP33;33:33)(AP34;34:34)(AP35;35:35)(AP36;36:36)(AP37;37:37)(AP38;38:38)(AP39;39:39)(AP40;40:40)(AP41;41:41)(AP42;42:42)(AP43;43:43)(AP44;44:44)(AP45;45:45)(AP46;46:46)(AP47;47:47)(AP48;48:48)(AP49;49:49)(AP50;50:50)(AP51;51:51)(AP52;52:52)(AP53;53:53)(AP54;54:54)(AP55;55:55)(AP56;56:56)(AP57;57:57)(AP58;58:58)(AP59;59:59)(AP60;60:60)(AP61;61:61)(AP62;62:62)(AP63;63:63)(AP64;64:64)(AP65;65:65)(AP66;66:66)(AP67;67:67)(AP68;68:68)(AP69;69:69)(AP70;70:70)(AP71;71:71)(AP72;72:72)(AP73;73:73)(AP74;74:74)(AP75;75:75)(AP76;76:76)(AP77;77:77)(AP78;78:78)(AP79;79:79)(AP80;80:80)(AP81;81:81)(AP82;82:82)(AP83;83:83)(AP84;84:84)(AP85;85:85)(AP86;86:86)(AP87;87:87)(AP88;88:88)(AP89;89:89)(AP90;90:90)(AP91;91:91)(AP92;92:92)(AP93;93:93)(AP94;94:94)(AP95;95:95)(AP96;96:96)(AP97;97:97)(AP98;98:98)(AP99;99:99)(AP100;100:100)(AP101;101:101)(AP102;102:102)(AP103;103:103)(AP104;104:104)(AP105;105:105)(AP106;106:106)(AP107;107:107)(AP108;108:108)(AP109;109:109)(AP110;110:110)(AP111;111:111)(AP112;112:112)(AP113;113:113)(AP114;114:114)(AP115;115:115)(AP116;116:116)(AP117;117:117)(AP118;118:118)(AP119;119:119)(AP120;120:120)(AP121;121:121)(AP122;122:122)(AP123;123:123)(AP124;124:124)(AP125;125:125)(AP126;126:126)(AP127;127:127)(AP128;128:128)(AP129;129:129)(AP130;130:130)(AP131;131:131)(AP132;132:132)(AP133;133:133)(AP134;134:134)(AP135;135:135)(AP136;136:136)(AP137;137:137)(AP138;138:138)(AP139;139:139)(AP140;140:140)(AP141;141:141)(AP142;142:142)(AP143;143:143)(AP144;144:144)(AP145;145:145)(AP146;146:146)(AP147;147:147)(AP148;148:148)(AP149;149:149)(AP150;150:150)(AP151;151:151)(AP152;152:152)(AP153;153:153)(AP154;154:154)(AP155;155:155)(AP156;156:156)(AP157;157:157)(AP158;158:158)(AP159;159:159)(AP160;160:160)(AP161;161:161)(AP162;162:162)(AP163;163:163)(AP164;164:164)(AP165;165:165)(AP166;166:166)(AP167;167:167)(AP168;168:168)(AP169;169:169)(AP170;170:170)(AP171;171:171)(AP172;172:172)(AP173;173:173)(AP174;174:174)(AP175;175:175)(AP176;176:176)(AP177;177:177)(AP178;178:178)(AP179;179:179)(AP180;180:180)(AP181;181:181)(AP182;182:182)(AP183;183:183)(AP184;184:184)(AP185;185:185)(AP186;186:186)(AP187;187:187)(AP188;188:188)(AP189;189:189)(AP190;190:190)(AP191;191:191)(AP192;192:192)(AP193;193:193)(AP194;194:194)(AP195;195:195)(AP196;196:196)(AP197;197:197)(AP198;198:198)(AP199;199:199)(AP200;200:200)(AP201;201:201)(AP202;202:202)(AP203;203:203)(AP204;204:204)(AP205;205:205)(AP206;206:206)(AP207;207:207)(AP208;208:208)(AP209;209:209)(AP210;210:210)(AP211;211:211)(AP212;212:212)(AP213;213:213)(AP214;214:214)(AP215;215:215)(AP216;216:216)(AP217;217:217)(AP218;218:218)(AP219;219:219)(AP220;220:220)(AP221;221:221)(AP222;222:222)(AP223;223:223)(AP224;224:224)(AP225;225:225)(AP226;226:226)(AP227;227:227)(AP228;228:228)(AP229;229:229)(AP230;230:230)(AP231;231:231)(AP232;232:232)(AP233;233:233)(AP234;234:234)(AP235;235:235)(AP236;236:236)(AP237;237:237)(AP238;238:238)(AP239;239:239)(AP240;240:240)(AP241;241:241)(AP242;242:242)(AP243;243:243)(AP244;244:244)(AP245;245:245)(AP246;246:246)(AP247;247:247)(AP248;248:248)(AP249;249:249)(AP250;250:250)(AP251;251:251)(AP252;252:252)(AP253;253:253)(AP254;254:254)(AP255;255:255)(AP256;256:256)(AP257;257:257)(AP258;258:258)(AP259;259:259)(AP260;260:260)(AP261;261:261)(AP262;262:262)(AP263;263:263)(AP264;264:264)(AP265;265:265)(AP266;266:266)(AP267;267:267)(AP268;268:268)(AP269;269:269)(AP270;270:270)(AP271;271:271)(AP272;272:272)(AP273;273:273)(AP274;274:274)(AP275;275:275)(AP276;276:276)(AP277;277:277)(AP278;278:278)(AP279;279:279)(AP280;280:280)(AP281;281:281)(AP282;282:282)(AP283;283:283)(AP284;284:284)(AP285;285:285)(AP286;286:286)(AP287;287:287)(AP288;288:288)(AP289;289:289)(AP290;290:290)(AP291;291:291)(AP292;292:292)(AP293;293:293)(AP294;294:294)(AP295;295:295)(AP296;296:296)(AP297;297:297)(AP298;298:298)(AP299;299:299)(AP300;300:300)(AP301;301:301)(AP302;302:302)(AP303;303:303)(AP304;304:304)(AP305;305:305)(AP306;306:306)(AP307;307:307)(AP308;308:308)(AP309;309:309)(AP310;310:310)(AP311;311:311)(AP312;312:312)(AP313;313:313)(AP314;314:314)(AP315;315:315)(AP316;316:316)(AP317;317:317)(AP318;318:318)(AP319;319:319)(AP320;320:320)(AP321;321:321)(AP322;322:322)(AP323;323:323)(AP324;324:324)(AP325;325:325)(AP326;326:326)(AP327;327:327)(AP328;328:328)(AP329;329:329)(AP330;330:330)(AP331;331:331)(AP332;332:332)(AP333;333:333)(AP334;334:334)(AP335;335:335)(AP336;336:336)(AP337;337:337)(AP338;338:338)(AP339;339:339)(AP340;340:340)(AP341;341:341)(AP342;342:342)(AP343;343:343)(AP344;344:344)(AP345;345:345)(AP346;346:346)(AP347;347:347)(AP348;348:348)(AP349;349:349)(AP350;350:350)(AP351;351:351)(AP352;352:352)(AP353;353:353)(AP354;354:354)(AP355;355:355)(AP356;356:356)(AP357;357:357)(AP358;358:358)(AP359;359:359)(AP360;360:360)(AP361;361:361)(AP362;362:362)(AP363;363:363)(AP364;364:364)(AP365;365:365)(AP366;366:366)(AP367;367:367)(AP368;368:368)(AP369;369:369)(AP370;370:370)(AP371;371:371)(AP372;372:372)(AP373;373:373)(AP374;374:374)(AP375;375:375)(AP376;376:376)(AP377;377:377)(AP378;378:378)(AP379;379:379)(AP380;380:380)(AP381;381:381)(AP382;382:382)(AP383;383:383)(SY0;768:768) +~snsShankMap=(1,2,480)(0:0:0:1)(0:1:0:1)(0:0:1:1)(0:1:1:1)(0:0:2:1)(0:1:2:1)(0:0:3:1)(0:1:3:1)(0:0:4:1)(0:1:4:1)(0:0:5:1)(0:1:5:1)(0:0:6:1)(0:1:6:1)(0:0:7:1)(0:1:7:1)(0:0:8:1)(0:1:8:1)(0:0:9:1)(0:1:9:1)(0:0:10:1)(0:1:10:1)(0:0:11:1)(0:1:11:1)(0:0:12:1)(0:1:12:1)(0:0:13:1)(0:1:13:1)(0:0:14:1)(0:1:14:1)(0:0:15:1)(0:1:15:1)(0:0:16:1)(0:1:16:1)(0:0:17:1)(0:1:17:1)(0:0:18:1)(0:1:18:1)(0:0:19:1)(0:1:19:1)(0:0:20:1)(0:1:20:1)(0:0:21:1)(0:1:21:1)(0:0:22:1)(0:1:22:1)(0:0:23:1)(0:1:23:1)(0:0:24:1)(0:1:24:1)(0:0:25:1)(0:1:25:1)(0:0:26:1)(0:1:26:1)(0:0:27:1)(0:1:27:1)(0:0:28:1)(0:1:28:1)(0:0:29:1)(0:1:29:1)(0:0:30:1)(0:1:30:1)(0:0:31:1)(0:1:31:1)(0:0:32:1)(0:1:32:1)(0:0:33:1)(0:1:33:1)(0:0:34:1)(0:1:34:1)(0:0:35:1)(0:1:35:1)(0:0:36:1)(0:1:36:1)(0:0:37:1)(0:1:37:1)(0:0:38:1)(0:1:38:1)(0:0:39:1)(0:1:39:1)(0:0:40:1)(0:1:40:1)(0:0:41:1)(0:1:41:1)(0:0:42:1)(0:1:42:1)(0:0:43:1)(0:1:43:1)(0:0:44:1)(0:1:44:1)(0:0:45:1)(0:1:45:1)(0:0:46:1)(0:1:46:1)(0:0:47:1)(0:1:47:1)(0:0:48:1)(0:1:48:1)(0:0:49:1)(0:1:49:1)(0:0:50:1)(0:1:50:1)(0:0:51:1)(0:1:51:1)(0:0:52:1)(0:1:52:1)(0:0:53:1)(0:1:53:1)(0:0:54:1)(0:1:54:1)(0:0:55:1)(0:1:55:1)(0:0:56:1)(0:1:56:1)(0:0:57:1)(0:1:57:1)(0:0:58:1)(0:1:58:1)(0:0:59:1)(0:1:59:1)(0:0:60:1)(0:1:60:1)(0:0:61:1)(0:1:61:1)(0:0:62:1)(0:1:62:1)(0:0:63:1)(0:1:63:1)(0:0:64:1)(0:1:64:1)(0:0:65:1)(0:1:65:1)(0:0:66:1)(0:1:66:1)(0:0:67:1)(0:1:67:1)(0:0:68:1)(0:1:68:1)(0:0:69:1)(0:1:69:1)(0:0:70:1)(0:1:70:1)(0:0:71:1)(0:1:71:1)(0:0:72:1)(0:1:72:1)(0:0:73:1)(0:1:73:1)(0:0:74:1)(0:1:74:1)(0:0:75:1)(0:1:75:1)(0:0:76:1)(0:1:76:1)(0:0:77:1)(0:1:77:1)(0:0:78:1)(0:1:78:1)(0:0:79:1)(0:1:79:1)(0:0:80:1)(0:1:80:1)(0:0:81:1)(0:1:81:1)(0:0:82:1)(0:1:82:1)(0:0:83:1)(0:1:83:1)(0:0:84:1)(0:1:84:1)(0:0:85:1)(0:1:85:1)(0:0:86:1)(0:1:86:1)(0:0:87:1)(0:1:87:1)(0:0:88:1)(0:1:88:1)(0:0:89:1)(0:1:89:1)(0:0:90:1)(0:1:90:1)(0:0:91:1)(0:1:91:1)(0:0:92:1)(0:1:92:1)(0:0:93:1)(0:1:93:1)(0:0:94:1)(0:1:94:1)(0:0:95:1)(0:1:95:0)(0:0:96:1)(0:1:96:1)(0:0:97:1)(0:1:97:1)(0:0:98:1)(0:1:98:1)(0:0:99:1)(0:1:99:1)(0:0:100:1)(0:1:100:1)(0:0:101:1)(0:1:101:1)(0:0:102:1)(0:1:102:1)(0:0:103:1)(0:1:103:1)(0:0:104:1)(0:1:104:1)(0:0:105:1)(0:1:105:1)(0:0:106:1)(0:1:106:1)(0:0:107:1)(0:1:107:1)(0:0:108:1)(0:1:108:1)(0:0:109:1)(0:1:109:1)(0:0:110:1)(0:1:110:1)(0:0:111:1)(0:1:111:1)(0:0:112:1)(0:1:112:1)(0:0:113:1)(0:1:113:1)(0:0:114:1)(0:1:114:1)(0:0:115:1)(0:1:115:1)(0:0:116:1)(0:1:116:1)(0:0:117:1)(0:1:117:1)(0:0:118:1)(0:1:118:1)(0:0:119:1)(0:1:119:1)(0:0:120:1)(0:1:120:1)(0:0:121:1)(0:1:121:1)(0:0:122:1)(0:1:122:1)(0:0:123:1)(0:1:123:1)(0:0:124:1)(0:1:124:1)(0:0:125:1)(0:1:125:1)(0:0:126:1)(0:1:126:1)(0:0:127:1)(0:1:127:1)(0:0:128:1)(0:1:128:1)(0:0:129:1)(0:1:129:1)(0:0:130:1)(0:1:130:1)(0:0:131:1)(0:1:131:1)(0:0:132:1)(0:1:132:1)(0:0:133:1)(0:1:133:1)(0:0:134:1)(0:1:134:1)(0:0:135:1)(0:1:135:1)(0:0:136:1)(0:1:136:1)(0:0:137:1)(0:1:137:1)(0:0:138:1)(0:1:138:1)(0:0:139:1)(0:1:139:1)(0:0:140:1)(0:1:140:1)(0:0:141:1)(0:1:141:1)(0:0:142:1)(0:1:142:1)(0:0:143:1)(0:1:143:1)(0:0:144:1)(0:1:144:1)(0:0:145:1)(0:1:145:1)(0:0:146:1)(0:1:146:1)(0:0:147:1)(0:1:147:1)(0:0:148:1)(0:1:148:1)(0:0:149:1)(0:1:149:1)(0:0:150:1)(0:1:150:1)(0:0:151:1)(0:1:151:1)(0:0:152:1)(0:1:152:1)(0:0:153:1)(0:1:153:1)(0:0:154:1)(0:1:154:1)(0:0:155:1)(0:1:155:1)(0:0:156:1)(0:1:156:1)(0:0:157:1)(0:1:157:1)(0:0:158:1)(0:1:158:1)(0:0:159:1)(0:1:159:1)(0:0:160:1)(0:1:160:1)(0:0:161:1)(0:1:161:1)(0:0:162:1)(0:1:162:1)(0:0:163:1)(0:1:163:1)(0:0:164:1)(0:1:164:1)(0:0:165:1)(0:1:165:1)(0:0:166:1)(0:1:166:1)(0:0:167:1)(0:1:167:1)(0:0:168:1)(0:1:168:1)(0:0:169:1)(0:1:169:1)(0:0:170:1)(0:1:170:1)(0:0:171:1)(0:1:171:1)(0:0:172:1)(0:1:172:1)(0:0:173:1)(0:1:173:1)(0:0:174:1)(0:1:174:1)(0:0:175:1)(0:1:175:1)(0:0:176:1)(0:1:176:1)(0:0:177:1)(0:1:177:1)(0:0:178:1)(0:1:178:1)(0:0:179:1)(0:1:179:1)(0:0:180:1)(0:1:180:1)(0:0:181:1)(0:1:181:1)(0:0:182:1)(0:1:182:1)(0:0:183:1)(0:1:183:1)(0:0:184:1)(0:1:184:1)(0:0:185:1)(0:1:185:1)(0:0:186:1)(0:1:186:1)(0:0:187:1)(0:1:187:1)(0:0:188:1)(0:1:188:1)(0:0:189:1)(0:1:189:1)(0:0:190:1)(0:1:190:1)(0:0:191:1)(0:1:191:1) diff --git a/src/tests/fixtures/np2split/NP21_meta/_spikeglx_ephysData_g0_t0.imec0.ap.meta b/src/tests/fixtures/np2split/NP21_meta/_spikeglx_ephysData_g0_t0.imec0.ap.meta new file mode 100755 index 0000000..5839775 --- /dev/null +++ b/src/tests/fixtures/np2split/NP21_meta/_spikeglx_ephysData_g0_t0.imec0.ap.meta @@ -0,0 +1,50 @@ +acqApLfSy=384,0,1 +appVersion=20190919 +fileCreateTime=2020-10-29T16:54:09 +fileName=D:/data/DO_0004/2020-10-29/1/p1_g0/p1_g0_imec0/p1_g0_t0.imec0.ap.bin +fileSHA1=7161C950C328794A5115B06D1B9B9C898E3DFEF4 +fileSizeBytes=23100000 +fileTimeSecs=1 +firstSample=110884048 +gateMode=Immediate +imAiRangeMax=0.5 +imAiRangeMin=-0.5 +imCalibrated=true +imDatApi=2.11 +imDatBs_fw=1.1.128 +imDatBsc_fw=2.0.19 +imDatBsc_hw=2.1 +imDatBsc_pn=NP2_QBSC_00 +imDatBsc_sn=483 +imDatFx_hw=1.7 +imDatFx_pn=NPM_FLEX_0 +imDatHs_fw=0.0 +imDatHs_pn=000000000 +imDatHs_sn=1540 +imDatPrb_dock=1 +imDatPrb_pn=PRB2_1_2_0640_0 +imDatPrb_port=1 +imDatPrb_slot=3 +imDatPrb_sn=19011116954 +imDatPrb_type=21 +imLEDEnable=false +imMaxInt=8192 +imRoFile=C:/Users/Steinmetz Lab/Documents/spikeglx/Release_v20190919-phase20/IMRO_Tables/NPtype21_bank0_ref1.imro +imSampRate=30000 +imStdby= +imTrgRising=false +imTrgSource=0 +nSavedChans=385 +snsApLfSy=384,0,1 +snsSaveChanSubset=0:384 +syncImInputSlot=3 +syncSourceIdx=0 +syncSourcePeriod=1 +trigMode=Immediate +typeImEnabled=1 +typeNiEnabled=0 +typeThis=imec +userNotes= +~imroTbl=(21,384)(0 1 1 0)(1 1 1 1)(2 1 1 2)(3 1 1 3)(4 1 1 4)(5 1 1 5)(6 1 1 6)(7 1 1 7)(8 1 1 8)(9 1 1 9)(10 1 1 10)(11 1 1 11)(12 1 1 12)(13 1 1 13)(14 1 1 14)(15 1 1 15)(16 1 1 16)(17 1 1 17)(18 1 1 18)(19 1 1 19)(20 1 1 20)(21 1 1 21)(22 1 1 22)(23 1 1 23)(24 1 1 24)(25 1 1 25)(26 1 1 26)(27 1 1 27)(28 1 1 28)(29 1 1 29)(30 1 1 30)(31 1 1 31)(32 1 1 32)(33 1 1 33)(34 1 1 34)(35 1 1 35)(36 1 1 36)(37 1 1 37)(38 1 1 38)(39 1 1 39)(40 1 1 40)(41 1 1 41)(42 1 1 42)(43 1 1 43)(44 1 1 44)(45 1 1 45)(46 1 1 46)(47 1 1 47)(48 1 1 48)(49 1 1 49)(50 1 1 50)(51 1 1 51)(52 1 1 52)(53 1 1 53)(54 1 1 54)(55 1 1 55)(56 1 1 56)(57 1 1 57)(58 1 1 58)(59 1 1 59)(60 1 1 60)(61 1 1 61)(62 1 1 62)(63 1 1 63)(64 1 1 64)(65 1 1 65)(66 1 1 66)(67 1 1 67)(68 1 1 68)(69 1 1 69)(70 1 1 70)(71 1 1 71)(72 1 1 72)(73 1 1 73)(74 1 1 74)(75 1 1 75)(76 1 1 76)(77 1 1 77)(78 1 1 78)(79 1 1 79)(80 1 1 80)(81 1 1 81)(82 1 1 82)(83 1 1 83)(84 1 1 84)(85 1 1 85)(86 1 1 86)(87 1 1 87)(88 1 1 88)(89 1 1 89)(90 1 1 90)(91 1 1 91)(92 1 1 92)(93 1 1 93)(94 1 1 94)(95 1 1 95)(96 1 1 96)(97 1 1 97)(98 1 1 98)(99 1 1 99)(100 1 1 100)(101 1 1 101)(102 1 1 102)(103 1 1 103)(104 1 1 104)(105 1 1 105)(106 1 1 106)(107 1 1 107)(108 1 1 108)(109 1 1 109)(110 1 1 110)(111 1 1 111)(112 1 1 112)(113 1 1 113)(114 1 1 114)(115 1 1 115)(116 1 1 116)(117 1 1 117)(118 1 1 118)(119 1 1 119)(120 1 1 120)(121 1 1 121)(122 1 1 122)(123 1 1 123)(124 1 1 124)(125 1 1 125)(126 1 1 126)(127 1 1 127)(128 1 1 128)(129 1 1 129)(130 1 1 130)(131 1 1 131)(132 1 1 132)(133 1 1 133)(134 1 1 134)(135 1 1 135)(136 1 1 136)(137 1 1 137)(138 1 1 138)(139 1 1 139)(140 1 1 140)(141 1 1 141)(142 1 1 142)(143 1 1 143)(144 1 1 144)(145 1 1 145)(146 1 1 146)(147 1 1 147)(148 1 1 148)(149 1 1 149)(150 1 1 150)(151 1 1 151)(152 1 1 152)(153 1 1 153)(154 1 1 154)(155 1 1 155)(156 1 1 156)(157 1 1 157)(158 1 1 158)(159 1 1 159)(160 1 1 160)(161 1 1 161)(162 1 1 162)(163 1 1 163)(164 1 1 164)(165 1 1 165)(166 1 1 166)(167 1 1 167)(168 1 1 168)(169 1 1 169)(170 1 1 170)(171 1 1 171)(172 1 1 172)(173 1 1 173)(174 1 1 174)(175 1 1 175)(176 1 1 176)(177 1 1 177)(178 1 1 178)(179 1 1 179)(180 1 1 180)(181 1 1 181)(182 1 1 182)(183 1 1 183)(184 1 1 184)(185 1 1 185)(186 1 1 186)(187 1 1 187)(188 1 1 188)(189 1 1 189)(190 1 1 190)(191 1 1 191)(192 1 1 192)(193 1 1 193)(194 1 1 194)(195 1 1 195)(196 1 1 196)(197 1 1 197)(198 1 1 198)(199 1 1 199)(200 1 1 200)(201 1 1 201)(202 1 1 202)(203 1 1 203)(204 1 1 204)(205 1 1 205)(206 1 1 206)(207 1 1 207)(208 1 1 208)(209 1 1 209)(210 1 1 210)(211 1 1 211)(212 1 1 212)(213 1 1 213)(214 1 1 214)(215 1 1 215)(216 1 1 216)(217 1 1 217)(218 1 1 218)(219 1 1 219)(220 1 1 220)(221 1 1 221)(222 1 1 222)(223 1 1 223)(224 1 1 224)(225 1 1 225)(226 1 1 226)(227 1 1 227)(228 1 1 228)(229 1 1 229)(230 1 1 230)(231 1 1 231)(232 1 1 232)(233 1 1 233)(234 1 1 234)(235 1 1 235)(236 1 1 236)(237 1 1 237)(238 1 1 238)(239 1 1 239)(240 1 1 240)(241 1 1 241)(242 1 1 242)(243 1 1 243)(244 1 1 244)(245 1 1 245)(246 1 1 246)(247 1 1 247)(248 1 1 248)(249 1 1 249)(250 1 1 250)(251 1 1 251)(252 1 1 252)(253 1 1 253)(254 1 1 254)(255 1 1 255)(256 1 1 256)(257 1 1 257)(258 1 1 258)(259 1 1 259)(260 1 1 260)(261 1 1 261)(262 1 1 262)(263 1 1 263)(264 1 1 264)(265 1 1 265)(266 1 1 266)(267 1 1 267)(268 1 1 268)(269 1 1 269)(270 1 1 270)(271 1 1 271)(272 1 1 272)(273 1 1 273)(274 1 1 274)(275 1 1 275)(276 1 1 276)(277 1 1 277)(278 1 1 278)(279 1 1 279)(280 1 1 280)(281 1 1 281)(282 1 1 282)(283 1 1 283)(284 1 1 284)(285 1 1 285)(286 1 1 286)(287 1 1 287)(288 1 1 288)(289 1 1 289)(290 1 1 290)(291 1 1 291)(292 1 1 292)(293 1 1 293)(294 1 1 294)(295 1 1 295)(296 1 1 296)(297 1 1 297)(298 1 1 298)(299 1 1 299)(300 1 1 300)(301 1 1 301)(302 1 1 302)(303 1 1 303)(304 1 1 304)(305 1 1 305)(306 1 1 306)(307 1 1 307)(308 1 1 308)(309 1 1 309)(310 1 1 310)(311 1 1 311)(312 1 1 312)(313 1 1 313)(314 1 1 314)(315 1 1 315)(316 1 1 316)(317 1 1 317)(318 1 1 318)(319 1 1 319)(320 1 1 320)(321 1 1 321)(322 1 1 322)(323 1 1 323)(324 1 1 324)(325 1 1 325)(326 1 1 326)(327 1 1 327)(328 1 1 328)(329 1 1 329)(330 1 1 330)(331 1 1 331)(332 1 1 332)(333 1 1 333)(334 1 1 334)(335 1 1 335)(336 1 1 336)(337 1 1 337)(338 1 1 338)(339 1 1 339)(340 1 1 340)(341 1 1 341)(342 1 1 342)(343 1 1 343)(344 1 1 344)(345 1 1 345)(346 1 1 346)(347 1 1 347)(348 1 1 348)(349 1 1 349)(350 1 1 350)(351 1 1 351)(352 1 1 352)(353 1 1 353)(354 1 1 354)(355 1 1 355)(356 1 1 356)(357 1 1 357)(358 1 1 358)(359 1 1 359)(360 1 1 360)(361 1 1 361)(362 1 1 362)(363 1 1 363)(364 1 1 364)(365 1 1 365)(366 1 1 366)(367 1 1 367)(368 1 1 368)(369 1 1 369)(370 1 1 370)(371 1 1 371)(372 1 1 372)(373 1 1 373)(374 1 1 374)(375 1 1 375)(376 1 1 376)(377 1 1 377)(378 1 1 378)(379 1 1 379)(380 1 1 380)(381 1 1 381)(382 1 1 382)(383 1 1 383) +~snsChanMap=(384,0,1)(AP0;0:0)(AP1;1:1)(AP2;2:2)(AP3;3:3)(AP4;4:4)(AP5;5:5)(AP6;6:6)(AP7;7:7)(AP8;8:8)(AP9;9:9)(AP10;10:10)(AP11;11:11)(AP12;12:12)(AP13;13:13)(AP14;14:14)(AP15;15:15)(AP16;16:16)(AP17;17:17)(AP18;18:18)(AP19;19:19)(AP20;20:20)(AP21;21:21)(AP22;22:22)(AP23;23:23)(AP24;24:24)(AP25;25:25)(AP26;26:26)(AP27;27:27)(AP28;28:28)(AP29;29:29)(AP30;30:30)(AP31;31:31)(AP32;32:32)(AP33;33:33)(AP34;34:34)(AP35;35:35)(AP36;36:36)(AP37;37:37)(AP38;38:38)(AP39;39:39)(AP40;40:40)(AP41;41:41)(AP42;42:42)(AP43;43:43)(AP44;44:44)(AP45;45:45)(AP46;46:46)(AP47;47:47)(AP48;48:48)(AP49;49:49)(AP50;50:50)(AP51;51:51)(AP52;52:52)(AP53;53:53)(AP54;54:54)(AP55;55:55)(AP56;56:56)(AP57;57:57)(AP58;58:58)(AP59;59:59)(AP60;60:60)(AP61;61:61)(AP62;62:62)(AP63;63:63)(AP64;64:64)(AP65;65:65)(AP66;66:66)(AP67;67:67)(AP68;68:68)(AP69;69:69)(AP70;70:70)(AP71;71:71)(AP72;72:72)(AP73;73:73)(AP74;74:74)(AP75;75:75)(AP76;76:76)(AP77;77:77)(AP78;78:78)(AP79;79:79)(AP80;80:80)(AP81;81:81)(AP82;82:82)(AP83;83:83)(AP84;84:84)(AP85;85:85)(AP86;86:86)(AP87;87:87)(AP88;88:88)(AP89;89:89)(AP90;90:90)(AP91;91:91)(AP92;92:92)(AP93;93:93)(AP94;94:94)(AP95;95:95)(AP96;96:96)(AP97;97:97)(AP98;98:98)(AP99;99:99)(AP100;100:100)(AP101;101:101)(AP102;102:102)(AP103;103:103)(AP104;104:104)(AP105;105:105)(AP106;106:106)(AP107;107:107)(AP108;108:108)(AP109;109:109)(AP110;110:110)(AP111;111:111)(AP112;112:112)(AP113;113:113)(AP114;114:114)(AP115;115:115)(AP116;116:116)(AP117;117:117)(AP118;118:118)(AP119;119:119)(AP120;120:120)(AP121;121:121)(AP122;122:122)(AP123;123:123)(AP124;124:124)(AP125;125:125)(AP126;126:126)(AP127;127:127)(AP128;128:128)(AP129;129:129)(AP130;130:130)(AP131;131:131)(AP132;132:132)(AP133;133:133)(AP134;134:134)(AP135;135:135)(AP136;136:136)(AP137;137:137)(AP138;138:138)(AP139;139:139)(AP140;140:140)(AP141;141:141)(AP142;142:142)(AP143;143:143)(AP144;144:144)(AP145;145:145)(AP146;146:146)(AP147;147:147)(AP148;148:148)(AP149;149:149)(AP150;150:150)(AP151;151:151)(AP152;152:152)(AP153;153:153)(AP154;154:154)(AP155;155:155)(AP156;156:156)(AP157;157:157)(AP158;158:158)(AP159;159:159)(AP160;160:160)(AP161;161:161)(AP162;162:162)(AP163;163:163)(AP164;164:164)(AP165;165:165)(AP166;166:166)(AP167;167:167)(AP168;168:168)(AP169;169:169)(AP170;170:170)(AP171;171:171)(AP172;172:172)(AP173;173:173)(AP174;174:174)(AP175;175:175)(AP176;176:176)(AP177;177:177)(AP178;178:178)(AP179;179:179)(AP180;180:180)(AP181;181:181)(AP182;182:182)(AP183;183:183)(AP184;184:184)(AP185;185:185)(AP186;186:186)(AP187;187:187)(AP188;188:188)(AP189;189:189)(AP190;190:190)(AP191;191:191)(AP192;192:192)(AP193;193:193)(AP194;194:194)(AP195;195:195)(AP196;196:196)(AP197;197:197)(AP198;198:198)(AP199;199:199)(AP200;200:200)(AP201;201:201)(AP202;202:202)(AP203;203:203)(AP204;204:204)(AP205;205:205)(AP206;206:206)(AP207;207:207)(AP208;208:208)(AP209;209:209)(AP210;210:210)(AP211;211:211)(AP212;212:212)(AP213;213:213)(AP214;214:214)(AP215;215:215)(AP216;216:216)(AP217;217:217)(AP218;218:218)(AP219;219:219)(AP220;220:220)(AP221;221:221)(AP222;222:222)(AP223;223:223)(AP224;224:224)(AP225;225:225)(AP226;226:226)(AP227;227:227)(AP228;228:228)(AP229;229:229)(AP230;230:230)(AP231;231:231)(AP232;232:232)(AP233;233:233)(AP234;234:234)(AP235;235:235)(AP236;236:236)(AP237;237:237)(AP238;238:238)(AP239;239:239)(AP240;240:240)(AP241;241:241)(AP242;242:242)(AP243;243:243)(AP244;244:244)(AP245;245:245)(AP246;246:246)(AP247;247:247)(AP248;248:248)(AP249;249:249)(AP250;250:250)(AP251;251:251)(AP252;252:252)(AP253;253:253)(AP254;254:254)(AP255;255:255)(AP256;256:256)(AP257;257:257)(AP258;258:258)(AP259;259:259)(AP260;260:260)(AP261;261:261)(AP262;262:262)(AP263;263:263)(AP264;264:264)(AP265;265:265)(AP266;266:266)(AP267;267:267)(AP268;268:268)(AP269;269:269)(AP270;270:270)(AP271;271:271)(AP272;272:272)(AP273;273:273)(AP274;274:274)(AP275;275:275)(AP276;276:276)(AP277;277:277)(AP278;278:278)(AP279;279:279)(AP280;280:280)(AP281;281:281)(AP282;282:282)(AP283;283:283)(AP284;284:284)(AP285;285:285)(AP286;286:286)(AP287;287:287)(AP288;288:288)(AP289;289:289)(AP290;290:290)(AP291;291:291)(AP292;292:292)(AP293;293:293)(AP294;294:294)(AP295;295:295)(AP296;296:296)(AP297;297:297)(AP298;298:298)(AP299;299:299)(AP300;300:300)(AP301;301:301)(AP302;302:302)(AP303;303:303)(AP304;304:304)(AP305;305:305)(AP306;306:306)(AP307;307:307)(AP308;308:308)(AP309;309:309)(AP310;310:310)(AP311;311:311)(AP312;312:312)(AP313;313:313)(AP314;314:314)(AP315;315:315)(AP316;316:316)(AP317;317:317)(AP318;318:318)(AP319;319:319)(AP320;320:320)(AP321;321:321)(AP322;322:322)(AP323;323:323)(AP324;324:324)(AP325;325:325)(AP326;326:326)(AP327;327:327)(AP328;328:328)(AP329;329:329)(AP330;330:330)(AP331;331:331)(AP332;332:332)(AP333;333:333)(AP334;334:334)(AP335;335:335)(AP336;336:336)(AP337;337:337)(AP338;338:338)(AP339;339:339)(AP340;340:340)(AP341;341:341)(AP342;342:342)(AP343;343:343)(AP344;344:344)(AP345;345:345)(AP346;346:346)(AP347;347:347)(AP348;348:348)(AP349;349:349)(AP350;350:350)(AP351;351:351)(AP352;352:352)(AP353;353:353)(AP354;354:354)(AP355;355:355)(AP356;356:356)(AP357;357:357)(AP358;358:358)(AP359;359:359)(AP360;360:360)(AP361;361:361)(AP362;362:362)(AP363;363:363)(AP364;364:364)(AP365;365:365)(AP366;366:366)(AP367;367:367)(AP368;368:368)(AP369;369:369)(AP370;370:370)(AP371;371:371)(AP372;372:372)(AP373;373:373)(AP374;374:374)(AP375;375:375)(AP376;376:376)(AP377;377:377)(AP378;378:378)(AP379;379:379)(AP380;380:380)(AP381;381:381)(AP382;382:382)(AP383;383:383)(SY0;384:384) +~snsShankMap=(1,2,640)(0:0:0:1)(0:1:0:1)(0:0:1:1)(0:1:1:1)(0:0:2:1)(0:1:2:1)(0:0:3:1)(0:1:3:1)(0:0:4:1)(0:1:4:1)(0:0:5:1)(0:1:5:1)(0:0:6:1)(0:1:6:1)(0:0:7:1)(0:1:7:1)(0:0:8:1)(0:1:8:1)(0:0:9:1)(0:1:9:1)(0:0:10:1)(0:1:10:1)(0:0:11:1)(0:1:11:1)(0:0:12:1)(0:1:12:1)(0:0:13:1)(0:1:13:1)(0:0:14:1)(0:1:14:1)(0:0:15:1)(0:1:15:1)(0:0:16:1)(0:1:16:1)(0:0:17:1)(0:1:17:1)(0:0:18:1)(0:1:18:1)(0:0:19:1)(0:1:19:1)(0:0:20:1)(0:1:20:1)(0:0:21:1)(0:1:21:1)(0:0:22:1)(0:1:22:1)(0:0:23:1)(0:1:23:1)(0:0:24:1)(0:1:24:1)(0:0:25:1)(0:1:25:1)(0:0:26:1)(0:1:26:1)(0:0:27:1)(0:1:27:1)(0:0:28:1)(0:1:28:1)(0:0:29:1)(0:1:29:1)(0:0:30:1)(0:1:30:1)(0:0:31:1)(0:1:31:1)(0:0:32:1)(0:1:32:1)(0:0:33:1)(0:1:33:1)(0:0:34:1)(0:1:34:1)(0:0:35:1)(0:1:35:1)(0:0:36:1)(0:1:36:1)(0:0:37:1)(0:1:37:1)(0:0:38:1)(0:1:38:1)(0:0:39:1)(0:1:39:1)(0:0:40:1)(0:1:40:1)(0:0:41:1)(0:1:41:1)(0:0:42:1)(0:1:42:1)(0:0:43:1)(0:1:43:1)(0:0:44:1)(0:1:44:1)(0:0:45:1)(0:1:45:1)(0:0:46:1)(0:1:46:1)(0:0:47:1)(0:1:47:1)(0:0:48:1)(0:1:48:1)(0:0:49:1)(0:1:49:1)(0:0:50:1)(0:1:50:1)(0:0:51:1)(0:1:51:1)(0:0:52:1)(0:1:52:1)(0:0:53:1)(0:1:53:1)(0:0:54:1)(0:1:54:1)(0:0:55:1)(0:1:55:1)(0:0:56:1)(0:1:56:1)(0:0:57:1)(0:1:57:1)(0:0:58:1)(0:1:58:1)(0:0:59:1)(0:1:59:1)(0:0:60:1)(0:1:60:1)(0:0:61:1)(0:1:61:1)(0:0:62:1)(0:1:62:1)(0:0:63:1)(0:1:63:0)(0:0:64:1)(0:1:64:1)(0:0:65:1)(0:1:65:1)(0:0:66:1)(0:1:66:1)(0:0:67:1)(0:1:67:1)(0:0:68:1)(0:1:68:1)(0:0:69:1)(0:1:69:1)(0:0:70:1)(0:1:70:1)(0:0:71:1)(0:1:71:1)(0:0:72:1)(0:1:72:1)(0:0:73:1)(0:1:73:1)(0:0:74:1)(0:1:74:1)(0:0:75:1)(0:1:75:1)(0:0:76:1)(0:1:76:1)(0:0:77:1)(0:1:77:1)(0:0:78:1)(0:1:78:1)(0:0:79:1)(0:1:79:1)(0:0:80:1)(0:1:80:1)(0:0:81:1)(0:1:81:1)(0:0:82:1)(0:1:82:1)(0:0:83:1)(0:1:83:1)(0:0:84:1)(0:1:84:1)(0:0:85:1)(0:1:85:1)(0:0:86:1)(0:1:86:1)(0:0:87:1)(0:1:87:1)(0:0:88:1)(0:1:88:1)(0:0:89:1)(0:1:89:1)(0:0:90:1)(0:1:90:1)(0:0:91:1)(0:1:91:1)(0:0:92:1)(0:1:92:1)(0:0:93:1)(0:1:93:1)(0:0:94:1)(0:1:94:1)(0:0:95:1)(0:1:95:1)(0:0:96:1)(0:1:96:1)(0:0:97:1)(0:1:97:1)(0:0:98:1)(0:1:98:1)(0:0:99:1)(0:1:99:1)(0:0:100:1)(0:1:100:1)(0:0:101:1)(0:1:101:1)(0:0:102:1)(0:1:102:1)(0:0:103:1)(0:1:103:1)(0:0:104:1)(0:1:104:1)(0:0:105:1)(0:1:105:1)(0:0:106:1)(0:1:106:1)(0:0:107:1)(0:1:107:1)(0:0:108:1)(0:1:108:1)(0:0:109:1)(0:1:109:1)(0:0:110:1)(0:1:110:1)(0:0:111:1)(0:1:111:1)(0:0:112:1)(0:1:112:1)(0:0:113:1)(0:1:113:1)(0:0:114:1)(0:1:114:1)(0:0:115:1)(0:1:115:1)(0:0:116:1)(0:1:116:1)(0:0:117:1)(0:1:117:1)(0:0:118:1)(0:1:118:1)(0:0:119:1)(0:1:119:1)(0:0:120:1)(0:1:120:1)(0:0:121:1)(0:1:121:1)(0:0:122:1)(0:1:122:1)(0:0:123:1)(0:1:123:1)(0:0:124:1)(0:1:124:1)(0:0:125:1)(0:1:125:1)(0:0:126:1)(0:1:126:1)(0:0:127:1)(0:1:127:1)(0:0:128:1)(0:1:128:1)(0:0:129:1)(0:1:129:1)(0:0:130:1)(0:1:130:1)(0:0:131:1)(0:1:131:1)(0:0:132:1)(0:1:132:1)(0:0:133:1)(0:1:133:1)(0:0:134:1)(0:1:134:1)(0:0:135:1)(0:1:135:1)(0:0:136:1)(0:1:136:1)(0:0:137:1)(0:1:137:1)(0:0:138:1)(0:1:138:1)(0:0:139:1)(0:1:139:1)(0:0:140:1)(0:1:140:1)(0:0:141:1)(0:1:141:1)(0:0:142:1)(0:1:142:1)(0:0:143:1)(0:1:143:1)(0:0:144:1)(0:1:144:1)(0:0:145:1)(0:1:145:1)(0:0:146:1)(0:1:146:1)(0:0:147:1)(0:1:147:1)(0:0:148:1)(0:1:148:1)(0:0:149:1)(0:1:149:1)(0:0:150:1)(0:1:150:1)(0:0:151:1)(0:1:151:1)(0:0:152:1)(0:1:152:1)(0:0:153:1)(0:1:153:1)(0:0:154:1)(0:1:154:1)(0:0:155:1)(0:1:155:1)(0:0:156:1)(0:1:156:1)(0:0:157:1)(0:1:157:1)(0:0:158:1)(0:1:158:1)(0:0:159:1)(0:1:159:1)(0:0:160:1)(0:1:160:1)(0:0:161:1)(0:1:161:1)(0:0:162:1)(0:1:162:1)(0:0:163:1)(0:1:163:1)(0:0:164:1)(0:1:164:1)(0:0:165:1)(0:1:165:1)(0:0:166:1)(0:1:166:1)(0:0:167:1)(0:1:167:1)(0:0:168:1)(0:1:168:1)(0:0:169:1)(0:1:169:1)(0:0:170:1)(0:1:170:1)(0:0:171:1)(0:1:171:1)(0:0:172:1)(0:1:172:1)(0:0:173:1)(0:1:173:1)(0:0:174:1)(0:1:174:1)(0:0:175:1)(0:1:175:1)(0:0:176:1)(0:1:176:1)(0:0:177:1)(0:1:177:1)(0:0:178:1)(0:1:178:1)(0:0:179:1)(0:1:179:1)(0:0:180:1)(0:1:180:1)(0:0:181:1)(0:1:181:1)(0:0:182:1)(0:1:182:1)(0:0:183:1)(0:1:183:1)(0:0:184:1)(0:1:184:1)(0:0:185:1)(0:1:185:1)(0:0:186:1)(0:1:186:1)(0:0:187:1)(0:1:187:1)(0:0:188:1)(0:1:188:1)(0:0:189:1)(0:1:189:1)(0:0:190:1)(0:1:190:1)(0:0:191:1)(0:1:191:1) \ No newline at end of file diff --git a/src/tests/fixtures/np2split/NP24_meta/_spikeglx_ephysData_g0_t0.imec0.ap.meta b/src/tests/fixtures/np2split/NP24_meta/_spikeglx_ephysData_g0_t0.imec0.ap.meta new file mode 100755 index 0000000..4825b84 --- /dev/null +++ b/src/tests/fixtures/np2split/NP24_meta/_spikeglx_ephysData_g0_t0.imec0.ap.meta @@ -0,0 +1,51 @@ +acqApLfSy=384,0,1 +appVersion=20201103 +fileCreateTime=2021-08-02T14:30:26 +fileName=D:/iblrig_data/Subjects/KS059/2021-08-02/001/_spikeglx_ephysData_g0/_spikeglx_ephysData_g0_imec0/_spikeglx_ephysData_g0_t0.imec0.ap.bin +fileSHA1=C040C224559DD5FAB71AC1A1542049BA9D68A77E +fileSizeBytes=23100000 +fileTimeSecs=1 +firstSample=110884048 +gateMode=Immediate +imAiRangeMax=0.5 +imAiRangeMin=-0.5 +imCalibrated=true +imDatApi=3.31 +imDatBs_fw=2.0.137 +imDatBsc_fw=3.2.176 +imDatBsc_hw=1.9 +imDatBsc_pn=NP2_QBSC_00 +imDatBsc_sn=118 +imDatFx_hw=1.8 +imDatFx_pn=NPM_FLEX_0 +imDatHs_fw=1 +imDatHs_pn=NPM_HS_01 +imDatHs_sn=0 +imDatPrb_dock=1 +imDatPrb_pn=NP2010 +imDatPrb_port=1 +imDatPrb_slot=2 +imDatPrb_sn=19011110513 +imDatPrb_type=24 +imLEDEnable=false +imMaxInt=8192 +imRoFile=C:/SpikeGLX/Release_v20201103-phase30/IMRO_Tables/NPtype24_hStripe_botRow0_ref0.imro +imSampRate=29999.757983 +imStdby= +imTrgRising=true +imTrgSource=0 +nDataDirs=1 +nSavedChans=385 +snsApLfSy=384,0,1 +snsSaveChanSubset=0:384 +syncImInputSlot=2 +syncSourceIdx=3 +syncSourcePeriod=1 +trigMode=Immediate +typeImEnabled=3 +typeNiEnabled=1 +typeThis=imec +userNotes= +imroTbl=(24,384)(0 0 0 0 0)(1 0 0 0 1)(2 0 0 0 2)(3 0 0 0 3)(4 0 0 0 4)(5 0 0 0 5)(6 0 0 0 6)(7 0 0 0 7)(8 0 0 0 8)(9 0 0 0 9)(10 0 0 0 10)(11 0 0 0 11)(12 0 0 0 12)(13 0 0 0 13)(14 0 0 0 14)(15 0 0 0 15)(16 0 0 0 16)(17 0 0 0 17)(18 0 0 0 18)(19 0 0 0 19)(20 0 0 0 20)(21 0 0 0 21)(22 0 0 0 22)(23 0 0 0 23)(24 0 0 0 24)(25 0 0 0 25)(26 0 0 0 26)(27 0 0 0 27)(28 0 0 0 28)(29 0 0 0 29)(30 0 0 0 30)(31 0 0 0 31)(32 0 0 0 32)(33 0 0 0 33)(34 0 0 0 34)(35 0 0 0 35)(36 0 0 0 36)(37 0 0 0 37)(38 0 0 0 38)(39 0 0 0 39)(40 0 0 0 40)(41 0 0 0 41)(42 0 0 0 42)(43 0 0 0 43)(44 0 0 0 44)(45 0 0 0 45)(46 0 0 0 46)(47 0 0 0 47)(48 1 0 0 0)(49 1 0 0 1)(50 1 0 0 2)(51 1 0 0 3)(52 1 0 0 4)(53 1 0 0 5)(54 1 0 0 6)(55 1 0 0 7)(56 1 0 0 8)(57 1 0 0 9)(58 1 0 0 10)(59 1 0 0 11)(60 1 0 0 12)(61 1 0 0 13)(62 1 0 0 14)(63 1 0 0 15)(64 1 0 0 16)(65 1 0 0 17)(66 1 0 0 18)(67 1 0 0 19)(68 1 0 0 20)(69 1 0 0 21)(70 1 0 0 22)(71 1 0 0 23)(72 1 0 0 24)(73 1 0 0 25)(74 1 0 0 26)(75 1 0 0 27)(76 1 0 0 28)(77 1 0 0 29)(78 1 0 0 30)(79 1 0 0 31)(80 1 0 0 32)(81 1 0 0 33)(82 1 0 0 34)(83 1 0 0 35)(84 1 0 0 36)(85 1 0 0 37)(86 1 0 0 38)(87 1 0 0 39)(88 1 0 0 40)(89 1 0 0 41)(90 1 0 0 42)(91 1 0 0 43)(92 1 0 0 44)(93 1 0 0 45)(94 1 0 0 46)(95 1 0 0 47)(96 0 0 0 48)(97 0 0 0 49)(98 0 0 0 50)(99 0 0 0 51)(100 0 0 0 52)(101 0 0 0 53)(102 0 0 0 54)(103 0 0 0 55)(104 0 0 0 56)(105 0 0 0 57)(106 0 0 0 58)(107 0 0 0 59)(108 0 0 0 60)(109 0 0 0 61)(110 0 0 0 62)(111 0 0 0 63)(112 0 0 0 64)(113 0 0 0 65)(114 0 0 0 66)(115 0 0 0 67)(116 0 0 0 68)(117 0 0 0 69)(118 0 0 0 70)(119 0 0 0 71)(120 0 0 0 72)(121 0 0 0 73)(122 0 0 0 74)(123 0 0 0 75)(124 0 0 0 76)(125 0 0 0 77)(126 0 0 0 78)(127 0 0 0 79)(128 0 0 0 80)(129 0 0 0 81)(130 0 0 0 82)(131 0 0 0 83)(132 0 0 0 84)(133 0 0 0 85)(134 0 0 0 86)(135 0 0 0 87)(136 0 0 0 88)(137 0 0 0 89)(138 0 0 0 90)(139 0 0 0 91)(140 0 0 0 92)(141 0 0 0 93)(142 0 0 0 94)(143 0 0 0 95)(144 1 0 0 48)(145 1 0 0 49)(146 1 0 0 50)(147 1 0 0 51)(148 1 0 0 52)(149 1 0 0 53)(150 1 0 0 54)(151 1 0 0 55)(152 1 0 0 56)(153 1 0 0 57)(154 1 0 0 58)(155 1 0 0 59)(156 1 0 0 60)(157 1 0 0 61)(158 1 0 0 62)(159 1 0 0 63)(160 1 0 0 64)(161 1 0 0 65)(162 1 0 0 66)(163 1 0 0 67)(164 1 0 0 68)(165 1 0 0 69)(166 1 0 0 70)(167 1 0 0 71)(168 1 0 0 72)(169 1 0 0 73)(170 1 0 0 74)(171 1 0 0 75)(172 1 0 0 76)(173 1 0 0 77)(174 1 0 0 78)(175 1 0 0 79)(176 1 0 0 80)(177 1 0 0 81)(178 1 0 0 82)(179 1 0 0 83)(180 1 0 0 84)(181 1 0 0 85)(182 1 0 0 86)(183 1 0 0 87)(184 1 0 0 88)(185 1 0 0 89)(186 1 0 0 90)(187 1 0 0 91)(188 1 0 0 92)(189 1 0 0 93)(190 1 0 0 94)(191 1 0 0 95)(192 2 0 0 0)(193 2 0 0 1)(194 2 0 0 2)(195 2 0 0 3)(196 2 0 0 4)(197 2 0 0 5)(198 2 0 0 6)(199 2 0 0 7)(200 2 0 0 8)(201 2 0 0 9)(202 2 0 0 10)(203 2 0 0 11)(204 2 0 0 12)(205 2 0 0 13)(206 2 0 0 14)(207 2 0 0 15)(208 2 0 0 16)(209 2 0 0 17)(210 2 0 0 18)(211 2 0 0 19)(212 2 0 0 20)(213 2 0 0 21)(214 2 0 0 22)(215 2 0 0 23)(216 2 0 0 24)(217 2 0 0 25)(218 2 0 0 26)(219 2 0 0 27)(220 2 0 0 28)(221 2 0 0 29)(222 2 0 0 30)(223 2 0 0 31)(224 2 0 0 32)(225 2 0 0 33)(226 2 0 0 34)(227 2 0 0 35)(228 2 0 0 36)(229 2 0 0 37)(230 2 0 0 38)(231 2 0 0 39)(232 2 0 0 40)(233 2 0 0 41)(234 2 0 0 42)(235 2 0 0 43)(236 2 0 0 44)(237 2 0 0 45)(238 2 0 0 46)(239 2 0 0 47)(240 3 0 0 0)(241 3 0 0 1)(242 3 0 0 2)(243 3 0 0 3)(244 3 0 0 4)(245 3 0 0 5)(246 3 0 0 6)(247 3 0 0 7)(248 3 0 0 8)(249 3 0 0 9)(250 3 0 0 10)(251 3 0 0 11)(252 3 0 0 12)(253 3 0 0 13)(254 3 0 0 14)(255 3 0 0 15)(256 3 0 0 16)(257 3 0 0 17)(258 3 0 0 18)(259 3 0 0 19)(260 3 0 0 20)(261 3 0 0 21)(262 3 0 0 22)(263 3 0 0 23)(264 3 0 0 24)(265 3 0 0 25)(266 3 0 0 26)(267 3 0 0 27)(268 3 0 0 28)(269 3 0 0 29)(270 3 0 0 30)(271 3 0 0 31)(272 3 0 0 32)(273 3 0 0 33)(274 3 0 0 34)(275 3 0 0 35)(276 3 0 0 36)(277 3 0 0 37)(278 3 0 0 38)(279 3 0 0 39)(280 3 0 0 40)(281 3 0 0 41)(282 3 0 0 42)(283 3 0 0 43)(284 3 0 0 44)(285 3 0 0 45)(286 3 0 0 46)(287 3 0 0 47)(288 2 0 0 48)(289 2 0 0 49)(290 2 0 0 50)(291 2 0 0 51)(292 2 0 0 52)(293 2 0 0 53)(294 2 0 0 54)(295 2 0 0 55)(296 2 0 0 56)(297 2 0 0 57)(298 2 0 0 58)(299 2 0 0 59)(300 2 0 0 60)(301 2 0 0 61)(302 2 0 0 62)(303 2 0 0 63)(304 2 0 0 64)(305 2 0 0 65)(306 2 0 0 66)(307 2 0 0 67)(308 2 0 0 68)(309 2 0 0 69)(310 2 0 0 70)(311 2 0 0 71)(312 2 0 0 72)(313 2 0 0 73)(314 2 0 0 74)(315 2 0 0 75)(316 2 0 0 76)(317 2 0 0 77)(318 2 0 0 78)(319 2 0 0 79)(320 2 0 0 80)(321 2 0 0 81)(322 2 0 0 82)(323 2 0 0 83)(324 2 0 0 84)(325 2 0 0 85)(326 2 0 0 86)(327 2 0 0 87)(328 2 0 0 88)(329 2 0 0 89)(330 2 0 0 90)(331 2 0 0 91)(332 2 0 0 92)(333 2 0 0 93)(334 2 0 0 94)(335 2 0 0 95)(336 3 0 0 48)(337 3 0 0 49)(338 3 0 0 50)(339 3 0 0 51)(340 3 0 0 52)(341 3 0 0 53)(342 3 0 0 54)(343 3 0 0 55)(344 3 0 0 56)(345 3 0 0 57)(346 3 0 0 58)(347 3 0 0 59)(348 3 0 0 60)(349 3 0 0 61)(350 3 0 0 62)(351 3 0 0 63)(352 3 0 0 64)(353 3 0 0 65)(354 3 0 0 66)(355 3 0 0 67)(356 3 0 0 68)(357 3 0 0 69)(358 3 0 0 70)(359 3 0 0 71)(360 3 0 0 72)(361 3 0 0 73)(362 3 0 0 74)(363 3 0 0 75)(364 3 0 0 76)(365 3 0 0 77)(366 3 0 0 78)(367 3 0 0 79)(368 3 0 0 80)(369 3 0 0 81)(370 3 0 0 82)(371 3 0 0 83)(372 3 0 0 84)(373 3 0 0 85)(374 3 0 0 86)(375 3 0 0 87)(376 3 0 0 88)(377 3 0 0 89)(378 3 0 0 90)(379 3 0 0 91)(380 3 0 0 92)(381 3 0 0 93)(382 3 0 0 94)(383 3 0 0 95) +snsChanMap=(384,0,1)(AP0;0:0)(AP1;1:1)(AP2;2:2)(AP3;3:3)(AP4;4:4)(AP5;5:5)(AP6;6:6)(AP7;7:7)(AP8;8:8)(AP9;9:9)(AP10;10:10)(AP11;11:11)(AP12;12:12)(AP13;13:13)(AP14;14:14)(AP15;15:15)(AP16;16:16)(AP17;17:17)(AP18;18:18)(AP19;19:19)(AP20;20:20)(AP21;21:21)(AP22;22:22)(AP23;23:23)(AP24;24:24)(AP25;25:25)(AP26;26:26)(AP27;27:27)(AP28;28:28)(AP29;29:29)(AP30;30:30)(AP31;31:31)(AP32;32:32)(AP33;33:33)(AP34;34:34)(AP35;35:35)(AP36;36:36)(AP37;37:37)(AP38;38:38)(AP39;39:39)(AP40;40:40)(AP41;41:41)(AP42;42:42)(AP43;43:43)(AP44;44:44)(AP45;45:45)(AP46;46:46)(AP47;47:47)(AP48;48:96)(AP49;49:97)(AP50;50:98)(AP51;51:99)(AP52;52:100)(AP53;53:101)(AP54;54:102)(AP55;55:103)(AP56;56:104)(AP57;57:105)(AP58;58:106)(AP59;59:107)(AP60;60:108)(AP61;61:109)(AP62;62:110)(AP63;63:111)(AP64;64:112)(AP65;65:113)(AP66;66:114)(AP67;67:115)(AP68;68:116)(AP69;69:117)(AP70;70:118)(AP71;71:119)(AP72;72:120)(AP73;73:121)(AP74;74:122)(AP75;75:123)(AP76;76:124)(AP77;77:125)(AP78;78:126)(AP79;79:127)(AP80;80:128)(AP81;81:129)(AP82;82:130)(AP83;83:131)(AP84;84:132)(AP85;85:133)(AP86;86:134)(AP87;87:135)(AP88;88:136)(AP89;89:137)(AP90;90:138)(AP91;91:139)(AP92;92:140)(AP93;93:141)(AP94;94:142)(AP95;95:143)(AP96;96:48)(AP97;97:49)(AP98;98:50)(AP99;99:51)(AP100;100:52)(AP101;101:53)(AP102;102:54)(AP103;103:55)(AP104;104:56)(AP105;105:57)(AP106;106:58)(AP107;107:59)(AP108;108:60)(AP109;109:61)(AP110;110:62)(AP111;111:63)(AP112;112:64)(AP113;113:65)(AP114;114:66)(AP115;115:67)(AP116;116:68)(AP117;117:69)(AP118;118:70)(AP119;119:71)(AP120;120:72)(AP121;121:73)(AP122;122:74)(AP123;123:75)(AP124;124:76)(AP125;125:77)(AP126;126:78)(AP127;127:79)(AP128;128:80)(AP129;129:81)(AP130;130:82)(AP131;131:83)(AP132;132:84)(AP133;133:85)(AP134;134:86)(AP135;135:87)(AP136;136:88)(AP137;137:89)(AP138;138:90)(AP139;139:91)(AP140;140:92)(AP141;141:93)(AP142;142:94)(AP143;143:95)(AP144;144:144)(AP145;145:145)(AP146;146:146)(AP147;147:147)(AP148;148:148)(AP149;149:149)(AP150;150:150)(AP151;151:151)(AP152;152:152)(AP153;153:153)(AP154;154:154)(AP155;155:155)(AP156;156:156)(AP157;157:157)(AP158;158:158)(AP159;159:159)(AP160;160:160)(AP161;161:161)(AP162;162:162)(AP163;163:163)(AP164;164:164)(AP165;165:165)(AP166;166:166)(AP167;167:167)(AP168;168:168)(AP169;169:169)(AP170;170:170)(AP171;171:171)(AP172;172:172)(AP173;173:173)(AP174;174:174)(AP175;175:175)(AP176;176:176)(AP177;177:177)(AP178;178:178)(AP179;179:179)(AP180;180:180)(AP181;181:181)(AP182;182:182)(AP183;183:183)(AP184;184:184)(AP185;185:185)(AP186;186:186)(AP187;187:187)(AP188;188:188)(AP189;189:189)(AP190;190:190)(AP191;191:191)(AP192;192:192)(AP193;193:193)(AP194;194:194)(AP195;195:195)(AP196;196:196)(AP197;197:197)(AP198;198:198)(AP199;199:199)(AP200;200:200)(AP201;201:201)(AP202;202:202)(AP203;203:203)(AP204;204:204)(AP205;205:205)(AP206;206:206)(AP207;207:207)(AP208;208:208)(AP209;209:209)(AP210;210:210)(AP211;211:211)(AP212;212:212)(AP213;213:213)(AP214;214:214)(AP215;215:215)(AP216;216:216)(AP217;217:217)(AP218;218:218)(AP219;219:219)(AP220;220:220)(AP221;221:221)(AP222;222:222)(AP223;223:223)(AP224;224:224)(AP225;225:225)(AP226;226:226)(AP227;227:227)(AP228;228:228)(AP229;229:229)(AP230;230:230)(AP231;231:231)(AP232;232:232)(AP233;233:233)(AP234;234:234)(AP235;235:235)(AP236;236:236)(AP237;237:237)(AP238;238:238)(AP239;239:239)(AP240;240:288)(AP241;241:289)(AP242;242:290)(AP243;243:291)(AP244;244:292)(AP245;245:293)(AP246;246:294)(AP247;247:295)(AP248;248:296)(AP249;249:297)(AP250;250:298)(AP251;251:299)(AP252;252:300)(AP253;253:301)(AP254;254:302)(AP255;255:303)(AP256;256:304)(AP257;257:305)(AP258;258:306)(AP259;259:307)(AP260;260:308)(AP261;261:309)(AP262;262:310)(AP263;263:311)(AP264;264:312)(AP265;265:313)(AP266;266:314)(AP267;267:315)(AP268;268:316)(AP269;269:317)(AP270;270:318)(AP271;271:319)(AP272;272:320)(AP273;273:321)(AP274;274:322)(AP275;275:323)(AP276;276:324)(AP277;277:325)(AP278;278:326)(AP279;279:327)(AP280;280:328)(AP281;281:329)(AP282;282:330)(AP283;283:331)(AP284;284:332)(AP285;285:333)(AP286;286:334)(AP287;287:335)(AP288;288:240)(AP289;289:241)(AP290;290:242)(AP291;291:243)(AP292;292:244)(AP293;293:245)(AP294;294:246)(AP295;295:247)(AP296;296:248)(AP297;297:249)(AP298;298:250)(AP299;299:251)(AP300;300:252)(AP301;301:253)(AP302;302:254)(AP303;303:255)(AP304;304:256)(AP305;305:257)(AP306;306:258)(AP307;307:259)(AP308;308:260)(AP309;309:261)(AP310;310:262)(AP311;311:263)(AP312;312:264)(AP313;313:265)(AP314;314:266)(AP315;315:267)(AP316;316:268)(AP317;317:269)(AP318;318:270)(AP319;319:271)(AP320;320:272)(AP321;321:273)(AP322;322:274)(AP323;323:275)(AP324;324:276)(AP325;325:277)(AP326;326:278)(AP327;327:279)(AP328;328:280)(AP329;329:281)(AP330;330:282)(AP331;331:283)(AP332;332:284)(AP333;333:285)(AP334;334:286)(AP335;335:287)(AP336;336:336)(AP337;337:337)(AP338;338:338)(AP339;339:339)(AP340;340:340)(AP341;341:341)(AP342;342:342)(AP343;343:343)(AP344;344:344)(AP345;345:345)(AP346;346:346)(AP347;347:347)(AP348;348:348)(AP349;349:349)(AP350;350:350)(AP351;351:351)(AP352;352:352)(AP353;353:353)(AP354;354:354)(AP355;355:355)(AP356;356:356)(AP357;357:357)(AP358;358:358)(AP359;359:359)(AP360;360:360)(AP361;361:361)(AP362;362:362)(AP363;363:363)(AP364;364:364)(AP365;365:365)(AP366;366:366)(AP367;367:367)(AP368;368:368)(AP369;369:369)(AP370;370:370)(AP371;371:371)(AP372;372:372)(AP373;373:373)(AP374;374:374)(AP375;375:375)(AP376;376:376)(AP377;377:377)(AP378;378:378)(AP379;379:379)(AP380;380:380)(AP381;381:381)(AP382;382:382)(AP383;383:383)(SY0;384:384) +snsShankMap=(4,2,640)(0:0:0:1)(0:1:0:1)(0:0:1:1)(0:1:1:1)(0:0:2:1)(0:1:2:1)(0:0:3:1)(0:1:3:1)(0:0:4:1)(0:1:4:1)(0:0:5:1)(0:1:5:1)(0:0:6:1)(0:1:6:1)(0:0:7:1)(0:1:7:1)(0:0:8:1)(0:1:8:1)(0:0:9:1)(0:1:9:1)(0:0:10:1)(0:1:10:1)(0:0:11:1)(0:1:11:1)(0:0:12:1)(0:1:12:1)(0:0:13:1)(0:1:13:1)(0:0:14:1)(0:1:14:1)(0:0:15:1)(0:1:15:1)(0:0:16:1)(0:1:16:1)(0:0:17:1)(0:1:17:1)(0:0:18:1)(0:1:18:1)(0:0:19:1)(0:1:19:1)(0:0:20:1)(0:1:20:1)(0:0:21:1)(0:1:21:1)(0:0:22:1)(0:1:22:1)(0:0:23:1)(0:1:23:1)(1:0:0:1)(1:1:0:1)(1:0:1:1)(1:1:1:1)(1:0:2:1)(1:1:2:1)(1:0:3:1)(1:1:3:1)(1:0:4:1)(1:1:4:1)(1:0:5:1)(1:1:5:1)(1:0:6:1)(1:1:6:1)(1:0:7:1)(1:1:7:1)(1:0:8:1)(1:1:8:1)(1:0:9:1)(1:1:9:1)(1:0:10:1)(1:1:10:1)(1:0:11:1)(1:1:11:1)(1:0:12:1)(1:1:12:1)(1:0:13:1)(1:1:13:1)(1:0:14:1)(1:1:14:1)(1:0:15:1)(1:1:15:1)(1:0:16:1)(1:1:16:1)(1:0:17:1)(1:1:17:1)(1:0:18:1)(1:1:18:1)(1:0:19:1)(1:1:19:1)(1:0:20:1)(1:1:20:1)(1:0:21:1)(1:1:21:1)(1:0:22:1)(1:1:22:1)(1:0:23:1)(1:1:23:1)(0:0:24:1)(0:1:24:1)(0:0:25:1)(0:1:25:1)(0:0:26:1)(0:1:26:1)(0:0:27:1)(0:1:27:1)(0:0:28:1)(0:1:28:1)(0:0:29:1)(0:1:29:1)(0:0:30:1)(0:1:30:1)(0:0:31:1)(0:1:31:1)(0:0:32:1)(0:1:32:1)(0:0:33:1)(0:1:33:1)(0:0:34:1)(0:1:34:1)(0:0:35:1)(0:1:35:1)(0:0:36:1)(0:1:36:1)(0:0:37:1)(0:1:37:1)(0:0:38:1)(0:1:38:1)(0:0:39:1)(0:1:39:0)(0:0:40:1)(0:1:40:1)(0:0:41:1)(0:1:41:1)(0:0:42:1)(0:1:42:1)(0:0:43:1)(0:1:43:1)(0:0:44:1)(0:1:44:1)(0:0:45:1)(0:1:45:1)(0:0:46:1)(0:1:46:1)(0:0:47:1)(0:1:47:1)(1:0:24:1)(1:1:24:1)(1:0:25:1)(1:1:25:1)(1:0:26:1)(1:1:26:1)(1:0:27:1)(1:1:27:1)(1:0:28:1)(1:1:28:1)(1:0:29:1)(1:1:29:1)(1:0:30:1)(1:1:30:1)(1:0:31:1)(1:1:31:1)(1:0:32:1)(1:1:32:1)(1:0:33:1)(1:1:33:1)(1:0:34:1)(1:1:34:1)(1:0:35:1)(1:1:35:1)(1:0:36:1)(1:1:36:1)(1:0:37:1)(1:1:37:1)(1:0:38:1)(1:1:38:1)(1:0:39:1)(1:1:39:1)(1:0:40:1)(1:1:40:1)(1:0:41:1)(1:1:41:1)(1:0:42:1)(1:1:42:1)(1:0:43:1)(1:1:43:1)(1:0:44:1)(1:1:44:1)(1:0:45:1)(1:1:45:1)(1:0:46:1)(1:1:46:1)(1:0:47:1)(1:1:47:1)(2:0:0:1)(2:1:0:1)(2:0:1:1)(2:1:1:1)(2:0:2:1)(2:1:2:1)(2:0:3:1)(2:1:3:1)(2:0:4:1)(2:1:4:1)(2:0:5:1)(2:1:5:1)(2:0:6:1)(2:1:6:1)(2:0:7:1)(2:1:7:1)(2:0:8:1)(2:1:8:1)(2:0:9:1)(2:1:9:1)(2:0:10:1)(2:1:10:1)(2:0:11:1)(2:1:11:1)(2:0:12:1)(2:1:12:1)(2:0:13:1)(2:1:13:1)(2:0:14:1)(2:1:14:1)(2:0:15:1)(2:1:15:1)(2:0:16:1)(2:1:16:1)(2:0:17:1)(2:1:17:1)(2:0:18:1)(2:1:18:1)(2:0:19:1)(2:1:19:1)(2:0:20:1)(2:1:20:1)(2:0:21:1)(2:1:21:1)(2:0:22:1)(2:1:22:1)(2:0:23:1)(2:1:23:1)(3:0:0:1)(3:1:0:1)(3:0:1:1)(3:1:1:1)(3:0:2:1)(3:1:2:1)(3:0:3:1)(3:1:3:1)(3:0:4:1)(3:1:4:1)(3:0:5:1)(3:1:5:1)(3:0:6:1)(3:1:6:1)(3:0:7:1)(3:1:7:1)(3:0:8:1)(3:1:8:1)(3:0:9:1)(3:1:9:1)(3:0:10:1)(3:1:10:1)(3:0:11:1)(3:1:11:1)(3:0:12:1)(3:1:12:1)(3:0:13:1)(3:1:13:1)(3:0:14:1)(3:1:14:1)(3:0:15:1)(3:1:15:1)(3:0:16:1)(3:1:16:1)(3:0:17:1)(3:1:17:1)(3:0:18:1)(3:1:18:1)(3:0:19:1)(3:1:19:1)(3:0:20:1)(3:1:20:1)(3:0:21:1)(3:1:21:1)(3:0:22:1)(3:1:22:1)(3:0:23:1)(3:1:23:1)(2:0:24:1)(2:1:24:1)(2:0:25:1)(2:1:25:1)(2:0:26:1)(2:1:26:1)(2:0:27:1)(2:1:27:1)(2:0:28:1)(2:1:28:1)(2:0:29:1)(2:1:29:1)(2:0:30:1)(2:1:30:1)(2:0:31:1)(2:1:31:1)(2:0:32:1)(2:1:32:1)(2:0:33:1)(2:1:33:1)(2:0:34:1)(2:1:34:1)(2:0:35:1)(2:1:35:1)(2:0:36:1)(2:1:36:1)(2:0:37:1)(2:1:37:1)(2:0:38:1)(2:1:38:1)(2:0:39:1)(2:1:39:1)(2:0:40:1)(2:1:40:1)(2:0:41:1)(2:1:41:1)(2:0:42:1)(2:1:42:1)(2:0:43:1)(2:1:43:1)(2:0:44:1)(2:1:44:1)(2:0:45:1)(2:1:45:1)(2:0:46:1)(2:1:46:1)(2:0:47:1)(2:1:47:1)(3:0:24:1)(3:1:24:1)(3:0:25:1)(3:1:25:1)(3:0:26:1)(3:1:26:1)(3:0:27:1)(3:1:27:1)(3:0:28:1)(3:1:28:1)(3:0:29:1)(3:1:29:1)(3:0:30:1)(3:1:30:1)(3:0:31:1)(3:1:31:1)(3:0:32:1)(3:1:32:1)(3:0:33:1)(3:1:33:1)(3:0:34:1)(3:1:34:1)(3:0:35:1)(3:1:35:1)(3:0:36:1)(3:1:36:1)(3:0:37:1)(3:1:37:1)(3:0:38:1)(3:1:38:1)(3:0:39:1)(3:1:39:1)(3:0:40:1)(3:1:40:1)(3:0:41:1)(3:1:41:1)(3:0:42:1)(3:1:42:1)(3:0:43:1)(3:1:43:1)(3:0:44:1)(3:1:44:1)(3:0:45:1)(3:1:45:1)(3:0:46:1)(3:1:46:1)(3:0:47:1)(3:1:47:1) \ No newline at end of file diff --git a/src/tests/fixtures/np2split/_spikeglx_ephysData_g0_t0.imec0.ap.ch b/src/tests/fixtures/np2split/_spikeglx_ephysData_g0_t0.imec0.ap.ch new file mode 100755 index 0000000..5b4b6f9 --- /dev/null +++ b/src/tests/fixtures/np2split/_spikeglx_ephysData_g0_t0.imec0.ap.ch @@ -0,0 +1,25 @@ +{ + "algorithm": "zlib", + "chunk_bounds": [ + 0, + 30000 + ], + "chunk_offsets": [ + 0, + 12028183 + ], + "chunk_order": "F", + "comp_level": -1, + "do_spatial_diff": false, + "do_time_diff": true, + "dtype": "int16", + "n_channels": 385, + "sample_rate": 30000.0, + "sha1_compressed": "540275f883f4a3811b438fdebf27046888e539af", + "sha1_uncompressed": "936aa3604c41a1527aace766a6f0b85fb8e3b734", + "shape": [ + 30000, + 385 + ], + "version": "1.0" +} \ No newline at end of file diff --git a/src/tests/fixtures/np2split/_spikeglx_ephysData_g0_t0.imec0.ap.meta b/src/tests/fixtures/np2split/_spikeglx_ephysData_g0_t0.imec0.ap.meta new file mode 100755 index 0000000..4825b84 --- /dev/null +++ b/src/tests/fixtures/np2split/_spikeglx_ephysData_g0_t0.imec0.ap.meta @@ -0,0 +1,51 @@ +acqApLfSy=384,0,1 +appVersion=20201103 +fileCreateTime=2021-08-02T14:30:26 +fileName=D:/iblrig_data/Subjects/KS059/2021-08-02/001/_spikeglx_ephysData_g0/_spikeglx_ephysData_g0_imec0/_spikeglx_ephysData_g0_t0.imec0.ap.bin +fileSHA1=C040C224559DD5FAB71AC1A1542049BA9D68A77E +fileSizeBytes=23100000 +fileTimeSecs=1 +firstSample=110884048 +gateMode=Immediate +imAiRangeMax=0.5 +imAiRangeMin=-0.5 +imCalibrated=true +imDatApi=3.31 +imDatBs_fw=2.0.137 +imDatBsc_fw=3.2.176 +imDatBsc_hw=1.9 +imDatBsc_pn=NP2_QBSC_00 +imDatBsc_sn=118 +imDatFx_hw=1.8 +imDatFx_pn=NPM_FLEX_0 +imDatHs_fw=1 +imDatHs_pn=NPM_HS_01 +imDatHs_sn=0 +imDatPrb_dock=1 +imDatPrb_pn=NP2010 +imDatPrb_port=1 +imDatPrb_slot=2 +imDatPrb_sn=19011110513 +imDatPrb_type=24 +imLEDEnable=false +imMaxInt=8192 +imRoFile=C:/SpikeGLX/Release_v20201103-phase30/IMRO_Tables/NPtype24_hStripe_botRow0_ref0.imro +imSampRate=29999.757983 +imStdby= +imTrgRising=true +imTrgSource=0 +nDataDirs=1 +nSavedChans=385 +snsApLfSy=384,0,1 +snsSaveChanSubset=0:384 +syncImInputSlot=2 +syncSourceIdx=3 +syncSourcePeriod=1 +trigMode=Immediate +typeImEnabled=3 +typeNiEnabled=1 +typeThis=imec +userNotes= +imroTbl=(24,384)(0 0 0 0 0)(1 0 0 0 1)(2 0 0 0 2)(3 0 0 0 3)(4 0 0 0 4)(5 0 0 0 5)(6 0 0 0 6)(7 0 0 0 7)(8 0 0 0 8)(9 0 0 0 9)(10 0 0 0 10)(11 0 0 0 11)(12 0 0 0 12)(13 0 0 0 13)(14 0 0 0 14)(15 0 0 0 15)(16 0 0 0 16)(17 0 0 0 17)(18 0 0 0 18)(19 0 0 0 19)(20 0 0 0 20)(21 0 0 0 21)(22 0 0 0 22)(23 0 0 0 23)(24 0 0 0 24)(25 0 0 0 25)(26 0 0 0 26)(27 0 0 0 27)(28 0 0 0 28)(29 0 0 0 29)(30 0 0 0 30)(31 0 0 0 31)(32 0 0 0 32)(33 0 0 0 33)(34 0 0 0 34)(35 0 0 0 35)(36 0 0 0 36)(37 0 0 0 37)(38 0 0 0 38)(39 0 0 0 39)(40 0 0 0 40)(41 0 0 0 41)(42 0 0 0 42)(43 0 0 0 43)(44 0 0 0 44)(45 0 0 0 45)(46 0 0 0 46)(47 0 0 0 47)(48 1 0 0 0)(49 1 0 0 1)(50 1 0 0 2)(51 1 0 0 3)(52 1 0 0 4)(53 1 0 0 5)(54 1 0 0 6)(55 1 0 0 7)(56 1 0 0 8)(57 1 0 0 9)(58 1 0 0 10)(59 1 0 0 11)(60 1 0 0 12)(61 1 0 0 13)(62 1 0 0 14)(63 1 0 0 15)(64 1 0 0 16)(65 1 0 0 17)(66 1 0 0 18)(67 1 0 0 19)(68 1 0 0 20)(69 1 0 0 21)(70 1 0 0 22)(71 1 0 0 23)(72 1 0 0 24)(73 1 0 0 25)(74 1 0 0 26)(75 1 0 0 27)(76 1 0 0 28)(77 1 0 0 29)(78 1 0 0 30)(79 1 0 0 31)(80 1 0 0 32)(81 1 0 0 33)(82 1 0 0 34)(83 1 0 0 35)(84 1 0 0 36)(85 1 0 0 37)(86 1 0 0 38)(87 1 0 0 39)(88 1 0 0 40)(89 1 0 0 41)(90 1 0 0 42)(91 1 0 0 43)(92 1 0 0 44)(93 1 0 0 45)(94 1 0 0 46)(95 1 0 0 47)(96 0 0 0 48)(97 0 0 0 49)(98 0 0 0 50)(99 0 0 0 51)(100 0 0 0 52)(101 0 0 0 53)(102 0 0 0 54)(103 0 0 0 55)(104 0 0 0 56)(105 0 0 0 57)(106 0 0 0 58)(107 0 0 0 59)(108 0 0 0 60)(109 0 0 0 61)(110 0 0 0 62)(111 0 0 0 63)(112 0 0 0 64)(113 0 0 0 65)(114 0 0 0 66)(115 0 0 0 67)(116 0 0 0 68)(117 0 0 0 69)(118 0 0 0 70)(119 0 0 0 71)(120 0 0 0 72)(121 0 0 0 73)(122 0 0 0 74)(123 0 0 0 75)(124 0 0 0 76)(125 0 0 0 77)(126 0 0 0 78)(127 0 0 0 79)(128 0 0 0 80)(129 0 0 0 81)(130 0 0 0 82)(131 0 0 0 83)(132 0 0 0 84)(133 0 0 0 85)(134 0 0 0 86)(135 0 0 0 87)(136 0 0 0 88)(137 0 0 0 89)(138 0 0 0 90)(139 0 0 0 91)(140 0 0 0 92)(141 0 0 0 93)(142 0 0 0 94)(143 0 0 0 95)(144 1 0 0 48)(145 1 0 0 49)(146 1 0 0 50)(147 1 0 0 51)(148 1 0 0 52)(149 1 0 0 53)(150 1 0 0 54)(151 1 0 0 55)(152 1 0 0 56)(153 1 0 0 57)(154 1 0 0 58)(155 1 0 0 59)(156 1 0 0 60)(157 1 0 0 61)(158 1 0 0 62)(159 1 0 0 63)(160 1 0 0 64)(161 1 0 0 65)(162 1 0 0 66)(163 1 0 0 67)(164 1 0 0 68)(165 1 0 0 69)(166 1 0 0 70)(167 1 0 0 71)(168 1 0 0 72)(169 1 0 0 73)(170 1 0 0 74)(171 1 0 0 75)(172 1 0 0 76)(173 1 0 0 77)(174 1 0 0 78)(175 1 0 0 79)(176 1 0 0 80)(177 1 0 0 81)(178 1 0 0 82)(179 1 0 0 83)(180 1 0 0 84)(181 1 0 0 85)(182 1 0 0 86)(183 1 0 0 87)(184 1 0 0 88)(185 1 0 0 89)(186 1 0 0 90)(187 1 0 0 91)(188 1 0 0 92)(189 1 0 0 93)(190 1 0 0 94)(191 1 0 0 95)(192 2 0 0 0)(193 2 0 0 1)(194 2 0 0 2)(195 2 0 0 3)(196 2 0 0 4)(197 2 0 0 5)(198 2 0 0 6)(199 2 0 0 7)(200 2 0 0 8)(201 2 0 0 9)(202 2 0 0 10)(203 2 0 0 11)(204 2 0 0 12)(205 2 0 0 13)(206 2 0 0 14)(207 2 0 0 15)(208 2 0 0 16)(209 2 0 0 17)(210 2 0 0 18)(211 2 0 0 19)(212 2 0 0 20)(213 2 0 0 21)(214 2 0 0 22)(215 2 0 0 23)(216 2 0 0 24)(217 2 0 0 25)(218 2 0 0 26)(219 2 0 0 27)(220 2 0 0 28)(221 2 0 0 29)(222 2 0 0 30)(223 2 0 0 31)(224 2 0 0 32)(225 2 0 0 33)(226 2 0 0 34)(227 2 0 0 35)(228 2 0 0 36)(229 2 0 0 37)(230 2 0 0 38)(231 2 0 0 39)(232 2 0 0 40)(233 2 0 0 41)(234 2 0 0 42)(235 2 0 0 43)(236 2 0 0 44)(237 2 0 0 45)(238 2 0 0 46)(239 2 0 0 47)(240 3 0 0 0)(241 3 0 0 1)(242 3 0 0 2)(243 3 0 0 3)(244 3 0 0 4)(245 3 0 0 5)(246 3 0 0 6)(247 3 0 0 7)(248 3 0 0 8)(249 3 0 0 9)(250 3 0 0 10)(251 3 0 0 11)(252 3 0 0 12)(253 3 0 0 13)(254 3 0 0 14)(255 3 0 0 15)(256 3 0 0 16)(257 3 0 0 17)(258 3 0 0 18)(259 3 0 0 19)(260 3 0 0 20)(261 3 0 0 21)(262 3 0 0 22)(263 3 0 0 23)(264 3 0 0 24)(265 3 0 0 25)(266 3 0 0 26)(267 3 0 0 27)(268 3 0 0 28)(269 3 0 0 29)(270 3 0 0 30)(271 3 0 0 31)(272 3 0 0 32)(273 3 0 0 33)(274 3 0 0 34)(275 3 0 0 35)(276 3 0 0 36)(277 3 0 0 37)(278 3 0 0 38)(279 3 0 0 39)(280 3 0 0 40)(281 3 0 0 41)(282 3 0 0 42)(283 3 0 0 43)(284 3 0 0 44)(285 3 0 0 45)(286 3 0 0 46)(287 3 0 0 47)(288 2 0 0 48)(289 2 0 0 49)(290 2 0 0 50)(291 2 0 0 51)(292 2 0 0 52)(293 2 0 0 53)(294 2 0 0 54)(295 2 0 0 55)(296 2 0 0 56)(297 2 0 0 57)(298 2 0 0 58)(299 2 0 0 59)(300 2 0 0 60)(301 2 0 0 61)(302 2 0 0 62)(303 2 0 0 63)(304 2 0 0 64)(305 2 0 0 65)(306 2 0 0 66)(307 2 0 0 67)(308 2 0 0 68)(309 2 0 0 69)(310 2 0 0 70)(311 2 0 0 71)(312 2 0 0 72)(313 2 0 0 73)(314 2 0 0 74)(315 2 0 0 75)(316 2 0 0 76)(317 2 0 0 77)(318 2 0 0 78)(319 2 0 0 79)(320 2 0 0 80)(321 2 0 0 81)(322 2 0 0 82)(323 2 0 0 83)(324 2 0 0 84)(325 2 0 0 85)(326 2 0 0 86)(327 2 0 0 87)(328 2 0 0 88)(329 2 0 0 89)(330 2 0 0 90)(331 2 0 0 91)(332 2 0 0 92)(333 2 0 0 93)(334 2 0 0 94)(335 2 0 0 95)(336 3 0 0 48)(337 3 0 0 49)(338 3 0 0 50)(339 3 0 0 51)(340 3 0 0 52)(341 3 0 0 53)(342 3 0 0 54)(343 3 0 0 55)(344 3 0 0 56)(345 3 0 0 57)(346 3 0 0 58)(347 3 0 0 59)(348 3 0 0 60)(349 3 0 0 61)(350 3 0 0 62)(351 3 0 0 63)(352 3 0 0 64)(353 3 0 0 65)(354 3 0 0 66)(355 3 0 0 67)(356 3 0 0 68)(357 3 0 0 69)(358 3 0 0 70)(359 3 0 0 71)(360 3 0 0 72)(361 3 0 0 73)(362 3 0 0 74)(363 3 0 0 75)(364 3 0 0 76)(365 3 0 0 77)(366 3 0 0 78)(367 3 0 0 79)(368 3 0 0 80)(369 3 0 0 81)(370 3 0 0 82)(371 3 0 0 83)(372 3 0 0 84)(373 3 0 0 85)(374 3 0 0 86)(375 3 0 0 87)(376 3 0 0 88)(377 3 0 0 89)(378 3 0 0 90)(379 3 0 0 91)(380 3 0 0 92)(381 3 0 0 93)(382 3 0 0 94)(383 3 0 0 95) +snsChanMap=(384,0,1)(AP0;0:0)(AP1;1:1)(AP2;2:2)(AP3;3:3)(AP4;4:4)(AP5;5:5)(AP6;6:6)(AP7;7:7)(AP8;8:8)(AP9;9:9)(AP10;10:10)(AP11;11:11)(AP12;12:12)(AP13;13:13)(AP14;14:14)(AP15;15:15)(AP16;16:16)(AP17;17:17)(AP18;18:18)(AP19;19:19)(AP20;20:20)(AP21;21:21)(AP22;22:22)(AP23;23:23)(AP24;24:24)(AP25;25:25)(AP26;26:26)(AP27;27:27)(AP28;28:28)(AP29;29:29)(AP30;30:30)(AP31;31:31)(AP32;32:32)(AP33;33:33)(AP34;34:34)(AP35;35:35)(AP36;36:36)(AP37;37:37)(AP38;38:38)(AP39;39:39)(AP40;40:40)(AP41;41:41)(AP42;42:42)(AP43;43:43)(AP44;44:44)(AP45;45:45)(AP46;46:46)(AP47;47:47)(AP48;48:96)(AP49;49:97)(AP50;50:98)(AP51;51:99)(AP52;52:100)(AP53;53:101)(AP54;54:102)(AP55;55:103)(AP56;56:104)(AP57;57:105)(AP58;58:106)(AP59;59:107)(AP60;60:108)(AP61;61:109)(AP62;62:110)(AP63;63:111)(AP64;64:112)(AP65;65:113)(AP66;66:114)(AP67;67:115)(AP68;68:116)(AP69;69:117)(AP70;70:118)(AP71;71:119)(AP72;72:120)(AP73;73:121)(AP74;74:122)(AP75;75:123)(AP76;76:124)(AP77;77:125)(AP78;78:126)(AP79;79:127)(AP80;80:128)(AP81;81:129)(AP82;82:130)(AP83;83:131)(AP84;84:132)(AP85;85:133)(AP86;86:134)(AP87;87:135)(AP88;88:136)(AP89;89:137)(AP90;90:138)(AP91;91:139)(AP92;92:140)(AP93;93:141)(AP94;94:142)(AP95;95:143)(AP96;96:48)(AP97;97:49)(AP98;98:50)(AP99;99:51)(AP100;100:52)(AP101;101:53)(AP102;102:54)(AP103;103:55)(AP104;104:56)(AP105;105:57)(AP106;106:58)(AP107;107:59)(AP108;108:60)(AP109;109:61)(AP110;110:62)(AP111;111:63)(AP112;112:64)(AP113;113:65)(AP114;114:66)(AP115;115:67)(AP116;116:68)(AP117;117:69)(AP118;118:70)(AP119;119:71)(AP120;120:72)(AP121;121:73)(AP122;122:74)(AP123;123:75)(AP124;124:76)(AP125;125:77)(AP126;126:78)(AP127;127:79)(AP128;128:80)(AP129;129:81)(AP130;130:82)(AP131;131:83)(AP132;132:84)(AP133;133:85)(AP134;134:86)(AP135;135:87)(AP136;136:88)(AP137;137:89)(AP138;138:90)(AP139;139:91)(AP140;140:92)(AP141;141:93)(AP142;142:94)(AP143;143:95)(AP144;144:144)(AP145;145:145)(AP146;146:146)(AP147;147:147)(AP148;148:148)(AP149;149:149)(AP150;150:150)(AP151;151:151)(AP152;152:152)(AP153;153:153)(AP154;154:154)(AP155;155:155)(AP156;156:156)(AP157;157:157)(AP158;158:158)(AP159;159:159)(AP160;160:160)(AP161;161:161)(AP162;162:162)(AP163;163:163)(AP164;164:164)(AP165;165:165)(AP166;166:166)(AP167;167:167)(AP168;168:168)(AP169;169:169)(AP170;170:170)(AP171;171:171)(AP172;172:172)(AP173;173:173)(AP174;174:174)(AP175;175:175)(AP176;176:176)(AP177;177:177)(AP178;178:178)(AP179;179:179)(AP180;180:180)(AP181;181:181)(AP182;182:182)(AP183;183:183)(AP184;184:184)(AP185;185:185)(AP186;186:186)(AP187;187:187)(AP188;188:188)(AP189;189:189)(AP190;190:190)(AP191;191:191)(AP192;192:192)(AP193;193:193)(AP194;194:194)(AP195;195:195)(AP196;196:196)(AP197;197:197)(AP198;198:198)(AP199;199:199)(AP200;200:200)(AP201;201:201)(AP202;202:202)(AP203;203:203)(AP204;204:204)(AP205;205:205)(AP206;206:206)(AP207;207:207)(AP208;208:208)(AP209;209:209)(AP210;210:210)(AP211;211:211)(AP212;212:212)(AP213;213:213)(AP214;214:214)(AP215;215:215)(AP216;216:216)(AP217;217:217)(AP218;218:218)(AP219;219:219)(AP220;220:220)(AP221;221:221)(AP222;222:222)(AP223;223:223)(AP224;224:224)(AP225;225:225)(AP226;226:226)(AP227;227:227)(AP228;228:228)(AP229;229:229)(AP230;230:230)(AP231;231:231)(AP232;232:232)(AP233;233:233)(AP234;234:234)(AP235;235:235)(AP236;236:236)(AP237;237:237)(AP238;238:238)(AP239;239:239)(AP240;240:288)(AP241;241:289)(AP242;242:290)(AP243;243:291)(AP244;244:292)(AP245;245:293)(AP246;246:294)(AP247;247:295)(AP248;248:296)(AP249;249:297)(AP250;250:298)(AP251;251:299)(AP252;252:300)(AP253;253:301)(AP254;254:302)(AP255;255:303)(AP256;256:304)(AP257;257:305)(AP258;258:306)(AP259;259:307)(AP260;260:308)(AP261;261:309)(AP262;262:310)(AP263;263:311)(AP264;264:312)(AP265;265:313)(AP266;266:314)(AP267;267:315)(AP268;268:316)(AP269;269:317)(AP270;270:318)(AP271;271:319)(AP272;272:320)(AP273;273:321)(AP274;274:322)(AP275;275:323)(AP276;276:324)(AP277;277:325)(AP278;278:326)(AP279;279:327)(AP280;280:328)(AP281;281:329)(AP282;282:330)(AP283;283:331)(AP284;284:332)(AP285;285:333)(AP286;286:334)(AP287;287:335)(AP288;288:240)(AP289;289:241)(AP290;290:242)(AP291;291:243)(AP292;292:244)(AP293;293:245)(AP294;294:246)(AP295;295:247)(AP296;296:248)(AP297;297:249)(AP298;298:250)(AP299;299:251)(AP300;300:252)(AP301;301:253)(AP302;302:254)(AP303;303:255)(AP304;304:256)(AP305;305:257)(AP306;306:258)(AP307;307:259)(AP308;308:260)(AP309;309:261)(AP310;310:262)(AP311;311:263)(AP312;312:264)(AP313;313:265)(AP314;314:266)(AP315;315:267)(AP316;316:268)(AP317;317:269)(AP318;318:270)(AP319;319:271)(AP320;320:272)(AP321;321:273)(AP322;322:274)(AP323;323:275)(AP324;324:276)(AP325;325:277)(AP326;326:278)(AP327;327:279)(AP328;328:280)(AP329;329:281)(AP330;330:282)(AP331;331:283)(AP332;332:284)(AP333;333:285)(AP334;334:286)(AP335;335:287)(AP336;336:336)(AP337;337:337)(AP338;338:338)(AP339;339:339)(AP340;340:340)(AP341;341:341)(AP342;342:342)(AP343;343:343)(AP344;344:344)(AP345;345:345)(AP346;346:346)(AP347;347:347)(AP348;348:348)(AP349;349:349)(AP350;350:350)(AP351;351:351)(AP352;352:352)(AP353;353:353)(AP354;354:354)(AP355;355:355)(AP356;356:356)(AP357;357:357)(AP358;358:358)(AP359;359:359)(AP360;360:360)(AP361;361:361)(AP362;362:362)(AP363;363:363)(AP364;364:364)(AP365;365:365)(AP366;366:366)(AP367;367:367)(AP368;368:368)(AP369;369:369)(AP370;370:370)(AP371;371:371)(AP372;372:372)(AP373;373:373)(AP374;374:374)(AP375;375:375)(AP376;376:376)(AP377;377:377)(AP378;378:378)(AP379;379:379)(AP380;380:380)(AP381;381:381)(AP382;382:382)(AP383;383:383)(SY0;384:384) +snsShankMap=(4,2,640)(0:0:0:1)(0:1:0:1)(0:0:1:1)(0:1:1:1)(0:0:2:1)(0:1:2:1)(0:0:3:1)(0:1:3:1)(0:0:4:1)(0:1:4:1)(0:0:5:1)(0:1:5:1)(0:0:6:1)(0:1:6:1)(0:0:7:1)(0:1:7:1)(0:0:8:1)(0:1:8:1)(0:0:9:1)(0:1:9:1)(0:0:10:1)(0:1:10:1)(0:0:11:1)(0:1:11:1)(0:0:12:1)(0:1:12:1)(0:0:13:1)(0:1:13:1)(0:0:14:1)(0:1:14:1)(0:0:15:1)(0:1:15:1)(0:0:16:1)(0:1:16:1)(0:0:17:1)(0:1:17:1)(0:0:18:1)(0:1:18:1)(0:0:19:1)(0:1:19:1)(0:0:20:1)(0:1:20:1)(0:0:21:1)(0:1:21:1)(0:0:22:1)(0:1:22:1)(0:0:23:1)(0:1:23:1)(1:0:0:1)(1:1:0:1)(1:0:1:1)(1:1:1:1)(1:0:2:1)(1:1:2:1)(1:0:3:1)(1:1:3:1)(1:0:4:1)(1:1:4:1)(1:0:5:1)(1:1:5:1)(1:0:6:1)(1:1:6:1)(1:0:7:1)(1:1:7:1)(1:0:8:1)(1:1:8:1)(1:0:9:1)(1:1:9:1)(1:0:10:1)(1:1:10:1)(1:0:11:1)(1:1:11:1)(1:0:12:1)(1:1:12:1)(1:0:13:1)(1:1:13:1)(1:0:14:1)(1:1:14:1)(1:0:15:1)(1:1:15:1)(1:0:16:1)(1:1:16:1)(1:0:17:1)(1:1:17:1)(1:0:18:1)(1:1:18:1)(1:0:19:1)(1:1:19:1)(1:0:20:1)(1:1:20:1)(1:0:21:1)(1:1:21:1)(1:0:22:1)(1:1:22:1)(1:0:23:1)(1:1:23:1)(0:0:24:1)(0:1:24:1)(0:0:25:1)(0:1:25:1)(0:0:26:1)(0:1:26:1)(0:0:27:1)(0:1:27:1)(0:0:28:1)(0:1:28:1)(0:0:29:1)(0:1:29:1)(0:0:30:1)(0:1:30:1)(0:0:31:1)(0:1:31:1)(0:0:32:1)(0:1:32:1)(0:0:33:1)(0:1:33:1)(0:0:34:1)(0:1:34:1)(0:0:35:1)(0:1:35:1)(0:0:36:1)(0:1:36:1)(0:0:37:1)(0:1:37:1)(0:0:38:1)(0:1:38:1)(0:0:39:1)(0:1:39:0)(0:0:40:1)(0:1:40:1)(0:0:41:1)(0:1:41:1)(0:0:42:1)(0:1:42:1)(0:0:43:1)(0:1:43:1)(0:0:44:1)(0:1:44:1)(0:0:45:1)(0:1:45:1)(0:0:46:1)(0:1:46:1)(0:0:47:1)(0:1:47:1)(1:0:24:1)(1:1:24:1)(1:0:25:1)(1:1:25:1)(1:0:26:1)(1:1:26:1)(1:0:27:1)(1:1:27:1)(1:0:28:1)(1:1:28:1)(1:0:29:1)(1:1:29:1)(1:0:30:1)(1:1:30:1)(1:0:31:1)(1:1:31:1)(1:0:32:1)(1:1:32:1)(1:0:33:1)(1:1:33:1)(1:0:34:1)(1:1:34:1)(1:0:35:1)(1:1:35:1)(1:0:36:1)(1:1:36:1)(1:0:37:1)(1:1:37:1)(1:0:38:1)(1:1:38:1)(1:0:39:1)(1:1:39:1)(1:0:40:1)(1:1:40:1)(1:0:41:1)(1:1:41:1)(1:0:42:1)(1:1:42:1)(1:0:43:1)(1:1:43:1)(1:0:44:1)(1:1:44:1)(1:0:45:1)(1:1:45:1)(1:0:46:1)(1:1:46:1)(1:0:47:1)(1:1:47:1)(2:0:0:1)(2:1:0:1)(2:0:1:1)(2:1:1:1)(2:0:2:1)(2:1:2:1)(2:0:3:1)(2:1:3:1)(2:0:4:1)(2:1:4:1)(2:0:5:1)(2:1:5:1)(2:0:6:1)(2:1:6:1)(2:0:7:1)(2:1:7:1)(2:0:8:1)(2:1:8:1)(2:0:9:1)(2:1:9:1)(2:0:10:1)(2:1:10:1)(2:0:11:1)(2:1:11:1)(2:0:12:1)(2:1:12:1)(2:0:13:1)(2:1:13:1)(2:0:14:1)(2:1:14:1)(2:0:15:1)(2:1:15:1)(2:0:16:1)(2:1:16:1)(2:0:17:1)(2:1:17:1)(2:0:18:1)(2:1:18:1)(2:0:19:1)(2:1:19:1)(2:0:20:1)(2:1:20:1)(2:0:21:1)(2:1:21:1)(2:0:22:1)(2:1:22:1)(2:0:23:1)(2:1:23:1)(3:0:0:1)(3:1:0:1)(3:0:1:1)(3:1:1:1)(3:0:2:1)(3:1:2:1)(3:0:3:1)(3:1:3:1)(3:0:4:1)(3:1:4:1)(3:0:5:1)(3:1:5:1)(3:0:6:1)(3:1:6:1)(3:0:7:1)(3:1:7:1)(3:0:8:1)(3:1:8:1)(3:0:9:1)(3:1:9:1)(3:0:10:1)(3:1:10:1)(3:0:11:1)(3:1:11:1)(3:0:12:1)(3:1:12:1)(3:0:13:1)(3:1:13:1)(3:0:14:1)(3:1:14:1)(3:0:15:1)(3:1:15:1)(3:0:16:1)(3:1:16:1)(3:0:17:1)(3:1:17:1)(3:0:18:1)(3:1:18:1)(3:0:19:1)(3:1:19:1)(3:0:20:1)(3:1:20:1)(3:0:21:1)(3:1:21:1)(3:0:22:1)(3:1:22:1)(3:0:23:1)(3:1:23:1)(2:0:24:1)(2:1:24:1)(2:0:25:1)(2:1:25:1)(2:0:26:1)(2:1:26:1)(2:0:27:1)(2:1:27:1)(2:0:28:1)(2:1:28:1)(2:0:29:1)(2:1:29:1)(2:0:30:1)(2:1:30:1)(2:0:31:1)(2:1:31:1)(2:0:32:1)(2:1:32:1)(2:0:33:1)(2:1:33:1)(2:0:34:1)(2:1:34:1)(2:0:35:1)(2:1:35:1)(2:0:36:1)(2:1:36:1)(2:0:37:1)(2:1:37:1)(2:0:38:1)(2:1:38:1)(2:0:39:1)(2:1:39:1)(2:0:40:1)(2:1:40:1)(2:0:41:1)(2:1:41:1)(2:0:42:1)(2:1:42:1)(2:0:43:1)(2:1:43:1)(2:0:44:1)(2:1:44:1)(2:0:45:1)(2:1:45:1)(2:0:46:1)(2:1:46:1)(2:0:47:1)(2:1:47:1)(3:0:24:1)(3:1:24:1)(3:0:25:1)(3:1:25:1)(3:0:26:1)(3:1:26:1)(3:0:27:1)(3:1:27:1)(3:0:28:1)(3:1:28:1)(3:0:29:1)(3:1:29:1)(3:0:30:1)(3:1:30:1)(3:0:31:1)(3:1:31:1)(3:0:32:1)(3:1:32:1)(3:0:33:1)(3:1:33:1)(3:0:34:1)(3:1:34:1)(3:0:35:1)(3:1:35:1)(3:0:36:1)(3:1:36:1)(3:0:37:1)(3:1:37:1)(3:0:38:1)(3:1:38:1)(3:0:39:1)(3:1:39:1)(3:0:40:1)(3:1:40:1)(3:0:41:1)(3:1:41:1)(3:0:42:1)(3:1:42:1)(3:0:43:1)(3:1:43:1)(3:0:44:1)(3:1:44:1)(3:0:45:1)(3:1:45:1)(3:0:46:1)(3:1:46:1)(3:0:47:1)(3:1:47:1) \ No newline at end of file diff --git a/src/tests/unit/cpu/fixtures/sample3A_376_channels.ap.meta b/src/tests/fixtures/sample3A_376_channels.ap.meta similarity index 100% rename from src/tests/unit/cpu/fixtures/sample3A_376_channels.ap.meta rename to src/tests/fixtures/sample3A_376_channels.ap.meta diff --git a/src/tests/unit/cpu/fixtures/sample3A_g0_t0.imec.ap.meta b/src/tests/fixtures/sample3A_g0_t0.imec.ap.meta similarity index 100% rename from src/tests/unit/cpu/fixtures/sample3A_g0_t0.imec.ap.meta rename to src/tests/fixtures/sample3A_g0_t0.imec.ap.meta diff --git a/src/tests/unit/cpu/fixtures/sample3A_g0_t0.imec.lf.meta b/src/tests/fixtures/sample3A_g0_t0.imec.lf.meta similarity index 100% rename from src/tests/unit/cpu/fixtures/sample3A_g0_t0.imec.lf.meta rename to src/tests/fixtures/sample3A_g0_t0.imec.lf.meta diff --git a/src/tests/unit/cpu/fixtures/sample3A_g0_t0.imec.wiring.json b/src/tests/fixtures/sample3A_g0_t0.imec.wiring.json similarity index 100% rename from src/tests/unit/cpu/fixtures/sample3A_g0_t0.imec.wiring.json rename to src/tests/fixtures/sample3A_g0_t0.imec.wiring.json diff --git a/src/tests/unit/cpu/fixtures/sample3A_short_g0_t0.imec.ap.meta b/src/tests/fixtures/sample3A_short_g0_t0.imec.ap.meta similarity index 100% rename from src/tests/unit/cpu/fixtures/sample3A_short_g0_t0.imec.ap.meta rename to src/tests/fixtures/sample3A_short_g0_t0.imec.ap.meta diff --git a/src/tests/unit/cpu/fixtures/sample3B2_exported.imec0.ap.meta b/src/tests/fixtures/sample3B2_exported.imec0.ap.meta similarity index 100% rename from src/tests/unit/cpu/fixtures/sample3B2_exported.imec0.ap.meta rename to src/tests/fixtures/sample3B2_exported.imec0.ap.meta diff --git a/src/tests/unit/cpu/fixtures/sample3B_catgt.ap.meta b/src/tests/fixtures/sample3B_catgt.ap.meta similarity index 100% rename from src/tests/unit/cpu/fixtures/sample3B_catgt.ap.meta rename to src/tests/fixtures/sample3B_catgt.ap.meta diff --git a/src/tests/unit/cpu/fixtures/sample3B_g0_t0.imec1.ap.meta b/src/tests/fixtures/sample3B_g0_t0.imec1.ap.meta similarity index 100% rename from src/tests/unit/cpu/fixtures/sample3B_g0_t0.imec1.ap.meta rename to src/tests/fixtures/sample3B_g0_t0.imec1.ap.meta diff --git a/src/tests/unit/cpu/fixtures/sample3B_g0_t0.imec1.lf.meta b/src/tests/fixtures/sample3B_g0_t0.imec1.lf.meta similarity index 100% rename from src/tests/unit/cpu/fixtures/sample3B_g0_t0.imec1.lf.meta rename to src/tests/fixtures/sample3B_g0_t0.imec1.lf.meta diff --git a/src/tests/unit/cpu/fixtures/sample3B_g0_t0.nidq.meta b/src/tests/fixtures/sample3B_g0_t0.nidq.meta similarity index 100% rename from src/tests/unit/cpu/fixtures/sample3B_g0_t0.nidq.meta rename to src/tests/fixtures/sample3B_g0_t0.nidq.meta diff --git a/src/tests/unit/cpu/fixtures/sample3B_g0_t0.nidq.wiring.json b/src/tests/fixtures/sample3B_g0_t0.nidq.wiring.json similarity index 100% rename from src/tests/unit/cpu/fixtures/sample3B_g0_t0.nidq.wiring.json rename to src/tests/fixtures/sample3B_g0_t0.nidq.wiring.json diff --git a/src/tests/unit/cpu/fixtures/sample3B_version202304.ap.meta b/src/tests/fixtures/sample3B_version202304.ap.meta similarity index 100% rename from src/tests/unit/cpu/fixtures/sample3B_version202304.ap.meta rename to src/tests/fixtures/sample3B_version202304.ap.meta diff --git a/src/tests/unit/cpu/fixtures/sampleNP2.1_g0_t0.imec.ap.meta b/src/tests/fixtures/sampleNP2.1_g0_t0.imec.ap.meta similarity index 100% rename from src/tests/unit/cpu/fixtures/sampleNP2.1_g0_t0.imec.ap.meta rename to src/tests/fixtures/sampleNP2.1_g0_t0.imec.ap.meta diff --git a/src/tests/unit/cpu/fixtures/sampleNP2.1_prototype.ap.meta b/src/tests/fixtures/sampleNP2.1_prototype.ap.meta similarity index 100% rename from src/tests/unit/cpu/fixtures/sampleNP2.1_prototype.ap.meta rename to src/tests/fixtures/sampleNP2.1_prototype.ap.meta diff --git a/src/tests/unit/cpu/fixtures/sampleNP2.4_1shank_g0_t0.imec.ap.meta b/src/tests/fixtures/sampleNP2.4_1shank_g0_t0.imec.ap.meta similarity index 100% rename from src/tests/unit/cpu/fixtures/sampleNP2.4_1shank_g0_t0.imec.ap.meta rename to src/tests/fixtures/sampleNP2.4_1shank_g0_t0.imec.ap.meta diff --git a/src/tests/unit/cpu/fixtures/sampleNP2.4_4shanks_appVersion20230905.ap.meta b/src/tests/fixtures/sampleNP2.4_4shanks_appVersion20230905.ap.meta similarity index 100% rename from src/tests/unit/cpu/fixtures/sampleNP2.4_4shanks_appVersion20230905.ap.meta rename to src/tests/fixtures/sampleNP2.4_4shanks_appVersion20230905.ap.meta diff --git a/src/tests/unit/cpu/fixtures/sampleNP2.4_4shanks_g0_t0.imec.ap.meta b/src/tests/fixtures/sampleNP2.4_4shanks_g0_t0.imec.ap.meta similarity index 100% rename from src/tests/unit/cpu/fixtures/sampleNP2.4_4shanks_g0_t0.imec.ap.meta rename to src/tests/fixtures/sampleNP2.4_4shanks_g0_t0.imec.ap.meta diff --git a/src/tests/unit/cpu/fixtures/sampleNP2.4_4shanks_while_acquiring_incomplete.ap.meta b/src/tests/fixtures/sampleNP2.4_4shanks_while_acquiring_incomplete.ap.meta similarity index 100% rename from src/tests/unit/cpu/fixtures/sampleNP2.4_4shanks_while_acquiring_incomplete.ap.meta rename to src/tests/fixtures/sampleNP2.4_4shanks_while_acquiring_incomplete.ap.meta diff --git a/src/tests/unit/cpu/fixtures/sampleNPultra_g0_t0.imec0.ap.meta b/src/tests/fixtures/sampleNPultra_g0_t0.imec0.ap.meta similarity index 100% rename from src/tests/unit/cpu/fixtures/sampleNPultra_g0_t0.imec0.ap.meta rename to src/tests/fixtures/sampleNPultra_g0_t0.imec0.ap.meta diff --git a/src/tests/unit/cpu/fixtures/waveform_sample/test_arr_in.npy b/src/tests/fixtures/waveform_sample/test_arr_in.npy similarity index 100% rename from src/tests/unit/cpu/fixtures/waveform_sample/test_arr_in.npy rename to src/tests/fixtures/waveform_sample/test_arr_in.npy diff --git a/src/tests/unit/cpu/fixtures/waveform_sample/test_arr_peak.npy b/src/tests/fixtures/waveform_sample/test_arr_peak.npy similarity index 100% rename from src/tests/unit/cpu/fixtures/waveform_sample/test_arr_peak.npy rename to src/tests/fixtures/waveform_sample/test_arr_peak.npy diff --git a/src/tests/unit/cpu/fixtures/waveform_sample/test_df.csv b/src/tests/fixtures/waveform_sample/test_df.csv similarity index 100% rename from src/tests/unit/cpu/fixtures/waveform_sample/test_df.csv rename to src/tests/fixtures/waveform_sample/test_df.csv diff --git a/src/tests/unit/cpu/fixtures/waveform_sample/test_df_wavinfo.csv b/src/tests/fixtures/waveform_sample/test_df_wavinfo.csv similarity index 100% rename from src/tests/unit/cpu/fixtures/waveform_sample/test_df_wavinfo.csv rename to src/tests/fixtures/waveform_sample/test_df_wavinfo.csv diff --git a/src/tests/unit/gpu/__init__.py b/src/tests/integration/__init__.py similarity index 100% rename from src/tests/unit/gpu/__init__.py rename to src/tests/integration/__init__.py diff --git a/src/tests/integration/cpu/csd_experiments.py b/src/tests/integration/csd_experiments.py similarity index 98% rename from src/tests/integration/cpu/csd_experiments.py rename to src/tests/integration/csd_experiments.py index 3ddd432..a79b83a 100644 --- a/src/tests/integration/cpu/csd_experiments.py +++ b/src/tests/integration/csd_experiments.py @@ -6,7 +6,7 @@ from one.api import ONE from brainbox.io.spikeglx import Streamer from brainbox.io.one import SpikeSortingLoader -from ibllib.atlas import BrainRegions +from iblatlas.atlas import BrainRegions from viewephys.gui import viewephys from ibldsp import voltage, fourier diff --git a/src/tests/integration/cpu/test_destripe.py b/src/tests/integration/test_destripe.py similarity index 100% rename from src/tests/integration/cpu/test_destripe.py rename to src/tests/integration/test_destripe.py diff --git a/src/tests/unit/__init__.py b/src/tests/unit/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/tests/unit/gpu/test_filter_gpu.py b/src/tests/unit/gpu/test_filter_gpu.py deleted file mode 100644 index f30b464..0000000 --- a/src/tests/unit/gpu/test_filter_gpu.py +++ /dev/null @@ -1,23 +0,0 @@ -import numpy as np -import cupy as cp -from scipy.signal import butter, sosfiltfilt -import unittest - -from ibldsp.filter_gpu import sosfiltfilt_gpu - - -class TestFilterGpuCpuParity(unittest.TestCase): - def test_parity(self): - GPU_TOL = 1e-3 - BUTTER_KWARGS = {"N": 3, "Wn": 300 / 30000 * 2, "btype": "highpass"} - N_SIGNALS = 300 - N_SAMPLES = 60000 - - sos = butter(**BUTTER_KWARGS, output="sos") - array_cpu = np.cumsum(np.random.randn(N_SIGNALS, N_SAMPLES), axis=1) - array_gpu = cp.array(array_cpu, dtype="float32") - - output_cpu = sosfiltfilt(sos, array_cpu) - output_gpu = sosfiltfilt_gpu(sos, array_gpu) - - assert cp.allclose(output_cpu, output_gpu, atol=GPU_TOL) diff --git a/src/tests/unit/gpu/test_fourier.py b/src/tests/unit/gpu/test_fourier.py deleted file mode 100644 index 1e4565b..0000000 --- a/src/tests/unit/gpu/test_fourier.py +++ /dev/null @@ -1,19 +0,0 @@ -import numpy as np -import cupy as cp -import unittest - -from ibldsp.fourier import fshift, channel_shift - - -class TestFourierAlignmentGpuCpuParity(unittest.TestCase): - def test_parity(self): - N_TIMES = 65600 - N_CHANNELS = 384 - - data = np.random.randn(N_CHANNELS, N_TIMES) * 100 - sample_shifts = np.linspace(0, 0.9, N_CHANNELS) - - data_shifted_cpu = fshift(data, sample_shifts) - data_shifted_gpu = channel_shift(cp.array(data), cp.array(sample_shifts)) - - assert cp.allclose(data_shifted_gpu, data_shifted_cpu, atol=1e-5) diff --git a/src/tests/unit/test_ephys_np2.py b/src/tests/unit/test_ephys_np2.py new file mode 100644 index 0000000..9f27c69 --- /dev/null +++ b/src/tests/unit/test_ephys_np2.py @@ -0,0 +1,351 @@ +import random +import shutil +import unittest +from pathlib import Path + +import numpy as np +from neuropixel import NP2Converter, NP2Reconstructor +import spikeglx + + +class BaseEphysNP2(unittest.TestCase): + data_path = Path(__file__).parents[1].joinpath('fixtures', 'np2split') + + @classmethod + def setUpClass(cls): + dat = np.tile(np.arange(385)[np.newaxis, :] + 10000, [30000, 1]).astype(np.int16) + with open(cls.data_path.joinpath('_spikeglx_ephysData_g0_t0.imec0.ap.bin'), 'bw+') as fid: + dat.tofile(fid) + + @classmethod + def tearDownClass(cls): + cls.data_path.joinpath('_spikeglx_ephysData_g0_t0.imec0.ap.bin').unlink() + + +class TestNeuropixel2ConverterNP24(BaseEphysNP2): + """ + Check NP2 converter with NP2.4 type probes + """ + def setUp(self) -> None: + + file_path = self.data_path.joinpath('_spikeglx_ephysData_g0_t0.imec0.ap.bin') + self.file_path = file_path.parent.parent.joinpath('probe00_temp', file_path.name) + self.file_path.parent.mkdir(exist_ok=True, parents=True) + meta_file = file_path.parent.joinpath('NP24_meta', '_spikeglx_ephysData_g0_t0.imec0.ap.meta') + self.meta_file = self.file_path.parent.joinpath('_spikeglx_ephysData_g0_t0.imec0.ap.meta') + shutil.copy(file_path, self.file_path) + shutil.copy(meta_file, self.meta_file) + self.sglx_instances = [] + + def tearDown(self): + _ = [sglx.close() for sglx in self.sglx_instances] + # here should look for any directories with test in it and delete + test_dir = list(self.file_path.parent.parent.glob('*test*')) + _ = [shutil.rmtree(test) for test in test_dir] + # For case where we have deleted already as part of test + if self.file_path.parent.exists(): + shutil.rmtree(self.file_path.parent) + + def testDecimate(self): + """ + Check integrity of windowing and downsampling by comparing results when using different + window lengths for iterating through data + :return: + """ + + FS = 30000 + np_a = NP2Converter(self.file_path, post_check=False, compress=False) + np_a.init_params(nwindow=0.3 * FS, extra='_0_5s_test', nshank=[0]) + np_a.process() + + np_b = NP2Converter(self.file_path, post_check=False, compress=False) + np_b.init_params(nwindow=0.5 * FS, extra='_1s_test', nshank=[0]) + np_b.process() + + np_c = NP2Converter(self.file_path, post_check=False, compress=False) + np_c.init_params(nwindow=1 * FS, extra='_2s_test', nshank=[0]) + np_c.process() + + sr = spikeglx.Reader(self.file_path, sort=False) + self.sglx_instances.append(sr) + sr_a_ap = spikeglx.Reader(np_a.shank_info['shank0']['ap_file'], sort=False) + self.sglx_instances.append(sr_a_ap) + sr_b_ap = spikeglx.Reader(np_b.shank_info['shank0']['ap_file'], sort=False) + self.sglx_instances.append(sr_b_ap) + sr_c_ap = spikeglx.Reader(np_c.shank_info['shank0']['ap_file'], sort=False) + self.sglx_instances.append(sr_c_ap) + + # Make sure all the aps are the same regardless of window size we used + np.testing.assert_array_equal(sr_a_ap[:, :], sr_b_ap[:, :]) + np.testing.assert_array_equal(sr_a_ap[:, :], sr_c_ap[:, :]) + np.testing.assert_array_equal(sr_b_ap[:, :], sr_c_ap[:, :]) + + # For AP also check that all values are the same as the original file + # sr_a_ap[0, :-1].T / 7.6293946e-07 + # sr[0, np_a.shank_info['shank0']['chns'][:-1]] / 7.6293946e-07 + # sr[:, np_a.shank_info['shank0']['chns']] + np.testing.assert_array_equal(sr_a_ap[:, :], sr[:, np_a.shank_info['shank0']['chns']]) + np.testing.assert_array_equal(sr_b_ap[:, :], sr[:, np_b.shank_info['shank0']['chns']]) + np.testing.assert_array_equal(sr_c_ap[:, :], sr[:, np_c.shank_info['shank0']['chns']]) + + sr_a_lf = spikeglx.Reader(np_a.shank_info['shank0']['lf_file'], sort=False) + self.sglx_instances.append(sr_a_lf) + sr_b_lf = spikeglx.Reader(np_b.shank_info['shank0']['lf_file'], sort=False) + self.sglx_instances.append(sr_b_lf) + sr_c_lf = spikeglx.Reader(np_c.shank_info['shank0']['lf_file'], sort=False) + self.sglx_instances.append(sr_c_lf) + + # Make sure all the lfps are the same regardless of window size we used + np.testing.assert_array_equal(sr_a_lf[:, :], sr_b_lf[:, :]) + np.testing.assert_array_equal(sr_a_lf[:, :], sr_c_lf[:, :]) + np.testing.assert_array_equal(sr_b_lf[:, :], sr_c_lf[:, :]) + + def testProcessNP24(self): + """ + Check normal workflow of splittig data into individual shanks + :return: + """ + # Make sure normal workflow runs without problems + np_conv = NP2Converter(self.file_path) + np_conv.init_params(extra='_test') + status = np_conv.process() + self.assertFalse(np_conv.already_exists) + self.assertTrue(status) + + # Test a random ap metadata file and make sure it all makes sense + shank_n = random.randint(0, 3) + sr_ap = spikeglx.Reader(np_conv.shank_info[f'shank{shank_n}']['ap_file'], sort=False) + np.testing.assert_array_equal(sr_ap.meta['acqApLfSy'], [96, 0, 1]) + np.testing.assert_array_equal(sr_ap.meta['snsApLfSy'], [96, 0, 1]) + self.assertEqual(sr_ap.meta['nSavedChans'], 97) + self.assertEqual(sr_ap.meta['snsSaveChanSubset'], '0:96') + self.assertEqual(sr_ap.meta['NP2.4_shank'], shank_n) + self.assertEqual(sr_ap.meta['original_meta'], 'False') + sr_ap.close() + + # Test a random lf metadata file and make sure it all makes sense + shank_n = random.randint(0, 3) + sr_lf = spikeglx.Reader(np_conv.shank_info[f'shank{shank_n}']['lf_file'], sort=False) + np.testing.assert_array_equal(sr_lf.meta['acqApLfSy'], [0, 96, 1]) + np.testing.assert_array_equal(sr_lf.meta['snsApLfSy'], [0, 96, 1]) + self.assertEqual(sr_lf.meta['nSavedChans'], 97) + self.assertEqual(sr_lf.meta['snsSaveChanSubset'], '0:96') + self.assertEqual(sr_lf.meta['NP2.4_shank'], shank_n) + self.assertEqual(sr_lf.meta['original_meta'], 'False') + self.assertEqual(sr_lf.meta['imSampRate'], 2500) + sr_lf.close() + + # Rerun again and make sure that nothing happens because folders already exists + np_conv = NP2Converter(self.file_path) + np_conv.init_params(extra='_test') + status = np_conv.process() + self.assertTrue(np_conv.already_exists) + self.assertFalse(status) + + # But if we set the overwrite flag to True we force rerunning + # here we also test deleting of the original folder + np_conv = NP2Converter(self.file_path, delete_original=True) + np_conv.init_params(extra='_test') + status = np_conv.process(overwrite=True) + self.assertFalse(np_conv.already_exists) + self.assertTrue(status) + np_conv.sr.close() + + # test that original has been deleted + self.assertFalse(self.file_path.exists()) + + # Finally test that we cannot process a file that has already been split + shank_n = random.randint(0, 3) + ap_file = np_conv.shank_info[f'shank{shank_n}']['ap_file'] + np_conv = NP2Converter(ap_file) + status = np_conv.process() + self.assertTrue(np_conv.already_processed) + self.assertFalse(status) + + np_conv.sr.close() + + def testIncorrectSplitting(self): + """ + Check that if the data has been incorrectly split we get a warning error + :return: + """ + + np_conv = NP2Converter(self.file_path, compress=False) + np_conv.init_params(extra='_test') + status = np_conv.process() + self.assertFalse(np_conv.already_exists) + self.assertTrue(status) + + # Change some of the data and make sure the checking function is working as expected + ap_file = np_conv.shank_info['shank0']['ap_file'] + with open(ap_file, "r+b") as f: + f.write((chr(10) + chr(20) + chr(30) + chr(40)).encode()) + + # Now that we have changed the file we expect an assertion error when we do the check + with self.assertRaises(AssertionError) as context: + np_conv.check_NP24() + self.assertTrue('data in original file and split files do no match' + in str(context.exception)) + + def testFromCompressed(self): + """ + Check that processing works even if ap file has already been compressed + :return: + """ + sr_ap = spikeglx.Reader(self.file_path) + cbin_file = sr_ap.compress_file(check_after_compress=False) + sr_ap.close() + self.file_path.unlink() + + np_conv = NP2Converter(cbin_file) + np_conv.init_params(extra='_test') + status = np_conv.process() + self.assertFalse(np_conv.already_exists) + self.assertTrue(status) + np_conv.sr.close() + + +class TestNeuropixel2ConverterNP21(BaseEphysNP2): + """ + Check NP2 converter with NP2.1 type probes + """ + def setUp(self) -> None: + file_path = self.data_path.joinpath('_spikeglx_ephysData_g0_t0.imec0.ap.bin') + self.file_path = file_path.parent.parent.joinpath('probe00_temp', file_path.name) + self.file_path.parent.mkdir(exist_ok=True, parents=True) + meta_file = file_path.parent.joinpath('NP21_meta', '_spikeglx_ephysData_g0_t0.imec0.ap.meta') + self.meta_file = self.file_path.parent.joinpath('_spikeglx_ephysData_g0_t0.imec0.ap.meta') + shutil.copy(file_path, self.file_path) + shutil.copy(meta_file, self.meta_file) + self.sglx_instances = [] + + def tearDown(self): + _ = [sglx.close() for sglx in self.sglx_instances] + # here should look for anything with test in it and delete + shutil.rmtree(self.file_path.parent) + + def testProcessNP21(self): + """ + Check normal workflow of getting LFP data out and storing in main probe folder + :return: + """ + + # make sure it runs smoothly + np_conv = NP2Converter(self.file_path) + status = np_conv.process() + self.assertFalse(np_conv.already_exists) + self.assertTrue(status) + + # test the meta file + sr_ap = spikeglx.Reader(np_conv.shank_info['shank0']['lf_file']) + np.testing.assert_array_equal(sr_ap.meta['acqApLfSy'], [0, 384, 1]) + np.testing.assert_array_equal(sr_ap.meta['snsApLfSy'], [0, 384, 1]) + self.assertEqual(sr_ap.meta['nSavedChans'], 385) + self.assertEqual(sr_ap.meta['snsSaveChanSubset'], '0:384') + self.assertEqual(sr_ap.meta['NP2.1_shank'], 0) + self.assertEqual(sr_ap.meta['original_meta'], 'False') + sr_ap.close() + + np_conv.sr.close() + + # now run again and make sure that it doesn't run + np_conv = NP2Converter(self.file_path.with_suffix('.cbin')) + status = np_conv.process() + self.assertTrue(np_conv.already_exists) + self.assertFalse(status) + np_conv.sr.close() + + # Now try with the overwrite flag and make sure it runs, this also tests running from + # a compressed file + np_conv = NP2Converter(self.file_path.with_suffix('.cbin')) + status = np_conv.process(overwrite=True) + self.assertFalse(np_conv.already_exists) + self.assertTrue(status) + np_conv.sr.close() + + +class TestNeuropixel2ConverterNP1(NP2Converter): + """ + Check NP2 converter with NP1 type probes + """ + def setUp(self) -> None: + self.file_path = self.data_path.joinpath('_spikeglx_ephysData_g0_t0.imec0.ap.bin') + meta_file = self.file_path.parent.joinpath('NP1_meta', + '_spikeglx_ephysData_g0_t0.imec0.ap.meta') + self.meta_file = self.file_path.with_suffix('.meta') + # Back up current meta file + shutil.move(self.meta_file, self.meta_file.with_suffix('.meta.bk')) + # Copy the neuropixels v1 meta file into the probe00 folder + shutil.copy(meta_file, self.meta_file) + self.sglx_instances = [] + self.temp_directories = [] + + def tearDown(self): + # replace meta file with backup + shutil.move(self.meta_file.with_suffix('.meta.bk'), self.meta_file) + + def testProcessNP1(self): + """ + Check normal workflow -> nothing should happen! + """ + np_conv = NP2Converter(self.file_path) + status = np_conv.process() + self.assertEqual(status, -1) + + +class TestNeuropixelReconstructor(BaseEphysNP2): + def setUp(self) -> None: + self.orig_file = self.data_path.joinpath('_spikeglx_ephysData_g0_t0.imec0.ap.bin') + self.file_path = self.orig_file.parent.parent.joinpath('probe00_temp', self.orig_file.name) + self.file_path.parent.mkdir(exist_ok=True, parents=True) + self.orig_meta_file = self.orig_file.parent.joinpath('NP24_meta', '_spikeglx_ephysData_g0_t0.imec0.ap.meta') + self.meta_file = self.file_path.parent.joinpath('_spikeglx_ephysData_g0_t0.imec0.ap.meta') + shutil.copy(self.orig_file, self.file_path) + shutil.copy(self.orig_meta_file, self.meta_file) + self.sglx_instances = [] + + def tearDown(self): + _ = [sglx.close() for sglx in self.sglx_instances] + # here should look for any directories with test in it and delete + test_dir = list(self.file_path.parent.parent.glob('*test*')) + _ = [shutil.rmtree(test) for test in test_dir] + # For case where we have deleted already as part of test + if self.file_path.parent.exists(): + shutil.rmtree(self.file_path.parent) + + def test_reconstruction(self): + + # First split the probes + np_conv = NP2Converter(self.file_path) + np_conv.init_params(extra='_test') + _ = np_conv.process() + np_conv.sr.close() + + # Delete the original file + self.file_path.unlink() + self.meta_file.unlink() + + # Now reconstruct + np_recon = NP2Reconstructor(self.file_path.parent.parent, pname='probe00_temp', compress=True) + status = np_recon.process() + + self.assertEqual(status, 1) + + recon_file = self.file_path.with_suffix('.cbin') + sr_recon = spikeglx.Reader(recon_file, sort=False) + self.sglx_instances.append(sr_recon) + sr_orig = spikeglx.Reader(self.orig_file, sort=False) + self.sglx_instances.append(sr_orig) + + np.testing.assert_array_equal(sr_recon._raw[:, :], sr_orig._raw[:, :]) + + orig_meta = spikeglx.read_meta_data(self.orig_meta_file) + recon_meta = spikeglx.read_meta_data(recon_file.with_suffix('.meta')) + recon_meta.pop('original_meta') + + self.assertEqual(orig_meta, recon_meta) + + +if __name__ == "__main__": + import unittest + unittest.main(exit=False) diff --git a/src/tests/unit/cpu/test_ibldsp.py b/src/tests/unit/test_ibldsp.py similarity index 99% rename from src/tests/unit/cpu/test_ibldsp.py rename to src/tests/unit/test_ibldsp.py index 16e4391..9fa8886 100644 --- a/src/tests/unit/cpu/test_ibldsp.py +++ b/src/tests/unit/test_ibldsp.py @@ -16,6 +16,8 @@ import tempfile import shutil +FIXTURE_PATH = Path(__file__).parents[1].joinpath("fixtures") + class TestSyncTimestamps(unittest.TestCase): @@ -567,8 +569,9 @@ def test_spikes_venn2(self): class TestRawDataFeatures(unittest.TestCase): def setUp(self): - self.fixtures_path = Path(__file__).parent.joinpath("fixtures") + self.fixtures_path = FIXTURE_PATH self.tmpdir = Path(tempfile.gettempdir()) / "rawdata" + shutil.rmtree(self.tmpdir, ignore_errors=True) self.tmpdir.mkdir() self.ns_ap = 38502 self.nc = 385 diff --git a/src/tests/unit/cpu/test_neuropixel.py b/src/tests/unit/test_neuropixel.py similarity index 100% rename from src/tests/unit/cpu/test_neuropixel.py rename to src/tests/unit/test_neuropixel.py diff --git a/src/tests/unit/cpu/test_spikeglx.py b/src/tests/unit/test_spikeglx.py similarity index 98% rename from src/tests/unit/cpu/test_spikeglx.py rename to src/tests/unit/test_spikeglx.py index 99b7de7..a7b4dc2 100644 --- a/src/tests/unit/cpu/test_spikeglx.py +++ b/src/tests/unit/test_spikeglx.py @@ -9,7 +9,7 @@ import neuropixel import spikeglx -TEST_PATH = Path(__file__).parent.joinpath("fixtures") +TEST_PATH = Path(__file__).parents[1].joinpath("fixtures") class TestSpikeGLX_hardwareInfo(unittest.TestCase): @@ -212,7 +212,7 @@ def test_read_slices(self): self.assertTrue(np.all(np.isclose(sr._raw[5:500, :-1] * s2mv, sr[5:500, :-1]))) self.assertTrue(np.all(np.isclose(sr._raw[5:500, 5] * s2mv, sr[5:500, 5]))) self.assertTrue(np.all(np.isclose(sr._raw[5, :-1] * s2mv, sr[5, :-1]))) - self.assertTrue(sr._raw[55, 5] * s2mv == sr[55, 5]) + np.testing.assert_almost_equal(sr._raw[55, 5] * s2mv, sr[55, 5]) self.assertTrue(np.all(np.isclose(sr._raw[55] * s2mv, sr[55]))) self.assertTrue(np.all(np.isclose(sr._raw[5:500] * s2mv, sr[5:500])[:, :-1])) @@ -437,7 +437,7 @@ def test_check_ephys_file(self): def assert_read_glx(self, tglx): with spikeglx.Reader(tglx["bin_file"]) as sr: - dexpected = sr.channel_conversion_sample2v[sr.type] * tglx["D"] + dexpected = sr.channel_conversion_sample2v[sr.type] * tglx["D"][:, sr.raw_channel_order] d, sync = sr.read_samples(0, tglx["ns"]) # could be rounding errors with non-integer sampling rates self.assertTrue(sr.nsync == 1) @@ -494,11 +494,11 @@ def assert_read_glx(self, tglx): # test the channel geometries but skip when meta data doesn't correspond to NP if sr.major_version is not None: th = sr.geometry - h = neuropixel.trace_header( + h_expected = neuropixel.trace_header( sr.major_version, nshank=np.unique(th["shank"]).size ) - for k in h.keys(): - assert np.all(th[k] == h[k]), print(k) + for k in h_expected.keys(): + np.testing.assert_equal(h_expected[k][sr.raw_channel_order[:-sr.nsync]], th[k]) def testGetSerialNumber(self): self.meta_files.sort() diff --git a/src/tests/unit/cpu/test_waveforms.py b/src/tests/unit/test_waveforms.py similarity index 98% rename from src/tests/unit/cpu/test_waveforms.py rename to src/tests/unit/test_waveforms.py index d77dba6..84e3b89 100644 --- a/src/tests/unit/cpu/test_waveforms.py +++ b/src/tests/unit/test_waveforms.py @@ -16,7 +16,7 @@ from ibldsp.fourier import fshift -TEST_PATH = Path(__file__).parent.joinpath("fixtures") +TEST_PATH = Path(__file__).parents[1].joinpath("fixtures") def make_array_peak_through_tip(): @@ -100,7 +100,7 @@ def test_peak_through_tip_3d(): def test_halfpeak_slopes(): # Load fixtures - folder_save = Path(__file__).parent.joinpath("fixtures", "waveform_sample") + folder_save = TEST_PATH.joinpath("waveform_sample") arr_in = np.load(folder_save.joinpath("test_arr_in.npy")) test_arr_peak = np.load(folder_save.joinpath("test_arr_peak.npy")) test_df = pd.read_csv(folder_save.joinpath("test_df.csv")) @@ -118,7 +118,7 @@ def test_dist_chanel_from_peak(): xyz_testd = np.stack( ( np.array([[0, 0, 0], [0, 1, 0], [1, 0, 0], [1, 1, 0]]), - np.array([[4, 0, 0], [2, 0, 0], [np.NaN, np.NaN, np.NaN], [1, 0, 0]]), + np.array([[4, 0, 0], [2, 0, 0], [np.nan, np.nan, np.nan], [1, 0, 0]]), ), axis=2, ) @@ -132,7 +132,7 @@ def test_dist_chanel_from_peak(): sp_spread = waveforms.spatial_spread_weighted(eu_dist, weights) np.testing.assert_almost_equal(eu_dist[0, :], np.array([0, 1, 1, np.sqrt(2)])) - np.testing.assert_equal(eu_dist[1, :], np.array([2, 0, np.NaN, 1])) + np.testing.assert_equal(eu_dist[1, :], np.array([2, 0, np.nan, 1])) np.testing.assert_equal(sp_spread, np.array([1, 0.5]))