diff --git a/cardioception/HRD/parameters.py b/cardioception/HRD/parameters.py index 25bd16c1..900d766f 100644 --- a/cardioception/HRD/parameters.py +++ b/cardioception/HRD/parameters.py @@ -383,6 +383,10 @@ def getParameters( serial=port, sfreq=75, add_channels=1, **systole_kw ) parameters["oxiTask"].setup().read(duration=1) + + # # for Nonin 3231 USB + # parameters['oxiTask'] = Nonin3231USB(serial=port, add_channels=1).setup().read(1) + elif setup == "test": # Use pre-recorded pulse time series for testing port = serialSim() diff --git a/cardioception/HRD/task.py b/cardioception/HRD/task.py index 14508733..e813b202 100644 --- a/cardioception/HRD/task.py +++ b/cardioception/HRD/task.py @@ -444,6 +444,14 @@ def trial( # Only use the last 5 seconds of the recording bpm = 60000 / np.diff(np.where(peaks[-5000:])[0]) + + # # for Nonin3231USB + # # Only use the last 5 seconds of the recording + # bpm = pd.Series(parameters["oxiTask"].read(duration=5.0).bpm)[-5:] + # # use bpm as signal, Nonin3231USB gives no raw signal + # signal = bpm + + print(f"... bpm: {[round(i) for i in bpm]}") # Prevent crash if NaN value