Skip to content

Commit

Permalink
new alf io structure
Browse files Browse the repository at this point in the history
  • Loading branch information
mayofaulkner committed Feb 7, 2022
1 parent a22590e commit 892569c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions atlaselectrophysiology/extract_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,21 @@ def extract_rmsmap(fbin, out_folder=None, spectra=True):
out_folder = Path(fbin).parent
else:
out_folder = Path(out_folder)
alf_object_time = f'_iblqc_ephysTimeRms{sglx.type.upper()}'
alf_object_freq = f'_iblqc_ephysSpectralDensity{sglx.type.upper()}'
alf_object_time = f'ephysTimeRms{sglx.type.upper()}'
alf_object_freq = f'ephysSpectralDensity{sglx.type.upper()}'

# crunch numbers
rms = rmsmap(fbin, spectra=spectra)
# output ALF files, single precision with the optional label as suffix before extension
if not out_folder.exists():
out_folder.mkdir()
tdict = {'rms': rms['TRMS'].astype(np.single), 'timestamps': rms['tscale'].astype(np.single)}
alfio.save_object_npy(out_folder, object=alf_object_time, dico=tdict)
alfio.save_object_npy(out_folder, object=alf_object_time, dico=tdict, namespace='iblqc')
if spectra:
fdict = {'power': rms['spectral_density'].astype(np.single),
'freqs': rms['fscale'].astype(np.single)}
alfio.save_object_npy(out_folder, object=alf_object_freq, dico=fdict)
alfio.save_object_npy(
out_folder, object=alf_object_freq, dico=fdict, namespace='iblqc')


def _sample2v(ap_file):
Expand Down

0 comments on commit 892569c

Please sign in to comment.