CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/pypi-pynmea2

tessl install tessl/pypi-pynmea2@1.19.0

Python library for parsing and generating NMEA 0183 protocol messages used in GPS and marine navigation systems

Agent Success

Agent success rate when using this tile

77%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.12x

Baseline

Agent success rate without this tile

69%

task.mdevals/scenario-8/

NMEA Log File Analyzer

A tool for analyzing NMEA 0183 log files containing GPS and navigation data from marine or GPS equipment.

Overview

Build a tool that processes NMEA log files to extract and analyze GPS position data from marine or aviation navigation equipment.

Requirements

File Processing

Read an NMEA log file containing multiple sentence types (GGA, RMC, etc.). The file has one sentence per line.

Data Extraction

Extract all valid GGA (GPS Fix Data) sentences from the log file. For each valid GGA sentence:

  • Record the timestamp
  • Extract latitude and longitude in decimal degrees
  • Extract altitude in meters
  • Validate that the GPS quality indicator shows a valid fix (quality > 0)

Summary Report

Generate a summary containing:

  • Total sentences processed from the file
  • Count of valid GGA fixes found
  • Average altitude across all valid fixes (2 decimal places)
  • First and last valid position with their timestamps

Implementation

@generates

API

def analyze_nmea_log(filepath: str) -> dict:
    """
    Analyzes an NMEA log file and extracts GPS position data.

    Args:
        filepath: Path to the NMEA log file

    Returns:
        A dictionary containing:
        - 'total_sentences': Total number of sentences in file
        - 'valid_fixes': Number of valid GGA fixes
        - 'average_altitude': Average altitude in meters (2 decimals)
        - 'first_fix': Dict with 'timestamp', 'lat', 'lon', 'altitude'
        - 'last_fix': Dict with 'timestamp', 'lat', 'lon', 'altitude'
    """
    pass

Test Cases

Counts sentences and valid fixes correctly

  • Given a log file with 10 sentences including 3 valid GGA fixes, returns total_sentences=10 and valid_fixes=3. @test

Extracts position data in decimal degrees

  • Given a log file with GGA sentences, extracts latitude and longitude as decimal degrees (e.g., 37.7749 for latitude). @test

Calculates average altitude

  • Given GGA fixes with altitudes 100m, 150m, and 200m, calculates average_altitude as 150.00. @test

Records first and last positions

  • Given multiple GGA fixes, correctly identifies the first and last valid fix with their timestamps. @test

Dependencies { .dependencies }

pynmea2 { .dependency }

Provides NMEA 0183 sentence parsing and file processing support.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/pynmea2@1.19.x
tile.json