gnssrefl.nmea2snr_cl module
- gnssrefl.nmea2snr_cl.main()
main script for the nmea2snr conversion code
Looks for NMEA files in $REFL_CODE/nmea/ssss/2023 for station ssss and year 2023 or $REFL_CODE/nmea/SSSS/2023 for station SSSS. Personally I prefer lowercase station names, but I believe the code allows you to do either.
Files are named: SSSS1520.23.A or ssss1520.23.A
day of year is 152 and year is 2023 in this example
The SNR files are stored with upper case if given upper case, lower case if given lower case. Currently I have left the last character in the file name as it was given to me - capital A. If this should be lower case for people that use lowercase station names, please let me know.
As far as I can tell, the necessary fields in the NMEA files are GPGGA and GPGSV.
Originally this code used interpolations of the az and el NMEA fields. I have decided this is DANGEROUS. If you really want to use those low-quality measurements, you can use them by saying -sp3 F.
The default usage is to use multi-GNSS orbits from GFZ. To compute az-el, you need to provide a priori station coordinates. You can submit those on the command line or it will read them from the $REFL_CODE/input/ssss.json file (for station ssss or SSSS) if it exists.
As of 2023 September 14, the SNR files are defined in GPS time, which is how the file is defined. Prior to version 1.7.0, if you used the sp3 option, the SNR files were written in UTC. This led to the orbits being propagated to the wrong time and thus az-el values are biased. The impact on RH is not necessarily large - but you should be aware. The best thing to do is remake your SNR files.
- Parameters:
station (str) – 4 ch name of station
year (int) – full year
doy (int) – day of year
snr (str, optional) – snr file type, default is 66
overwrite (bool, optional) – whether make a new SNR file even if one already exists
dec (int, optional) – decimation in seconds
lat (float, optional) – latitude, deg, required for sp3file if json file not available
lon (float, optional) – longitude, deg, required for sp3file if json file not available
height (float, optional) – height, m, required for sp3file if json file not available
sp3 (str, optional) – set to False or F to use low quality NMEA values for az and el angles. this is changed to a boolean in the nmea2snr command line tool.
risky (str, optional) – T or True if you want to use the NMEA az-el values instead of sp3 values. NMEA-based az-el values cannot be trusted, and thus the code is asking you to confirm that you know you are doing something that is risky.
gzip (bool, opt) – compress SNR files after creation. Default is true
Examples
- nmea2snr wesl 2023 8 -dec 5
makes SNR file with decimation of 5 seconds with good orbits
- nmea2snr wesl 2023 8
makes SNR file with original sampling rate and good orbits
- nmea2snr xyz2 2023 8 -lat 40.2342 -lon -120.32424 -height 12
makes SNR file with user provided station coordinates and good orbits