gnssrefl.nmea2snr module

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 that is not me 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. This is not used if sp3 orbit file used.

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.nmea_apriori_coords(station, llh, sp3)
gnssrefl.nmea2snr.nmea_translate(locdir, fname, snrfile, csnr, dec, year, doy, recv, sp3, gzip, orb, hour)

Reads and translates a NMEA file stored in locdir + fname. The naming convention assumed for the NMEA file is 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

Note from KL: I believe lowercase is also allowed (and preferred), 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.

At request of Felipe Nievinski, the ultra option (which points to GFZ ultrarapid orbits) will first look for the orbit on (requested doy, hour 0), then (doy-1, hour 0), and then (doy-1, hour 12). I do not think this first search is correct - but I don’t think it makes the code crash so I will keep it there for now.

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

  • recv (list of floats) – a priori Cartesian station coordinates for people using high quality orbits

  • sp3 (bool) – whether you use multi-GNSS sp3 file to do azimuth elevation angle calculations

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

  • orb (str) – requested orbit source

  • hour (int) – ultrarapid orbit hour

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.

KL: is this statement correct? “it only reads the GPGGA sentence (includes snr data) in NMEA files”

Parameters:

fname (str) – NMEA filename

Returns:

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

  • prn (list of int) – 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, doy, isnr, overwrite, dec, llh, recv, sp3, gzip, orb, hour)

runs the nmea2snr conversion code - ONE DAY AT A TIME (2024 March 16)

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 (int) – full year

  • doy (int) – day of year

  • 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)

  • recv (list of floats) – cartesian receiver coordinates (m)

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

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

  • orb (str) – requested orbit source

  • hour (int) – requested hour for ultrarapid orbit