nmea module

Functions to read data from NMEA files.

class nmea.Nmea(input_path, msg_types=None, check=False, keep_raw=False, include_ecef=False)[source]

Bases: NavData

Class used to parse through NMEA files

Read instance of NMEA file following NMEA 0183 standard.

This class uses the NMEA parser from pynmea2, which supports the NMEA 0183 standard [1]. With the introduction of the NMEA 2300 standard, an extra field is added to the RMC message type, as seen in Page 1-5 in [2].

Parameters:
  • input_path (str or path-like) – filepath to NMEA file to read.

  • msg_types (list) – List of strings describing messages that can be parsed. None is the default argument which defaults to [GGA, RMC] message types.

  • check (bool) – True if the checksum at the end of the NMEA sentence should be ignored. False if the checksum should be checked and lines with incorrect checksums will be ignored.

  • keep_raw (bool) – Flag for whether coordinates should be processed into commonly used latitude and longitude formats. The default value is ‘False’, in which case the coordinates are processed into the decimal format between -180° and 180° for longitude and between -90° and 90° for latitude. If ‘True’, returned NavData has the same coordinates as the input NMEA file, including the cardinal directions.

  • include_ecef (bool) – Flag for whether the returned NavData should include the ECEF coordinates equivalent to the recorded LLH coordinates. If ‘True’, the returned NavData instance has x_rx_m, y_rx_m and z_rx_m rows.

References

static _row_map()[source]

Map of row names from loaded Nmea to gnss_lib_py standard

Returns:

row_map – Dictionary of the form {old_name : new_name}

Return type:

Dict

include_ecef()[source]

Include ECEF coordinates for NMEA data.

The ECEF coordinates are always added inplace to the same instance of Nmea that is input.

postprocess()[source]

Postprocess loaded NMEA.