spkit.data
.optical_sample¶
- spkit.data.optical_sample(sample=1, species=None)¶
Load sample(s) of optical mapping signals
- Parameters:
- sampleint, {1,2,3,-1}
sample number
if -1, return all three samples
- species: str, default=None, {None, ‘rabbit’}
data of species
for ‘rabbit’, data of two cameras
- Returns:
- Xarray,
shape (n,) or (n,3) if species= None
shape (n,2) or shape (n,6) for species=’rabbit’,
- fsint
See also
eda_sample
Electrodermal activity (EDA)
gsr_sample
Galvanic Skin Response (GSR)
eeg_sample_14ch
Electroencephalography (EEG) - 14-channel
eeg_sample_1ch
Electroencephalography (EEG) - 1-channel
eeg_sample_artifact
Electroencephalography (EEG) processed
ecg_sample_12leads
Electrocardiogram (ECG) - 12-leads
ecg_sample
Electrocardiogram (ECG) - 1-lead
ppg_sample
Photoplethysmogram (PPG)
egm_sample
Electrogram (EGM)
Examples
import numpy as np import matplotlib.pyplot as plt import spkit as sp x,fs = sp.data.optical_sample(sample=1) t = np.arange(len(x))/fs plt.figure(figsize=(12,3)) plt.plot(t,x) plt.xlim([t[0],t[-1]]) plt.xlabel('time (s)') plt.grid() plt.show()
#sp.data.optical_sample import numpy as np import matplotlib.pyplot as plt import spkit as sp X,fs = sp.data.optical_sample(sample=1,species='rabbit') t = np.arange(X.shape[0])/fs plt.figure(figsize=(10,4)) plt.subplot(211) plt.plot(t,X[:,0],color='C0',label='cam1') plt.xlim([t[0],t[-1]]) plt.grid() plt.legend(loc=1) plt.subplot(212) plt.plot(t,X[:,1],color='C1',label='cam2') plt.xlim([t[0],t[-1]]) plt.grid() plt.legend(loc=1) plt.xlabel('time (s)') plt.subplots_adjust(hspace=0) plt.suptitle('Optical: Rabbit') plt.show()