gnssrefl.read_snr_files module

gnssrefl.read_snr_files.load_snr_time_filtered(obsfile, sec_min=None, sec_max=None)

Load an SNR file, parsing only rows within a seconds-of-day window.

Decompresses the full file (unavoidable for gzip), but only passes the matching rows to np.loadtxt, which is where most of the time is spent.

Parameters:
  • obsfile (str or Path) – Path to SNR file (plain text or .gz)

  • sec_min (float or None) – Keep rows with seconds > sec_min. None means no lower bound.

  • sec_max (float or None) – Keep rows with seconds < sec_max. None means no upper bound.

Returns:

data

Return type:

numpy array (N x cols) or None if no matching rows

gnssrefl.read_snr_files.read_snr(obsfile, buffer_hours=0, screenstats=False)

Load the contents of a SNR file into a numpy array, optionally including data from adjacent days.

Parameters:
  • obsfile (str) – name of the snrfile

  • buffer_hours (float, optional) – hours of data to include from adjacent days. If > 0, reads last buffer_hours from previous day and first buffer_hours from next day. Time tags are adjusted: prev day uses negative seconds, next day uses seconds > 86400. Default is 0 (single day only).

  • screenstats (bool, optional) – print verbose information about buffer data loading. Default is False.

Returns:

  • allGood (int) – 1, file was successfully loaded, 0 if not. apparently this variable was defined when I did not know about booleans….

  • f (numpy array) – contents of the SNR file

  • r (int) – number of rows in SNR file

  • c (int) – number of columns in SNR file