, output_file=None)[source][source]

Compute sleep statistics from hypnogram file and export them in csv.

Sleep statistics specifications:

  • Time in Bed (TIB) : total duration of the hypnogram.
  • Total Dark Time (TDT) : duration of the hypnogram from beginning to last period of sleep.
  • Sleep Period Time (SPT) : duration from first to last period of sleep.
  • Wake After Sleep Onset (WASO) : duration of wake periods within SPT
  • Sleep Efficiency (SE) : TST / TDT * 100 (%).
  • Total Sleep Time (TST) : SPT - WASO.
  • W, N1, N2, N3 and REM: sleep stages duration.
  • % (W, … REM) : sleep stages duration expressed in percentages of TDT.
  • Latencies: latencies of sleep stages from the beginning of the record.

(All values except SE and percentages are expressed in minutes)

hypno_file : string

Full path to the hypnogram file.

output_file : string | None

Full path to the output file. If no file is provided, sleep statictics are print out to the terminal.

Examples using