diff --git a/python/fusion_engine_client/parsers/file_index.py b/python/fusion_engine_client/parsers/file_index.py index 598e1cb5..c59bbe1c 100644 --- a/python/fusion_engine_client/parsers/file_index.py +++ b/python/fusion_engine_client/parsers/file_index.py @@ -585,7 +585,11 @@ def __init__(self, fe_index: FileIndex, time_mapping_path: str) -> None: @classmethod def from_data_path(cls, fe_index: FileIndex, data_path: str) -> Optional['HostTimeIndexMap']: - return cls(fe_index, data_path + TIMESTAMP_FILE_ENDING) + time_mapping_path = data_path + TIMESTAMP_FILE_ENDING + if os.path.exists(time_mapping_path): + return cls(fe_index, time_mapping_path) + else: + return None def get_host_timestamps(self, fe_index_msg_indexes: Sequence[int]) -> NDArray[np.datetime64]: return self.time_map_data['posix_time'][self.message_mappings[fe_index_msg_indexes]]