Closed SweetVlad closed 5 years ago
# Check if path exists if not os.path.exists(session_path): raise FileNotFoundError(session_path+' does not exist!') check_password(session_path, password) session_ts_md = pymef3_file.read_mef_session_metadata(session_path, password, False) channel_list = list(session_ts_md['time_series_channels'].keys()) channel_list.sort() channel_infos = [] for channel in channel_list: channel_md = session_ts_md['time_series_channels'][channel] channel_md_spec = channel_md['channel_specific_metadata'] channel_md_s2 = channel_md['section_2'] fsamp = channel_md_s2['sampling_frequency'] nsamp = channel_md_s2['number_of_samples'] ufact = channel_md_s2['units_conversion_factor'] unit = channel_md_s2['units_description'] start_time = channel_md_spec['earliest_start_time'] ch_desc = channel_md_s2['channel_description'] end_time = channel_md_spec['latest_end_time'] channel_infos.append({'name': channel, 'fsamp': fsamp, 'nsamp': nsamp, 'ufact': ufact, 'unit': unit, 'start_time': start_time, 'channel_description': ch_desc, 'end_time': end_time}) return channel_infos
Feature request