コード例 #1
0
 def __init__(self, recording_file, verbose=False):
     assert HAVE_INTAN, "To use the Intan extractor, install pyintan: \n\n pip install pyintan\n\n"
     RecordingExtractor.__init__(self)
     assert Path(recording_file).suffix == '.rhs' or Path(recording_file).suffix == '.rhd', \
         "Only '.rhd' and '.rhs' files are supported"
     self._recording_file = recording_file
     self._recording = pyintan.File(recording_file, verbose)
コード例 #2
0
    def __init__(self, file_path, dtype='float', verbose=False):
        assert HAVE_INTAN, self.installation_mesg
        RecordingExtractor.__init__(self)
        assert Path(file_path).suffix == '.rhs' or Path(file_path).suffix == '.rhd', \
            "Only '.rhd' and '.rhs' files are supported"
        self._recording_file = file_path
        self._recording = pyintan.File(file_path, verbose)
        self._num_frames = len(self._recording.times)
        self._analog_channels = np.array([
            ch for ch in self._recording._anas_chan if all([
                other_ch not in ch['name']
                for other_ch in ['ADC', 'VDD', 'AUX']
            ])
        ])
        self._num_channels = len(self._analog_channels)
        self._channel_ids = list(range(self._num_channels))
        self._fs = float(self._recording.sample_rate.rescale('Hz').magnitude)

        assert dtype in ['float',
                         'uint16'], "'dtype' can be either 'float' or 'uint16'"
        self._dtype = dtype

        if self._dtype == 'uint16':
            for i, ch in enumerate(self._analog_channels):
                self.set_channel_property(i, 'gain', ch['gain'])
                self.set_channel_property(i, 'offset', ch['offset'])

        self._kwargs = {
            'file_path': str(Path(file_path).absolute()),
            'verbose': verbose
        }
コード例 #3
0
 def __init__(self, file_path, verbose=False):
     assert HAVE_INTAN, "To use the Intan extractor, install pyintan: \n\n pip install pyintan\n\n"
     RecordingExtractor.__init__(self)
     assert Path(file_path).suffix == '.rhs' or Path(file_path).suffix == '.rhd', \
         "Only '.rhd' and '.rhs' files are supported"
     self._recording_file = file_path
     self._recording = pyintan.File(file_path, verbose)
     self._kwargs = {
         'file_path': str(Path(file_path).absolute()),
         'verbose': verbose
     }
コード例 #4
0
 def __init__(self, recording_file, *, experiment_id=0, recording_id=0):
     try:
         import pyintan
     except ModuleNotFoundError:
         raise ModuleNotFoundError(
             "To use the Intan extractor, install pyintan: \n\n"
             "pip install pyintan\n\n")
     RecordingExtractor.__init__(self)
     assert Path(recording_file).suffix == '.rhs' or Path(recording_file).suffix == '.rhd', \
         "Only '.rhd' and '.rhs' files are supported"
     self._recording_file = recording_file
     self._recording = pyintan.File(recording_file)
コード例 #5
0
    def __init__(self, file_path: str, verbose: bool = False):
        assert self.installed, self.installation_mesg
        RecordingExtractor.__init__(self)
        assert Path(file_path).suffix == '.rhs' or Path(file_path).suffix == '.rhd', \
            "Only '.rhd' and '.rhs' files are supported"
        self._recording_file = file_path
        self._recording = pyintan.File(file_path, verbose)
        self._num_frames = len(self._recording.times)
        self._analog_channels = np.array([
            ch for ch in self._recording._anas_chan
            if all([other_ch not in ch['name'] for other_ch in ['ADC', 'VDD', 'AUX']])
        ])
        self._num_channels = len(self._analog_channels)
        self._channel_ids = list(range(self._num_channels))
        self._fs = float(self._recording.sample_rate.rescale('Hz').magnitude)

        for i, ch in enumerate(self._analog_channels):
            self.set_channel_gains(channel_ids=i, gains=ch['gain'])
            self.set_channel_offsets(channel_ids=i, offsets=ch['offset'])

        self._kwargs = dict(file_path=str(Path(file_path).absolute()), verbose=verbose)