Skip to content

Commit

Permalink
change rinex2snr to pick up rinex3 files from /Users/kristine/Documen…
Browse files Browse the repository at this point in the history
…ts/Research/YYYY/rinex/ssss
  • Loading branch information
kristinemlarson committed Mar 8, 2024
1 parent 481f87c commit d5df02b
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 15 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
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/).

##
added RINEX 3 pickups from $REFL_CODE/YYYY/rinex

## 2.5.2

Mostly updating use cases
Expand Down
10 changes: 5 additions & 5 deletions docs/pages/quick_recall.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ those discussion links will likely go away in the not very distant future.

* [max_resolve_RH](https://gnssrefl.readthedocs.io/en/latest/api/gnssrefl.max_resolve_RH_cl.html)

* [quickplt](https://gnssrefl.readthedocs.io/en/latest/api/gnssrefl.quickplt.html)

* [ymd](https://gnssrefl.readthedocs.io/en/latest/api/gnssrefl.ymd.html), [ydoy](https://gnssrefl.readthedocs.io/en/latest/api/gnssrefl.ydoy.html)

* [installexe](https://gnssrefl.readthedocs.io/en/latest/api/gnssrefl.installexe.html) Installs executables for pip clone/pip install users

## Environmental Products

Expand All @@ -56,17 +61,12 @@ those discussion links will likely go away in the not very distant future.

* [check_rinex_file](https://gnssrefl.readthedocs.io/en/latest/api/gnssrefl.check_rinex_file.html)
* [gpsweek](https://gnssrefl.readthedocs.io/en/latest/api/gnssrefl.gpsweek.html)
* [installexe](https://gnssrefl.readthedocs.io/en/latest/api/gnssrefl.installexe.html)
* [llh2xyz](https://gnssrefl.readthedocs.io/en/latest/api/gnssrefl.llh2xyz.html)
* [max_resolve_RH](https://gnssrefl.readthedocs.io/en/latest/api/gnssrefl.max_resolve_RH_cl.html)
* [mjd](https://gnssrefl.readthedocs.io/en/latest/api/gnssrefl.mjd.html)
* [query_unr](https://gnssrefl.readthedocs.io/en/latest/api/gnssrefl.query_unr.html)
* [quickplt](https://gnssrefl.readthedocs.io/en/latest/api/gnssrefl.quickplt.html)
* [rinex3_rinex2](https://gnssrefl.readthedocs.io/en/latest/api/gnssrefl.rinex3_rinex2.html)
* [rinex3_snr](https://gnssrefl.readthedocs.io/en/latest/api/gnssrefl.rinex3_snr.html)
* [rinex_coords](https://gnssrefl.readthedocs.io/en/latest/api/gnssrefl.rinex_coords.html)
* [smoosh](https://gnssrefl.readthedocs.io/en/latest/api/gnssrefl.smoosh.html)
* [smoosh_snr](https://gnssrefl.readthedocs.io/en/latest/api/gnssrefl.smoosh_snr.html)
* [xyz2llh](https://gnssrefl.readthedocs.io/en/latest/api/gnssrefl.xyz2llh.html)
* [ymd](https://gnssrefl.readthedocs.io/en/latest/api/gnssrefl.ymd.html)
* [ydoy](https://gnssrefl.readthedocs.io/en/latest/api/gnssrefl.ydoy.html)
2 changes: 1 addition & 1 deletion docs/pages/sc_media2024.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Return to [2024 GNSS-IR Short Course](https://gnssrefl.readthedocs.io/en/latest/
- [Q & A](https://morefunwithgps.com/public_html/sc2024/Day1-QAReport.csv)

## Day 2
- Theory for Water Levels, Simon Williams
- [Theory for Water Levels](https://morefunwithgps.com/public_html/sc2024/Day2-Williams.pdf), Simon Williams
- [Examples using gnssrefl](https://morefunwithgps.com/public_html/sc2024/Day2-Examples.pdf), Kristine Larson
- [invsnr technique](https://morefunwithgps.com/public_html/sc2024/Day2-invsnr_slides.pdf), Kristine Larson
- [IAG working group](https://morefunwithgps.com/public_html/sc2024/Day2-WG.pdf), Makan Karegar
Expand Down
24 changes: 18 additions & 6 deletions gnssrefl/rinex2snr.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def run_rinex2snr(station, year_list, doy_list, isnr, orbtype, rate,dec_rate,arc
translator : str
hybrid (default), fortran, or python
hybrid uses fortran within the python code
hybrid uses fortran within he python code
srate : int
sample rate for RINEX 3 files
Expand Down Expand Up @@ -257,6 +257,20 @@ def run_rinex2snr(station, year_list, doy_list, isnr, orbtype, rate,dec_rate,arc
if screenstats:
print('Try to gunzip ', r3gz)
subprocess.call(['gunzip', r3gz])

# have not found the rinex 3 file
if not os.path.exists(r3):
local_rinex3_dir = os.environ['REFL_CODE'] + '/' + cyyyy + '/rinex/' + station + '/'
print('try looking for RINEX 3 in ', local_rinex3_dir)
lrinex3 = local_rinex3_dir+r3
if os.path.exists(lrinex3):
subprocess.call(['cp', lrinex3, '.'])
else:
lrinex3 = local_rinex3_dir+r3cmpgz
if os.path.exists(lrinex3):
subprocess.call(['cp', lrinex3, '.']);
deletecrx = True
translated, rnx_filename = go_from_crxgz_to_rnx(r3cmpgz,deletecrx)
if os.path.exists(r3):
rinext =float(np.loadtxt(r3,usecols=0,dtype='str',max_rows=1))
print('Apparent Rinex version', rinext)
Expand All @@ -272,11 +286,9 @@ def run_rinex2snr(station, year_list, doy_list, isnr, orbtype, rate,dec_rate,arc
else:
print('Something about the RINEX 3-2 conversion did not work')
else:
print('You Chose the No Look Option, but did not provide the needed RINEX3 file.')
print('I checked the rnx, rnx.gz, and crx.gz file endings that were in the local directory')
print('Which would be ', r3, ' when gunzipped and translated.')
print('Unfortunately the code does not currently search $REFL_CODE/YYYY/rinex for RINEX 3 files.')
print('This would be a good option to add - please submit a PR.')
print('You Chose the No Look Option, but did not provide the needed RINEX3 file ', r3)
print('I looked for files ending with rnx, rnx.gz, and crx.gz in the local directory')
print('I looked for files ending with rnx and crx.gz in $REFL_CODE/YYYY/rinex for your station')

else:
if screenstats:
Expand Down
9 changes: 6 additions & 3 deletions gnssrefl/rinex2snr_cl.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ def rinex2snr(station: str, year: int, doy: int, snr: int = 66, orb: str = None,
Beyond that, you can try the -mk T option which searches other places, i.e. $REFL_CODE/rinex/ etc. I do not recommend
that you use this option, but it is there.
For RINEX 3 files, I believe it checks for crx.gz, rnx, or rnx.gz endings in the local directory. It does NOT
check the $REFL_CODE/YYYY/rinex directory. If someone would like to add that capability, that would be great.
And it looks like I do not delete the RINEX 3 files (though I do delete the RINEX 2.11 files).
For RINEX 3 files, I believe it checks for crx.gz, rnx, or rnx.gz endings in the local directory. It
checks the $REFL_CODE/YYYY/rinex directory for the crx.gz and rnx versions.
It looks like I do not delete the RINEX 3 files (though I do delete the RINEX 2.11 files).
FAQ: what is rate anad srate? rate is telling the code which folder to use because archives always have
files in different directories depending on sample rate. srate is for RINEX 3 files only because RINEX 3
Expand Down Expand Up @@ -144,6 +144,9 @@ def rinex2snr(station: str, year: int, doy: int, snr: int = 66, orb: str = None,
rinex2snr mchl00aus 2022 15 -orb rapid -archive ga
30 sec RINEX3 data for mchl00aus and Geoscience Australia
rinex2snr mchl00aus 2022 15 -orb rapid -nolook T
works if the RINEX 3 crx.gz or rnx files are in $REFL_CODE/2022/rinex/mchl
rinex2snr mchl00aus 2022 15 -orb rapid -samplerate 30 -nolook T
This should analyze a RINEX 3 file if it exists in your local working directory.
it will not search anywhere else for the file. It should be a 30 sec, 1 day file
Expand Down

0 comments on commit d5df02b

Please sign in to comment.