from pathlib import Path from atlaselectrophysiology.extract_files import extract_data # Path to KS2 output ks_path = Path(r'C:\Users\yvan\Documents\npx_analysis_ivan\im0060\im0060_physiology\im0060_ks2_v1') # Path to raw ephys data ephys_path = Path(r'C:\Users\yvan\Documents\npx_analysis_ivan\im0060\im0060_physiology\im0060_raw_ephys_data') # Save path out_path = Path(r'C:\Users\yvan\Documents\npx_analysis_ivan\im0060\im0060_alf') extract_data(ks_path, ephys_path, out_path) C:\Users\yvan\anaconda3\Lib\site-packages\one\alf\files.py:10: FutureWarning: `one.alf.files` will be removed in version 3.0. Use `one.alf.path` instead. warnings.warn( Converting to ALF: 41%|████ | 55/135 [00:04<00:07, 10.22it/s] Extracting waveforms: 0%| | 0/2315.8481 [00:00 13 extract_data(ks_path, ephys_path, out_path) File c:\users\yvan\iblapps\atlaselectrophysiology\extract_files.py:142, in extract_data(ks_path, ephys_path, out_path) 140 extract_rmsmap(efile.ap, out_folder=out_path, spectra=False) 141 if efile.get('lf') and efile.lf.exists(): --> 142 extract_rmsmap(efile.lf, out_folder=out_path) File c:\users\yvan\iblapps\atlaselectrophysiology\extract_files.py:93, in extract_rmsmap(fbin, out_folder, spectra) 90 alf_object_freq = f'ephysSpectralDensity{sglx.type.upper()}' 92 # crunch numbers ---> 93 rms = rmsmap(fbin, spectra=spectra) 94 # output ALF files, single precision with the optional label as suffix before extension 95 if not out_folder.exists(): File c:\users\yvan\iblapps\atlaselectrophysiology\extract_files.py:47, in rmsmap(fbin, spectra) 45 with tqdm(total=wingen.nwin) as pbar: 46 for first, last in wingen.firstlast: ---> 47 D = sglx.read_samples(first_sample=first, last_sample=last)[0].transpose() 48 # remove low frequency noise below 1 Hz 49 D = fourier.hp(D, 1 / sglx.fs, [0, 1]) File ~\anaconda3\Lib\site-packages\spikeglx.py:308, in Reader.read_samples(self, first_sample, last_sample, channels) 306 if channels is None: 307 channels = slice(None) --> 308 return self.read(slice(first_sample, last_sample), channels) File ~\anaconda3\Lib\site-packages\spikeglx.py:291, in Reader.read(self, nsel, csel, sync) 289 darray *= self.channel_conversion_sample2v[self.type][csel] 290 if sync: --> 291 return darray, self.read_sync(nsel) 292 else: 293 return darray File ~\anaconda3\Lib\site-packages\spikeglx.py:345, in Reader.read_sync(self, _slice, threshold, floor_percentile) 336 def read_sync(self, _slice=slice(0, 10000), threshold=1.2, floor_percentile=10): 337 """ 338 Reads all sync trace. Convert analog to digital with selected threshold and append to array 339 :param _slice: samples slice (...) 343 :return: int8 array 344 """ --> 345 digital = self.read_sync_digital(_slice) 346 analog = self.read_sync_analog(_slice) 347 if analog is not None and floor_percentile: File ~\anaconda3\Lib\site-packages\spikeglx.py:320, in Reader.read_sync_digital(self, _slice) 317 if not self.meta: 318 _logger.warning("Sync trace not labeled in metadata. Assuming last trace") 319 return split_sync( --> 320 self._raw[_slice, _get_sync_trace_indices_from_meta(self.meta)] 321 ) File ~\anaconda3\Lib\site-packages\spikeglx.py:599, in _get_sync_trace_indices_from_meta(md) 595 def _get_sync_trace_indices_from_meta(md): 596 """ 597 Returns a list containing indices of the sync traces in the original array 598 """ --> 599 typ = _get_type_from_meta(md) 600 ntr = int(_get_nchannels_from_meta(md)) 601 if typ == "nidq": File ~\anaconda3\Lib\site-packages\spikeglx.py:640, in _get_type_from_meta(md) 636 def _get_type_from_meta(md): 637 """ 638 Get neuropixel data type (ap, lf or nidq) from metadata 639 """ --> 640 snsApLfSy = md.get("snsApLfSy", [-1, -1, -1]) 641 if snsApLfSy[0] == 0 and snsApLfSy[1] != 0: 642 return "lf" AttributeError: 'NoneType' object has no attribute 'get'