Exemple #1
0
 def _read_dio_data(self, name, info):
     mmap_mode = self.mode if self.mmap else 'r'
     filepath = self.filename / info['file_template_str'].format(
         name=self.session_name)
     _, dio = readTrodesExtractedDataFile(filepath, mmap_mode=mmap_mode)
     on, off = dio['time'][dio['state'] == 1], dio['time'][dio['state'] ==
                                                           0]
     return on, off
Exemple #2
0
    def _read_analog_data(self, name, info):
        mmap_mode = self.mode if self.mmap else 'r'
        timestamp_file = self.filename / info['timestamps_path'].format(
            name=self.session_name)
        data = {}
        timestamps = readTrodesExtractedDataFile(
            timestamp_file, mmap_mode=mmap_mode)[1]['time']

        channels = info['channels']

        if self.pbar:
            channels = tqdm(channels, desc=f'Reading Analog Data ({name})')

        for channel in channels:
            if channel is None:
                continue
            channel_file = self.filename/info['file_template_str']\
                .format(name=self.session_name, channel=channel)
            _, channeldata = readTrodesExtractedDataFile(channel_file,
                                                         mmap_mode=mmap_mode)
            data[channel] = channeldata['voltage'].squeeze()

        return timestamps, data
Exemple #3
0
def plot_channel(path):
    _, data = readTrodesExtractedDataFile(path)
    plt.plot(data["voltage"])
    plt.show()