Skip to content

Commit

Permalink
version 3.3.0, error messages for too many obs now suggests -strip T …
Browse files Browse the repository at this point in the history
…and gfzrnx (Nischan)
  • Loading branch information
kristinemlarson committed May 22, 2024
1 parent 212ece5 commit efd19c9
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 19 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
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.3.0

Problem with how some RINEX 2.11 files on Windows were being read when
I checked for whether the file was compliant. numpy loadtxt assumes certain kinds of
strings and it will fail if it is not (the file that led to this change was Latin-1).
This is not apparently an issue in linux or on macos. Or when files are picked up from
an archive. Anyway, I put the check for compliance behind a try/except command. So effectively
it own't check whether the file is RINEX 2.11, but it is better than crashing.

## 3.2.2

Fixed some bugs in quickplt. Timing limits along the x-axis are now
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.2.2
# gnssrefl v3.3.0

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
10 changes: 5 additions & 5 deletions gnssrefl/gnsssnr.f
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ SUBROUTINE FOO(rawf,outf,sp3file,snrtype,decfac,errf)
c print*,'number of obs main code', nobs
c moving sites has been removed
if (nobs .gt. 25 .or. nobs .eq. 0) then
write(errid,*) 'Only obs types <= 25 allowed. You'
write(errid,*) 'can try using teqc to remove'
write(errid,*) 'unneeded observables'
write(errid,*) 'Only <= 25 observable types allowed. '
write(errid,*) 'You can try using -strip T when using'
write(errid,*) 'rinex2snr or use gfzrnx'
return
endif

Expand Down Expand Up @@ -559,8 +559,8 @@ subroutine read_header_25obs(fileID,rawf,xrec,yrec,zrec,
c exit if more than 20 observables
if (nobs.gt.25) then
write(fid,*)'this code only supports <=25 observ types'
write(fid,*)'If your file has more, reduce using teqc '
write(fid,*)'teqc -O.obs S1+S2+S5+S6+S8 should work'
write(fid,*)'try using -strip T when using rinex2snr'
write(fid,*)'Or you could try using gfzrnx'
return
endif
c KL 19jan09 allowing more lines of OBS types
Expand Down
6 changes: 3 additions & 3 deletions gnssrefl/gnsssnrbigger.f
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ SUBROUTINE FOO(rawf,outf,sp3file,snrtype,decfac,errf)
c print*,'number of obs main code', nobs
c moving sites has been removed
if (nobs .gt. 25 .or. nobs .eq. 0) then
write(errid,*) 'Only obs types <= 25 allowed. You'
write(errid,*) 'can try using teqc to remove'
write(errid,*) 'unneeded observables'
write(errid,*) 'Only works with <= 25 obs types.'
write(errid,*) 'You can try -strip T in rinex2snr'
write(errid,*) 'or use gfzrnx'
return
endif

Expand Down
23 changes: 16 additions & 7 deletions gnssrefl/gpssnr.f
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ SUBROUTINE FOO(rawf,outf,broadf,snrtype,decfac,errf)
real*8 c
parameter (c = 0.299792458D+09)

integer stderr
integer stderr,iuseful,k
parameter (stderr=6)
character*80 inline
character*4 station
Expand Down Expand Up @@ -137,17 +137,25 @@ SUBROUTINE FOO(rawf,outf,broadf,snrtype,decfac,errf)
write(errid,*)mess
return
endif
if (iobs(6) .eq. 0) then
mess='ERROR:no L1 SNR data - exiting'
iuseful = 0
do k = 6, 11
if (iobs(k) .gt. 0) then
iuseful = iuseful + 1
endif
enddo
if (iuseful .eq. 0) then
mess='ERROR:no SNR data found. Fatal error'
write(errid,*)mess
return
endif

c if (iobs(6) .eq. 0) then
c return
c endif
if (nobs .gt. 20) then
mess = 'ERROR: this code only works for <= 20 obs types'
write(errid,*)mess
mess = '1 solution is to to run teqc on the original RINEX'
write(errid,*)mess
mess = 'with -O.obs S1+S2+S5 as the option, rerun.'
mess = 'try using -strip T when running rinex2snr'
write(errid,*)mess
return
endif
Expand Down Expand Up @@ -567,8 +575,9 @@ subroutine read_header_20obs(fileID,rawf,xrec,yrec,zrec,
read(line, fmt='(I6)') nobs
c exit if more than 20 observables
if (nobs.gt.20) then
mess ='ERROR:supports <=20 observ types'
mess ='ERROR:this code only supports <=20 observ types'
write(fid,*) mess
write(fid,*) nobs
return
endif
c KL 19jan09 allowing more lines of OBS types
Expand Down
4 changes: 2 additions & 2 deletions gnssrefl/rinex2snr.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ def run_rinex2snr(station, year, doy, isnr, orbtype, rate,dec_rate,archive, nol
rinext =float(np.loadtxt(r,usecols=0,dtype='str',max_rows=1))
print('Apparent Rinex version', rinext)
if (rinext != 2.11):
print('Your file is not RINEX v2.11 which is what you told the code it was. Exiting')
sys.exit()
print('Your file is not RINEX v2.11 which is what you told the code it was.')
#sys.exit()

except:
print('I had problems confirming RINEX version. Will ignore that for now.')
Expand Down
6 changes: 6 additions & 0 deletions gnssrefl/rinex2snr_cl.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ def rinex2snr(station: str, year: int, doy: int, snr: int = 66, orb: str = None,
Some archives have been set to non-compliant with this feature. Please look in the first few lines
of code to see the names of these archives.
In general, you should not make RINEX 2.11 files with a huge number of observables. Especially do not put
Doppler data in your file. If you have more than 25 observables (multi-GNSS) or 20 (GPS only), the code
should send an error message to a log. The location of that log is printed to the screen. If you don't want
to remake your RINEX files, you can try the -strip T option, which I believe uses gfzrnx to strip out everything
except for SNR data.
Real-time users should use ultra, wum, or wum2
Default orbits are GPS only until day of year 137, 2021 when rapid GFZ orbits became available. If you still want to use
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.2.2",
version="3.3.0",
author="Kristine Larson",
author_email="[email protected]",
description="A GNSS reflectometry software package ",
Expand Down

0 comments on commit efd19c9

Please sign in to comment.