There are three ways to use this dataset:
First, Unzip the "aware_raw.zip" to the same folder. After then:
import os
from scipy import io
import numpy as np
import matplotlib.pyplot as plt
plt.figure(figsize=(8,6))
path = './aware_raw/1/' # Take subject #1 as an example
for idx, filename in enumerate(os.listdir(path)):
fs, data = io.wavfile.read(path+filename)
data = data/(2**15) # Normalize from 16-bit PCM to [-1,1]
plt.subplot(3,3,idx+1)
plt.plot(np.array(range(len(data)))/fs, data)
plt.title(filename)
plt.xlabel('Time (sec)')
plt.ylabel('Amplitude')
plt.tight_layout()
plt.show()
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_pickle('aware_segmented.pkl')
display(df.loc[[100]]) # Take record #0 as an example
data = df['Inhale_1'][100] # Let's try to see how record #100's signals in phase "Inhale_1" looks like
data = data/(2**15) # Normalize from 16-bit PCM to [-1,1]
plt.figure(figsize=(12,9))
for idx in range(data.shape[0]):
plt.subplot(5, 5, idx+1)
plt.plot(data[idx,:])
plt.show()
AWARE STUDY ID: | Calculated age (years): | Sex: | Race/ethnicity: (choice=White) | Race/ethnicity: (choice=Black / African American) | Race/ethnicity: (choice=Hispanic / Latino) | Race/ethnicity: (choice=Asian) | Race/ethnicity: (choice=Other) | Height (cm): | Weight (kg): | ... | Calibration_1 | Calibration_2 | Calibration_3 | Nasal | Inhale_1 | Inhale_2 | Inhale_3 | Exhale_1 | Exhale_2 | Exhale_3 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
100 | 28 | 38.7 | Male | Checked | Unchecked | Unchecked | Unchecked | Unchecked | 177.8 | 87.5 | ... | [[-2, -4, -4, -3, -1, 0, -2, -1, -3, -1, -1, -... | [[-21, -18, -15, -16, -21, -22, -21, -18, -15,... | [[-7, -5, -6, -5, -5, -5, -3, -3, -2, -1, -2, ... | [[5, 7, 3, 3, 2, 1, 0, 0, -3, -6, -7, -9, -8, ... | [[21, 23, 28, 31, 31, 30, 31, 32, 36, 39, 39, ... | [[-13, -12, -11, -10, -10, -11, -12, -13, -11,... | [[-39, -46, -45, -40, -32, -31, -37, -38, -39,... | [[-7, -7, -6, -5, -6, -6, -4, -3, -2, -5, -6, ... | [[198, 185, 171, 154, 136, 122, 110, 102, 86, ... | [[-54, -48, -43, -38, -31, -26, -22, -20, -16,... |
1 rows × 56 columns
NOTE: Reading whole file is time consuming
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv('aware_segmented.csv', header=None, skiprows=100, nrows=1) # Read the 101-th line (record #100) for example
display(df)
data = df.iloc[0, 292846:412846].to_numpy() # 292846:412846 correspond to phase "Inhale_1", see README.md
data = data.reshape(25,-1)
data = data/(2**15) # Normalize from 16-bit PCM to [-1,1]
plt.figure(figsize=(12,9))
for idx in range(data.shape[0]):
plt.subplot(5, 5, idx+1)
plt.plot(data[idx,:])
plt.show()
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | ... | 1012836 | 1012837 | 1012838 | 1012839 | 1012840 | 1012841 | 1012842 | 1012843 | 1012844 | 1012845 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 28 | 38.7 | Male | Checked | Unchecked | Unchecked | Unchecked | Unchecked | 177.8 | 87.5 | ... | -60 | -59 | -55 | -50 | -52 | -58 | -61 | -62 | -56 | -53 |
1 rows × 1012846 columns
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv('aware_csa.csv')
display(df)
plt.plot(df.iloc[0:4, 46:].T.to_numpy()) # Let's take a look at subject #70's airway CSA curve (record #0 to #3)
plt.grid('on')
plt.show()
AWARE STUDY ID: | Calculated age (years): | Sex: | Race/ethnicity: (choice=White) | Race/ethnicity: (choice=Black / African American) | Race/ethnicity: (choice=Hispanic / Latino) | Race/ethnicity: (choice=Asian) | Race/ethnicity: (choice=Other) | Height (cm): | Weight (kg): | ... | CSA_75 | CSA_76 | CSA_77 | CSA_78 | CSA_79 | CSA_80 | CSA_81 | CSA_82 | CSA_83 | CSA_84 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 70 | 30.7 | Female | Checked | Unchecked | Unchecked | Unchecked | Unchecked | 160.02 | 80.0 | ... | 3.810551 | 3.913885 | 3.957559 | 3.970113 | 4.004002 | 4.103503 | 4.280572 | 4.504991 | 4.712451 | 4.833306 |
1 | 70 | 30.7 | Female | Checked | Unchecked | Unchecked | Unchecked | Unchecked | 160.02 | 80.0 | ... | 4.490665 | 4.274807 | 4.022432 | 3.807408 | 3.686022 | 3.682560 | 3.784819 | 3.943260 | 4.080129 | 4.119503 |
2 | 70 | 30.7 | Female | Checked | Unchecked | Unchecked | Unchecked | Unchecked | 160.02 | 80.0 | ... | 3.219514 | 3.399397 | 3.595761 | 3.768916 | 3.900902 | 3.999388 | 4.086103 | 4.178455 | 4.277437 | 4.368749 |
3 | 70 | 30.7 | Female | Checked | Unchecked | Unchecked | Unchecked | Unchecked | 160.02 | 80.0 | ... | 4.317590 | 4.736081 | 5.098569 | 5.315797 | 5.369527 | 5.325483 | 5.294827 | 5.382279 | 5.654416 | 6.126306 |
4 | 72 | 19.6 | Female | Checked | Checked | Unchecked | Unchecked | Unchecked | 152.40 | 50.6 | ... | 4.063526 | 3.973345 | 3.926251 | 3.907793 | 3.893328 | 3.864602 | 3.824250 | 3.801414 | 3.845476 | 4.012830 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
1053 | 66 | 18.0 | Male | Unchecked | Checked | Unchecked | Unchecked | Unchecked | 177.20 | 100.9 | ... | 4.317066 | 4.419419 | 4.453888 | 4.432593 | 4.382772 | 4.338273 | 4.329225 | 4.376190 | 4.486610 | 4.652911 |
1054 | 66 | 18.0 | Male | Unchecked | Checked | Unchecked | Unchecked | Unchecked | 177.20 | 100.9 | ... | 5.058151 | 5.262232 | 5.407480 | 5.526130 | 5.672834 | 5.898386 | 6.228152 | 6.649212 | 7.106533 | 7.515035 |
1055 | 66 | 18.0 | Male | Unchecked | Checked | Unchecked | Unchecked | Unchecked | 177.20 | 100.9 | ... | 5.700953 | 5.885066 | 5.989681 | 6.028290 | 6.022268 | 6.000034 | 5.994446 | 6.038448 | 6.157008 | 6.358157 |
1056 | 68 | 19.9 | Male | Unchecked | Checked | Unchecked | Unchecked | Unchecked | 182.30 | 85.0 | ... | 5.396123 | 5.364110 | 5.456679 | 5.680443 | 6.016404 | 6.422066 | 6.833527 | 7.169713 | 7.347199 | 7.307952 |
1057 | 68 | 19.9 | Male | Unchecked | Checked | Unchecked | Unchecked | Unchecked | 182.30 | 85.0 | ... | 6.678286 | 6.753770 | 6.664450 | 6.450338 | 6.209805 | 6.062980 | 6.115728 | 6.443510 | 7.083921 | 8.019280 |
1058 rows × 130 columns