Skip to content

Commit

Permalink
fixed nmea2snr access to ultra rapid orbits
Browse files Browse the repository at this point in the history
  • Loading branch information
kristinemlarson committed Jun 16, 2024
1 parent bb8fdd0 commit 80b7725
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 16 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ...
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
7 changes: 6 additions & 1 deletion gnssrefl/gps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand All @@ -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

19 changes: 12 additions & 7 deletions gnssrefl/nmea2snr.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,27 +96,32 @@ 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:
xf,orbdir,foundit = g.new_ultra_gfz_orbits(year-1,12,31)
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
Expand Down
18 changes: 12 additions & 6 deletions gnssrefl/xnmeasnr.f
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
]
setup(
name="gnssrefl",
version="3.5.1",
version="3.5.2",
author="Kristine Larson",
author_email="[email protected]",
description="A GNSS reflectometry software package ",
Expand Down

0 comments on commit 80b7725

Please sign in to comment.