gnssrefl.nmea2snr module

gnssrefl.nmea2snr.NMEA2SNR(locdir, fname, snrfile, csnr, dec, year, doy, llh, sp3, gzip)

Reads and translates the NMEA file stored in locdir + fname

Naming convention assumed for NMEA files : SSSS1520.23.A

where SSSS is station name, day of year is 152 and year is 2023

locdir is generally $REFL_CODE/nmea/SSSS/yyyy where yyyy is the year number and SSSS is the station name

I believe lowercase is also allowed, but the A at the end is still set to be upper case

(I believe) The SNR files are stored with upper case if given upper case, lower case if given lower case.

Parameters:
  • locdir (str) – directory where your NMEA files are kept

  • fname (str) – NMEA filename

  • snrfile (str) – name of output file for SNR data

  • csnr (str) – snr option, i.e. ‘66’ or ‘99’

  • dec (int) – decimation value in seconds

  • year (int) – full year

  • doy (int) – day of year

  • llh (list of floats) – station location, lat (deg), lon(deg), height (m)

  • sp3 (bool) – whether you use multi-GNSS sp3 file to do azimuth elevation angle calculations currently this only uses the GFZ rapid orbit.

  • gzip (bool) – gzip compress snrfiles. No idea if it is used here … as this compression should happen in the calling function, not here

gnssrefl.nmea2snr.angle_range_positive(ang)

someone should document this

Parameters:

ang

gnssrefl.nmea2snr.azimuth_diff(azim1, azim2)

someone should document this

Parameters:
  • azim1

  • azim2

Return type:

???

gnssrefl.nmea2snr.azimuth_diff1(azim)
Parameters:

azim

gnssrefl.nmea2snr.azimuth_diff2(azim1, azim2)
gnssrefl.nmea2snr.azimuth_mean(azim1, azim2)

someone should document this

Parameters:
  • azim1 (list of floats ?) – azimuth degrees

  • azim2 (list of floats) – azimuth degrees

Returns:

azim – azimuths in degrees

Return type:

list of floats ?

gnssrefl.nmea2snr.elev_limits(snroption)

Given a snr option, return the elevation angle limits

Parameters:

snroption (int) – snrfile number

Returns:

  • emin (float) – min elevation angle (degrees)

  • emax (float) – max elevation angle (degrees)

gnssrefl.nmea2snr.fix_angle_azimuth(time, angle, azimuth)

interpolate elevation angles and azimuth to retrieve decimal values thru time this is for NMEA files.

Parameters:
  • time (list of floats) – GPS seconds of the week

  • angle (list of floats) – elevation angles (degrees)

  • azimuth (list of floats) – azimuth angles (degrees)

Returns:

  • angle_fixed (list of floats) – interpolated elevation angles

  • azim_fixed (list of floats) – interpolated azimuth angles

gnssrefl.nmea2snr.quickname(station, year, cyy, cdoy, csnr)

Creates a full name of the snr file name (i.e. including the path) >>>> Checks that directories exist.

Parameters:
  • station (str) – 4 ch station name

  • year (int) – full year

  • cyy (str) – two character year

  • cdoy (str) – three character day of year

  • csnr (str) – snr type, e.g. ‘66’

Returns:

fname – output filename

Return type:

str

gnssrefl.nmea2snr.read_nmea(fname)

reads a NMEA file. it only reads the GPGGA sentence (includes snr data) in NMEA files

Parameters:

fname (string) – NMEA filename

Returns:

  • t (list of integers) – timetags in GPS seconds

  • prn (list of integers) – GPS satellite numbers

  • az (list of floats ??) – azimuth values (degrees)

  • elv (list of floats ??) – elevation angles (degrees)

  • snr (list of floats) – snr values

  • freq (list of ???) – apparently frequency values -

gnssrefl.nmea2snr.run_nmea2snr(station, year_list, doy_list, isnr, overwrite, dec, llh, sp3, gzip)

runs the nmea2snr conversion code

Looks for NMEA files in $REFL_CODE/nmea/ssss/2023 for station ssss and year 2023. I prefer lowercase station names, but I believe the code allows both upper and lower case.

Files are named: SSSS1520.23.A

where SSSS is station name, day of year 152 and the last two characters of the 2023 as the middle value.

The SNR files are stored with upper case if given upper case, lower case if given lower case.

Parameters:
  • station (str) – 4 ch name of station

  • year_list (list of integers) – years

  • doy_list (list of days of year) – days of years

  • isnr (int) – snr file type

  • overwrite (bool) – whether make a new SNR file even if one already exists

  • dec (int) – decimation in seconds

  • llh (list of floats) – lat and lon (deg) and ellipsoidal ht (m)

  • sp3 (bool) – whether you want to use GFZ rapid sp3 file for the orbits

  • gzip (bool) – whether snrfiles are gzipped after creation