NeuroPyxels icon indicating copy to clipboard operation
NeuroPyxels copied to clipboard

Can't read Neuropixels NHP (commercial release) metadata

Open EricKenjiLee opened this issue 1 month ago • 10 comments

Seems to be the exact problem as #378 but now with, WARNING probe version 1030.0 not handled. AP bin .meta file is attached with .txt extension (since GitHub doesn't allow a .meta extension; it's saved as ASCII so I would try to read this file directly or it will throw a codec error). Tiberius_TF_PMD_0425_bank0_1_g0_t0.imec0.ap.meta.txt

SpikeGLX ver.: 20230411, Imex Phase30, v.3.60 Probe Type: NP 1032

Full traceback is as follows,

UnboundLocalError Traceback (most recent call last) Cell In[15], line 3 1 ap_bin_dir = "/Volumes/Kenji3/Tiberius_TF_PMD_0425_bank0_1_g0/Tiberius_TF_PMD_0425_bank0_1_g0_imec0/" ----> 3 meta = npyx.read_metadata(ap_bin_dir)

File ~/Library/Caches/pypoetry/virtualenvs/cfd-dlpfc-z1Y6YtZg-py3.9/lib/python3.9/site-packages/npyx/inout.py:48, in read_metadata(dp) 46 meta[probe] = metadata(dpx) 47 else: ---> 48 meta = metadata(dp) 50 return meta

File ~/Library/Caches/pypoetry/virtualenvs/cfd-dlpfc-z1Y6YtZg-py3.9/lib/python3.9/site-packages/npyx/inout.py:244, in metadata(dp) 242 bits_encoding=14 243 ampFactor=80 # hardcoded --> 244 meta['bit_uV_conv_factor']=(Vrange/2**bits_encoding/ampFactor) 247 # find everything else 248 for filt_key in ['highpass','lowpass']:

UnboundLocalError: local variable 'bits_encoding' referenced before assignment

Thank you for making such a useful package! Kenji

EricKenjiLee avatar May 08 '24 23:05 EricKenjiLee