Hypnogram#
- brainmaze_eeg.hypnogram.correct_hypnogram(df, time_threshold=60)#
- brainmaze_eeg.hypnogram.correct_rem(df, time_threshold=300, initial_state='AWAKE')#
- brainmaze_eeg.hypnogram.do_median_filtration(df)#
- brainmaze_eeg.hypnogram.fill_nonrem_voids(df, time_threshold=300, initial_state='AWAKE')#
- brainmaze_eeg.hypnogram.fill_same_voids(df, time_threshold=300, initial_state='AWAKE')#
- brainmaze_eeg.hypnogram.fill_sleep_voids(df, time_threshold=300, initial_state='AWAKE')#
- brainmaze_eeg.hypnogram.fill_wakerem_voids(df, time_threshold=300, initial_state='AWAKE')#
- brainmaze_eeg.hypnogram.get_awakening_time(df, t_awake_threshold=90, t_sleep_threshold=10, awake_tag='AWAKE', sleep_cycle_tags=['REM', 'N2', 'N3'])#
- brainmaze_eeg.hypnogram.get_fell_asleep_time(df, t_sleep_check=60, t_awake_threshold=10, awake_tag='AWAKE', sleep_cycle_tags=['REM', 'N1', 'N2', 'N3'])#
- brainmaze_eeg.hypnogram.get_hypnogram_datarate(df)#
- brainmaze_eeg.hypnogram.get_number_of_awakenings(df, awake_tag='AWAKE', n1_tag='N1', sleep_tags=['N2', 'N3', 'REM'])#
- brainmaze_eeg.hypnogram.get_number_of_sleep_stages(df, tags='REM', delay=30)#
- brainmaze_eeg.hypnogram.get_rem_latency(df, rem_tag='REM', awake_tag='AWAKE')#
- brainmaze_eeg.hypnogram.get_stage_times(df, keys)#
- brainmaze_eeg.hypnogram.get_stage_times_dataset(hypnograms: list, keys, verbose=True)#
- brainmaze_eeg.hypnogram.get_time_by_key(df, key)#
- brainmaze_eeg.hypnogram.get_transition_counts(hyp, states=['AWAKE', 'N1', 'N2', 'N3', 'REM'])#
- brainmaze_eeg.hypnogram.get_transition_matrix(hyp, states=['AWAKE', 'N1', 'N2', 'N3', 'REM'])#
- brainmaze_eeg.hypnogram.get_transition_matrix_dataset(hypnograms, states=['AWAKE', 'N1', 'N2', 'N3', 'REM'])#
- brainmaze_eeg.hypnogram.is_sleep_complete(df, awake_tag='AWAKE')#
- brainmaze_eeg.hypnogram.plot_hypnogram(orig_df, hypnogram_values=None, hypnogram_colors=None, fontsize=12, fig=None, night_start=22)#
Creates a Matplotlib figure of spectrogram from the annotations. Time must be in a time-zone aware format.
- Parameters:
orig_df (annotations)
hypnogram_values (dict) – dict of a y-axis values for each hypnogram state
hypnogram_colors (dict) – dict of color hex codes for each hypnogram state
fontsize (int) – Fontsize
fig (figure) – Already existing figure object.
night_start (int) – A hour when does the night begin
- brainmaze_eeg.hypnogram.print_sleep_score(score)#
- brainmaze_eeg.hypnogram.score_night(df, plot=False)#
- brainmaze_eeg.hypnogram.transition_matrix_to_change_matrix(m)#
- brainmaze_eeg.hypnogram.valid_dataset_index_by_duration(hypnograms: list, filt_dict: dict)#