API reference

The public API is a single function, read_data(), and the exception it raises on an unrecognized file. Both are imported directly from the top-level noaa_gml_file_reader package.

Reading data files

noaa_gml_file_reader.read_data(path)[source]

Read a NOAA GML trace-gas ASCII file into a pandas.DataFrame.

The header dialect is auto-detected and both are supported: the legacy # number_of_header_lines: form (column names from # data_fields:) and the current # header_lines : form (column names from the bare column row that is the last header line). Documented missing-value sentinels (-999.99, -999.999, nan) are mapped to NaN so numeric columns parse numeric.

Parameters:

path (str) – The path to the data file.

Returns:

The parsed file data, one column per header field.

Return type:

pandas.DataFrame

Raises:

UnrecognizedFormatError – If no known header dialect is detected or the header is truncated. (In v1 this was a silent empty DataFrame.)

Exceptions

exception noaa_gml_file_reader.UnrecognizedFormatError(path, first_header_line)[source]

Bases: Exception

Raised when a file’s header matches no known NOAA GML dialect.

Carries the offending path and the file’s first_header_line so the failure is explicit and diagnosable (replacing v1’s silent empty DataFrame).

Parameters:
  • path (str)

  • first_header_line (str)

Return type:

None