Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Commit

Permalink
Added 'channel_names' property
Browse files Browse the repository at this point in the history
  • Loading branch information
alejoe91 committed Dec 8, 2020
1 parent 44e5c1c commit 9738948
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import numpy as np
from pathlib import Path
from typing import Union
from copy import deepcopy

try:
from sonpy import lib as sp
Expand Down Expand Up @@ -56,6 +57,7 @@ def __init__(self, file_path: PathType, smrx_channel_ids: list):
# get channel info / set channel gains
self._channelid_to_smrxind = dict()
self._channel_smrxinfo = dict()
self._channel_names = []
for i, ind in enumerate(smrx_channel_ids):
if self._recording_file.ChannelType(ind) == sp.DataType.Off:
raise ValueError(f'Channel {ind} is type Off and cannot be used')
Expand All @@ -71,6 +73,7 @@ def __init__(self, file_path: PathType, smrx_channel_ids: list):
channel_ids=[i],
gains=gains
)
self._channel_names.append(self._channel_smrxinfo[i]['title'])

rate0 = self._channel_smrxinfo[0]['rate']
for chan, info in self._channel_smrxinfo.items():
Expand All @@ -80,6 +83,10 @@ def __init__(self, file_path: PathType, smrx_channel_ids: list):
self._kwargs = {'file_path': str(Path(file_path).absolute()),
'smrx_channel_ids': smrx_channel_ids}

@property
def channel_names(self):
return deepcopy(self._channel_names)

@check_get_traces_args
def get_traces(self, channel_ids=None, start_frame=None, end_frame=None):
'''This function extracts and returns a trace from the recorded data from the
Expand Down

0 comments on commit 9738948

Please sign in to comment.