def test_dataio_with_neo(): if os.path.exists('datatest_neo/data.h5'): os.remove('datatest_neo/data.h5') dataio = DataIO(dirname = 'datatest_neo') import neo import quantities as pq filenames = ['Tem06c06.IOT', 'Tem06c07.IOT', 'Tem06c08.IOT', ] for filename in filenames: blocks = neo.RawBinarySignalIO(filename).read(sampling_rate = 10.*pq.kHz, t_start = 0. *pq.S, unit = pq.V, nbchannel = 16, bytesoffset = 0, dtype = 'int16', rangemin = -10, rangemax = 10) channel_indexes = np.arange(14) dataio.append_signals_from_neo(blocks, channel_indexes = channel_indexes, signal_type = 'unfiltered') print(dataio.summary(level=1))
def test_dataio(): if os.path.exists('datatest/data.h5'): os.remove('datatest/data.h5') dataio = DataIO(dirname = 'datatest') #~ print(data) #data from locust sigs_by_trials, sampling_rate, ch_names = download_locust(trial_names = ['trial_01', 'trial_02', 'trial_03']) for seg_num in range(3): sigs = sigs_by_trials[seg_num] dataio.append_signals_from_numpy(sigs, seg_num = seg_num,t_start = 0.+5*seg_num, sampling_rate = sampling_rate, signal_type = 'filtered', channels = ch_names) #~ print(data) #~ print(data.segments) #~ print(data.store) print(dataio.summary(level=0)) print(dataio.summary(level=1))