def _map_trajectory(self):
self.trajectory_map = {}<EOL>with open(self.filepath, '<STR_LIT:r>') as trajectory_file:<EOL><INDENT>with closing(<EOL>mmap(<EOL>trajectory_file.fileno(), <NUM_LIT:0>,<EOL>access=ACCESS_READ)) as mapped_file:<EOL><INDENT>progress = <NUM_LIT:0><EOL>line = <NUM_LIT:0><EOL>frame = -<NUM_LIT:1><EOL>frame_start = <NUM_LIT:0><EOL>while progress <= len(mapped_file):<EOL><INDENT>line = line + <NUM_LIT:1><EOL>bline = mapped_file.readline()<EOL>if len(bline) == <NUM_LIT:0>:<EOL><INDENT>frame = frame + <NUM_LIT:1><EOL>if progress - frame_start > <NUM_LIT:10>:<EOL><INDENT>self.trajectory_map[frame] = [<EOL>frame_start, progress<EOL>]<EOL><DEDENT>break<EOL><DEDENT>sline = bline.decode("<STR_LIT:utf-8>").strip('<STR_LIT:\n>').split()<EOL>if len(sline) == <NUM_LIT:1> and sline[<NUM_LIT:0>] == '<STR_LIT>':<EOL><INDENT>frame = frame + <NUM_LIT:1><EOL>self.trajectory_map[frame] = [frame_start, progress]<EOL>frame_start = progress<EOL><DEDENT>progress = progress + len(bline)<EOL><DEDENT><DEDENT>self.no_of_frames = frame<EOL><DEDENT>
Return filepath as a class attribute