Skip to content

Commit

Permalink
new version 3.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kristinemlarson committed Jun 5, 2024
1 parent 0dc64f1 commit 22097ef
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 8 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
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.4.0
fixed pretty major problem with default (rapid) orbits. updated to new file names and
locations for GFZ analysis center. I do not know when the old naming conventions will fail for ultra.

also added Wuhan ultra rapid orbit downloads from Wuhan to download_orbits.
It was previously added to rinex2snr

Changed spline output file in subdaily so that you can print out 999 at the gap values
(times during large gaps were previously not written out at all). per request, I also
told people the time tags are in UTC in the file header. this is currently on the command line
as gap_flag = T for putting in the gap flag.

## 3.3.1
rinex2snr: Added BKG access to high-rate files that are more than 6 months old.
This will allow parallel processing, though CDDIS does not (this is a restriction
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.3.1
# gnssrefl v3.4.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
12 changes: 11 additions & 1 deletion gnssrefl/sd_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ def subdaily_resids_last_stage(station, year, th, biasCor_rh, spline_at_GPS, fs,

return badpoints2

def RH_ortho_plot2( station, H0, year, txtdir, fs, time_rh, rh, gap_min_val,th,spline,delta_out,csvfile):
def RH_ortho_plot2( station, H0, year, txtdir, fs, time_rh, rh, gap_min_val,th,spline,delta_out,csvfile,gap_flag):
"""
Makes a plot of the final spline fit to the data. Output time interval controlled by the user.
Expand Down Expand Up @@ -972,6 +972,8 @@ def RH_ortho_plot2( station, H0, year, txtdir, fs, time_rh, rh, gap_min_val,th,
how often spline is printed, in seconds
csvfile : bool
print out csv instead of plain txt
gap_flag : bool
whether to write 999 in file where there are gaps
"""

firstpoint = float(th[0]); lastpoint = float(th[-1])
Expand Down Expand Up @@ -1014,6 +1016,7 @@ def RH_ortho_plot2( station, H0, year, txtdir, fs, time_rh, rh, gap_min_val,th,
fout = open(splinefileout,'w+')
vn = station + ' gnssrefl v' + str(g.version('gnssrefl'))
fout.write('{0:1s} {1:30s} \n'.format('%','station ' + vn))
fout.write('{0:1s} {1:60s} \n'.format('%','TIME TAGS ARE IN UTC/999 values mean there was a large gap and no spline value is available.'))
fout.write('{0:1s} {1:30s} \n'.format('%','This is NOT observational data - be careful when interpreting it.'))
fout.write('{0:1s} {1:30s} \n'.format('%','If the data are not well represented by the spline functions, you will '))
fout.write('{0:1s} {1:30s} \n'.format('%','have a very poor representation of the data. I am also writing out station '))
Expand Down Expand Up @@ -1078,6 +1081,13 @@ def RH_ortho_plot2( station, H0, year, txtdir, fs, time_rh, rh, gap_min_val,th,
fout.write('{0:15.7f}, {1:10.3f},{2:4.0f},{3:3.0f},{4:3.0f},{5:3.0f},{6:3.0f},{7:3.0f},{8:10.3f} \n'.format( mjd_new[i], rhout, theyear[i], xm[i], xd[i], xh[i], xmin[i], xs[i], H0-rhout))
else:
fout.write('{0:15.7f} {1:10.3f} {2:4.0f} {3:3.0f} {4:3.0f} {5:3.0f} {6:3.0f} {7:3.0f} {8:10.3f} \n'.format(mjd_new[i], rhout, theyear[i], xm[i], xd[i], xh[i], xmin[i], xs[i], H0-rhout))
else:
if gap_flag:
rhout = spline_new[i]
if csvfile:
fout.write('{0:15.7f}, {1:10.3f},{2:4.0f},{3:3.0f},{4:3.0f},{5:3.0f},{6:3.0f},{7:3.0f},{8:10.3f} \n'.format( mjd_new[i], 999, theyear[i], xm[i], xd[i], xh[i], xmin[i], xs[i], 999))
else:
fout.write('{0:15.7f} {1:10.3f} {2:4.0f} {3:3.0f} {4:3.0f} {5:3.0f} {6:3.0f} {7:3.0f} {8:10.3f} \n'.format(mjd_new[i], 999, theyear[i], xm[i], xd[i], xh[i], xmin[i], xs[i], 999))


fout.close()
Expand Down
8 changes: 6 additions & 2 deletions gnssrefl/subdaily.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,8 @@ def rhdot_correction2(station,fname,fname_new,pltit,outlierV,outlierV2,**kwargs)
a secondary knot value if you want the final output
to use a different one than the one used for outliers and
RH dot
gap_flag : bool, option
whether gaps are written as 999 in final output
"""
Expand All @@ -792,6 +794,9 @@ def rhdot_correction2(station,fname,fname_new,pltit,outlierV,outlierV2,**kwargs)

val = kwargs.get('txtdir',[])

gap_flag = kwargs.get('gap_flag',False)
print('gap flag ', gap_flag)

if len(val) == 0:
txtdir = xdir + '/Files/'
else:
Expand Down Expand Up @@ -971,7 +976,6 @@ def rhdot_correction2(station,fname,fname_new,pltit,outlierV,outlierV2,**kwargs)
th_obs = sd.mjd_to_obstimes(mjd0 + th-th[0])

if multiyear :
print('exiting')
th_obs = sd.mjd_to_obstimes(th)

fig=plt.figure(figsize=(10,6))
Expand Down Expand Up @@ -1182,7 +1186,7 @@ def rhdot_correction2(station,fname,fname_new,pltit,outlierV,outlierV2,**kwargs)
# pick up the orthometric height from the gnssir_analysis json
H0 = sd.find_ortho_height(station,extension)
# this writes out spline file and makes plot ....
sd.RH_ortho_plot2( station, H0, year, txtdir, fs, th[jj],biasCor_rh[jj],gap_min_val,th,spline,delta_out,writecsv)
sd.RH_ortho_plot2( station, H0, year, txtdir, fs, th[jj],biasCor_rh[jj],gap_min_val,th,spline,delta_out,writecsv,gap_flag)
print('\nRMS with frequency biases and RHdot taken out (m) ', np.round(newsigma,3) , '\n' )


Expand Down
9 changes: 6 additions & 3 deletions gnssrefl/subdaily_cl.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,12 @@ def parse_arguments():
parser.add_argument("-alt_sigma", default=None, type=str, help="boolean test for alternate Nievinski sigma definition. default is False")
parser.add_argument("-gap_min_val", default=None, type=float, help="min gap (hours) allowed in splinefit output file. default is 6 hours")
parser.add_argument("-knots2", default=None, type=int, help="Secondary knots value for final fit. default is to use original knots value.")
parser.add_argument("-gap_flag", default=None, type=str, help="if set to True/T, write 999 to spline fit for gaps")

args = parser.parse_args().__dict__

# convert all expected boolean inputs from strings to booleans
boolean_args = ['csv', 'plt', 'rhdot', 'testing','kplt','if_corr','hires_figs','apply_rhdot','alt_sigma']
boolean_args = ['csv', 'plt', 'rhdot', 'testing','kplt','if_corr','hires_figs','apply_rhdot','alt_sigma','gap_flag']
args = str2bool(args, boolean_args)

# only return a dictionary of arguments that were added from the user - all other defaults will be set in code below
Expand All @@ -66,7 +67,7 @@ def subdaily(station: str, year: int, txtfile_part1: str = '', txtfile_part2: st
azim1: int=0, azim2: int = 360, peak2noise: float = 0, kplt: bool = False,
subdir: str = None, delta_out : int = None , if_corr: bool = True, knots_test: int = 0,
hires_figs : bool=False, apply_rhdot : bool=True, fs: int = 10, alt_sigma: bool= False, gap_min_val: float=6.0,
year_end: int=None, knots2 : int=None):
year_end: int=None, knots2 : int=None, gap_flag: bool = False):
"""
Subdaily combines gnssir solutions and applies relevant corrections needed to measure water levels (tides).
As of January 2024, it will allow multiple years. You can also specify which day of year to start with, i.e.
Expand Down Expand Up @@ -211,6 +212,8 @@ def subdaily(station: str, year: int, txtfile_part1: str = '', txtfile_part2: st
last year of analysis period.
knots2 : int, optional
testing out allowing different knots for last spline
gap_flag : bool
whether you want gaps filled with 999 values in the final spline file
"""

print('<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
Expand Down Expand Up @@ -378,7 +381,7 @@ def subdaily(station: str, year: int, txtfile_part1: str = '', txtfile_part2: st
if_corr=if_corr,knots_test=knots_test,
hires_figs=hires_figs, apply_rhdot=apply_rhdot,fs=fs,
gap_min_val=gap_min_val,year=year, extension=extension,
knots2=knots2,csv=csv )
knots2=knots2,csv=csv,gap_flag=gap_flag)
if plt:
mplt.show()

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.3.1",
version="3.4.0",
author="Kristine Larson",
author_email="[email protected]",
description="A GNSS reflectometry software package ",
Expand Down

0 comments on commit 22097ef

Please sign in to comment.