def rt_location_log(logfile):
if os.name == '<STR_LIT>':<EOL><INDENT>f = open(logfile, '<STR_LIT:rb>')<EOL><DEDENT>else:<EOL><INDENT>f = open(logfile, '<STR_LIT:rb>')<EOL><DEDENT>locations = []<EOL>for line_binary in f:<EOL><INDENT>try:<EOL><INDENT>line = line_binary.decode("<STR_LIT:utf8>", "<STR_LIT:ignore>")<EOL><DEDENT>except UnicodeDecodeError:<EOL><INDENT>warnings.warn('<STR_LIT>')<EOL>print(line_binary)<EOL>continue<EOL><DEDENT>match = re.search("<STR_LIT>", line)<EOL>if match:<EOL><INDENT>loc = line[match.end() + <NUM_LIT:1>:].rstrip().split('<STR_LIT:U+0020>')<EOL>lat_sign = loc[<NUM_LIT:0>][<NUM_LIT:0>]<EOL>lat = loc[<NUM_LIT:0>][<NUM_LIT:1>:].split('<STR_LIT::>')<EOL>lat = int(lat[<NUM_LIT:0>]) + (int(lat[<NUM_LIT:1>]) / <NUM_LIT>) + (float(lat[<NUM_LIT:2>]) / <NUM_LIT>)<EOL>if lat_sign == '<STR_LIT:S>':<EOL><INDENT>lat *= -<NUM_LIT:1><EOL><DEDENT>lon_sign = loc[<NUM_LIT:1>][<NUM_LIT:0>]<EOL>lon = loc[<NUM_LIT:1>][<NUM_LIT:1>:].split('<STR_LIT::>')<EOL>lon = int(lon[<NUM_LIT:0>]) + (int(lon[<NUM_LIT:1>]) / <NUM_LIT>) + (float(lon[<NUM_LIT:2>]) / <NUM_LIT>)<EOL>if lon_sign == '<STR_LIT>':<EOL><INDENT>lon *= -<NUM_LIT:1><EOL><DEDENT>elev_sign = loc[<NUM_LIT:2>][<NUM_LIT:0>]<EOL>elev_unit = loc[<NUM_LIT:2>][-<NUM_LIT:1>]<EOL>if not elev_unit == '<STR_LIT:M>':<EOL><INDENT>raise NotImplementedError('<STR_LIT>' +<EOL>elev_unit)<EOL><DEDENT>elev = int(loc[<NUM_LIT:2>][<NUM_LIT:1>:-<NUM_LIT:1>])<EOL>if elev_sign == '<STR_LIT:->':<EOL><INDENT>elev *= -<NUM_LIT:1><EOL><DEDENT>elev /= <NUM_LIT:1000><EOL>locations.append((lat, lon, elev))<EOL><DEDENT><DEDENT>f.close()<EOL>return locations<EOL>
Extract location information from a RefTek raw log-file.

Function to read a specific RefTek RT130 log-file and find all location
information.

:type logfile: str
:param logfile: The logfile to look in

:returns: list of tuples of lat, lon, elevation in decimal degrees and km.
:rtype: list