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-2/

GPS Almanac Data Analyzer

Build a Python tool that processes GPS almanac data from NMEA sentences and generates a summary report of satellite orbital parameters.

Requirements

Your tool should:

  1. Parse NMEA GPS almanac sentences from a file containing multiple ALM sentences
  2. Extract orbital parameters from each almanac sentence
  3. Generate a summary report containing:
    • Total number of satellites with almanac data
    • List of satellite PRN numbers found
    • Health status summary (number of healthy vs unhealthy satellites)
    • Average orbital eccentricity across all satellites

Input Format

The input file will contain one or more NMEA GPS almanac sentences, one per line. Each sentence provides orbital parameters for a single GPS satellite including satellite PRN number, GPS week number, health status, eccentricity, and other orbital elements.

Output Format

The tool should output a text report with the following structure:

GPS Almanac Summary
===================
Total Satellites: <count>
Satellite PRNs: <comma-separated list>
Healthy Satellites: <count>
Unhealthy Satellites: <count>
Average Eccentricity: <value>

Test Cases

  • It correctly parses multiple ALM sentences and generates a summary report @test
  • It handles a single ALM sentence and computes correct statistics @test

Example Test Case

Input file (almanac_data.txt):

$GPALM,1,1,15,1159,00,4310,7b,145f,fd44,a10ce4,1cbe,-12,1,2*5e
$GPALM,1,1,26,1159,00,4308,7b,1472,fd8c,a10d56,2761,0,1,2*4f

Expected output:

GPS Almanac Summary
===================
Total Satellites: 2
Satellite PRNs: 15, 26
Healthy Satellites: 2
Unhealthy Satellites: 0
Average Eccentricity: 0.00799

Implementation

@generates

Create a Python script that reads the input file, processes each ALM sentence, and prints the summary report to stdout.

API

def parse_almanac_file(filename: str) -> dict:
    """
    Parse GPS almanac sentences from a file.

    Args:
        filename: Path to file containing NMEA ALM sentences

    Returns:
        Dictionary with keys:
            - 'total_satellites': int
            - 'prn_numbers': list of int
            - 'healthy_count': int
            - 'unhealthy_count': int
            - 'avg_eccentricity': float
    """
    pass

def generate_report(data: dict) -> str:
    """
    Generate a formatted summary report from parsed almanac data.

    Args:
        data: Dictionary from parse_almanac_file()

    Returns:
        Formatted report string
    """
    pass

Dependencies { .dependencies }

pynmea2 { .dependency }

Provides NMEA 0183 sentence parsing support for GPS almanac data.

Version

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