Skip to content

Commit b0b12ae

Browse files
committed
Implement waso functionality
1 parent 457098c commit b0b12ae

2 files changed

Lines changed: 31 additions & 117 deletions

File tree

circStudio/analysis/sleep/sleep.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,9 +1614,6 @@ def waso(data, algo='Cole-Kripke', **kwargs):
16141614
# Calculate main consolidated sleep episodes using the Roenneberg algorithm
16151615
main_sleep_df = main_sleep_bouts(data)[0]
16161616

1617-
# Initialize the sleep_flags variable to store sleep segments
1618-
sleep_flags = None
1619-
16201617
# Select an algorithm to detect sleep segments
16211618
match algo:
16221619
case 'Cole-Kripke':
@@ -1643,7 +1640,7 @@ def waso(data, algo='Cole-Kripke', **kwargs):
16431640
# Iterate over the main sleep episodes in the recording
16441641
for _, row in main_sleep_df.iterrows():
16451642
# Extract the date from the current row
1646-
date = row['START'].date()
1643+
date = row['start_time'].date()
16471644

16481645
# Use the consolidated sleep episode to define the start and stop borders
16491646
sleep_window = sleep_flags[row['start_time']:row['stop_time']]

0 commit comments

Comments
 (0)