From 80b7725c16cc63b507edca6875d61c72bea5c9dc Mon Sep 17 00:00:00 2001 From: kristinemlarson Date: Sun, 16 Jun 2024 08:19:50 -0700 Subject: [PATCH] fixed nmea2snr access to ultra rapid orbits --- CHANGELOG.md | 14 ++++++++++++++ README.md | 2 +- gnssrefl/gps.py | 7 ++++++- gnssrefl/nmea2snr.py | 19 ++++++++++++------- gnssrefl/xnmeasnr.f | 18 ++++++++++++------ setup.py | 2 +- 6 files changed, 46 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3aecc9929a..ab6d654dfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,20 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## 3.5.2 + +Fixed bug in nmea2snr that used old directories for (rapid?) gfz orbits. +Updated the wuhan orbit source so that it correctly translates a multi-day SP3 file. +Previously it was set to only allow one day sp3 file, depending on sampling rate. +The same problem was most likely impacting the GFZ orbits as well. Not sure. + + +It no longer looks for final GFZ GNSS files after doy 153/year 2024 as that +would require my writing a new function to access GFZ final orbit directories. +This is unlikely to be a huge problem for chipsets - and the Wuhan orbits are +perfectly good for this purpose and include all four systems. The GFZ rapids +have historically not had Beidou in them. + ## 3.5.1 ... Had to change the source of the ultra rapid orbits from GFZ ... diff --git a/README.md b/README.md index 9d5476198c..47d251c8c7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# gnssrefl v3.5.1 +# gnssrefl v3.5.2 If you use this code in any presentation or publication, you are expected to cite either this github repository or the gnssrefl DOI, which is given just below. diff --git a/gnssrefl/gps.py b/gnssrefl/gps.py index 97208b6bdf..6f10b410aa 100644 --- a/gnssrefl/gps.py +++ b/gnssrefl/gps.py @@ -3636,6 +3636,7 @@ def get_orbits_setexe(year,month,day,orbtype,fortran): else: print('I do not recognize the orbit type you tried to use: ', orbtype) + print('\n') return foundit, f, orbdir, snrexe def warn_and_exit(snrexe,fortran): @@ -5915,6 +5916,7 @@ def ga_highrate(station9,year,doy,dec,deleteOld=True): return print('WARNING 1: Have some coffee, downloading 96 files of high-rate GPS data takes a long time.') print('WARNING 2: Downloading 96 files of high-rate GPS data from Australia takes an even longer time.') + print('WARNING 3: Unless you are in Australia ...') QUERY_PARAMS, headers = k.ga_stuff_highrate(station9, year, doy) API_URL = 'https://data.gnss.ga.gov.au/api/rinexFiles/' request = requests.get(API_URL, QUERY_PARAMS, headers=headers) @@ -6536,6 +6538,8 @@ def gbm_orbits_direct(year,month,day): else: gns = 'ftp://ftp.gfz-potsdam.de/pub/GNSS/products/mgex/' + cgpsweek + '_IGS20/' + # this has now been changed again ... sigh + fdir = os.environ['ORBITS'] + '/' + cyyyy + '/sp3' littlename = 'gbm' + str(gpsweek) + str(int(sec/86400)) + '.sp3' bigname = 'GFZ0MGXRAP_' + cyyyy + cdoy + '0000_01D_05M_ORB.SP3' @@ -7109,7 +7113,7 @@ def new_ultra_gfz_orbits(year,month,day): return longname, fdir, foundit else: - print('Try First way to download : ',url) + print('Try first protocol to download : ',url) fullname = fdir + '/' + littlename if os.path.isfile(fullname): foundit = True @@ -7131,5 +7135,6 @@ def new_ultra_gfz_orbits(year,month,day): if os.path.isfile(littlename): store_orbitfile(littlename,year,'sp3') ; foundit = True + print('/n') return littlename, fdir, foundit diff --git a/gnssrefl/nmea2snr.py b/gnssrefl/nmea2snr.py index 80f17a0669..eb3f9b3529 100644 --- a/gnssrefl/nmea2snr.py +++ b/gnssrefl/nmea2snr.py @@ -96,17 +96,18 @@ def nmea_translate(locdir, fname, snrfile, csnr, dec, year, doy, recv, sp3, gzip missing = True station = fname.lower() ; station = station[0:4] yy,month,day, cyyyy, cdoy, YMD = g.ydoy2useful(year,doy) - gfz_date = 2024 + doy/365.25 # when we added the new GFZ directory to gnssrefl + gfz_date = 2024 + 153/365.25 # when we added the new GFZ directory to gnssrefl if sp3: # first try to find precise because they have beidou - xf,orbdir,foundit=g.gbm_orbits_direct(year,month,day) - # try to find it elsewhere - if not foundit: - print('Could not find the precise GNSS orbits from GFZ. ') + # but have not done this for new location of final orbits yet + if (year+doy/365.25) < gfz_date: + xf,orbdir,foundit=g.gbm_orbits_direct(year,month,day) + else: + print('Could not find the precise GNSS orbits from GFZ. Try Rapid GFZ ') xf,orbdir,foundit=g.rapid_gfz_orbits(year,month,day) if not foundit: - print('Could not find the rapid orbits from GFZ. ') + print('Could not find the rapid orbits from GFZ. Try ultra') if (year + doy/365.25) > gfz_date: print('Use new GFZ directory for ultra rapid orbits with the long filenames') if doy == 1: @@ -114,9 +115,13 @@ def nmea_translate(locdir, fname, snrfile, csnr, dec, year, doy, recv, sp3, gzip else: xf,orbdir,foundit = g.new_ultra_gfz_orbits(year,doy-1,0) else: + print('use old GFZ directory structure') xf,orbdir,foundit = g.ultra_gfz_orbits(year,month,day,0) if not foundit: - print('Could not find the ultrarapid orbits from GFZ. Exiting') + print('Could not find the ultrarapid orbits from GFZ. Trying Wuhan') + xf,orbdir,foundit = g.get_wuhan_orbits(year,month,day) + if not foundit: + print('Out of luck - could not find a good orbit file for you') return # define orbit file name diff --git a/gnssrefl/xnmeasnr.f b/gnssrefl/xnmeasnr.f index fc0ae6c6e5..5ba1a62a11 100644 --- a/gnssrefl/xnmeasnr.f +++ b/gnssrefl/xnmeasnr.f @@ -16,7 +16,8 @@ SUBROUTINE FOO(rawf,outf,sp3file,snrtype,errf) parameter (maxsat = 200) parameter (maxob = 25) parameter (maxGNSS = 400) - parameter (np= 288) +c parameter (np= 288) + parameter (np= 864) real*8 c parameter (c = 0.299792458D+09) @@ -196,7 +197,8 @@ subroutine read_sp3_200sats(inputfile, gps_weeks, parameter (maxsat = 200) parameter (maxob = 25) parameter (maxGNSS = 400) - parameter (np= 288) + parameter (np= 864) +c parameter (np= 288) real*8 c parameter (c = 0.299792458D+09) @@ -396,7 +398,8 @@ subroutine fill_pointer(nsat,satID,satnames,haveorbit,ipointer) parameter (maxsat = 200) parameter (maxob = 25) parameter (maxGNSS = 400) - parameter (np= 288) + parameter (np= 864) +c parameter (np= 288) real*8 c parameter (c = 0.299792458D+09) @@ -465,7 +468,8 @@ subroutine pick_9points(sp3_nsat, sp3_satnames, sp3_gps_weeks, parameter (maxsat = 200) parameter (maxob = 25) parameter (maxGNSS = 400) - parameter (np= 288) + parameter (np= 864) +c parameter (np= 288) real*8 c parameter (c = 0.299792458D+09) @@ -586,7 +590,8 @@ subroutine get_azel_sp3(tc, prn, stationXYZ,East,North,Up, parameter (maxsat = 200) parameter (maxob = 25) parameter (maxGNSS = 400) - parameter (np= 288) +c parameter (np= 288) + parameter (np= 864) real*8 c @@ -896,7 +901,8 @@ subroutine write_gnss_to_file(outID, prn, tod, s1,s2,s5,az, parameter (maxsat = 200) parameter (maxob = 25) parameter (maxGNSS = 400) - parameter (np= 288) + parameter (np= 864) +c parameter (np= 288) real*8 c parameter (c = 0.299792458D+09) diff --git a/setup.py b/setup.py index 9a72e8dc58..404cc2f438 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ ] setup( name="gnssrefl", - version="3.5.1", + version="3.5.2", author="Kristine Larson", author_email="kristinem.larson@gmail.com", description="A GNSS reflectometry software package ",