gnssrefl.subdaily_cl module

gnssrefl.subdaily_cl.main()
gnssrefl.subdaily_cl.parse_arguments()
gnssrefl.subdaily_cl.subdaily(station: str, year: int, txtfile_part1: str = '', txtfile_part2: str = None, csv: bool = False, plt: bool = True, spline_outlier1: float = None, spline_outlier2: float = None, knots: int = None, sigma: float = None, extension: str = None, rhdot: bool = True, doy1: int = 1, doy2: int = 366, testing: bool = True, ampl: float = [], h1: float = 0.4, h2: float = 300.0, 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, 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. -doy1 300 and -doy2 330 will do that range in a single year, or you could specific doy1 and doy2 as linked to the start and stop year (year and year_end)

In general this code is meant to be used at sites with tidal signals. If you have a site without tidal signals, you should consider using daily_avg instead. If you would still like to use this code for rivers and lakes, you should change the defaults for the spline fits. For tidal sites, 8 knots per day is the default. For nearly stationary surfaces, as you would expect for a lake or river, you should use many fewer knots per day.

This code calculates and applies various corrections. New Reflector Height values are added to the output files as new columns. If you run the code but continue to assume the “good answers” are in still in column 3, you are essentially not using the code at all.

As of version 3.1.4 you can use some of the subdaily optional inputs from the gnssir_input created json. See gnssir_input for details.

As of version 2.0.0:

The final output of subdaily is a smooth spline fit to reflector heights (RH) which has been adjusted to mean sea level (meters). For this to be accurate, the user is asked to provide the orthometric height of the L1 GPS antenna phase center. This value should be stored as Hortho in the gnssir analysis strategy file (ssss.json where ssss is the 4 character station name). The output water levels are then defined as Hortho minus RH. If the user does not provide Hortho, one is computed from the station ellipsoidal height stored in the gnssir analysis strategy file and EGM96.

The subdaily code has two main sections.

I. Summarize the retrievals (how many retrievals per constellation), identify and remove gross outliers, provide plots to allow a user to evaluate Quality Control parameters. The solutions can further be edited from the command line (i.e. restrict the RH using -h1 and -h2, in meters, or azimuths using -azim1 and -azim2)

  1. This section has the following goals:

  • removes more outliers based on a spline fit to the RH retrievals

  • calculates and applies RHdot correction

  • removes an interfrequency (IF) bias. All solutions are then relative to GPS L1.

txtfile_part1 is optional input if you want to skip concatenating daily gnssir output files and use your own file. Make sure results are in the same format.

txtfile_part2 is optional input that skips part 1 and uses this file as input to the second part of the code.

Examples

subdaily at01 2023 -plt F

for station at01, all solutions in 2023 but no plots to the screen

subdaily at01 2023 -doy1 15 -doy2 45

for all solutions in 2023 between days of year 15 through 45

subdaily at01 2023 -h2 14 -if_corr F

for all solutions in 2023 but with max RH set to 14 meters and interfrequency correction not applied

subdaily at01 2022 -year_end 2023

analyze all data for years 2022 and 2023

subdaily at03 2022 -azim1 180 -azim2 270

restrict solutions to azimuths between 180 and 270

Parameters:
  • station (str) – 4 character id of the station.

  • year (int) – full year

  • txtfile_part1 (str, optional) – input File name for part 1.

  • txtfile_part2 (str, optional) – Input filename for part 2.

  • csv (bool, optional) – Set to True if you would like csv in addition to plain txt. default is False.

  • plt (bool, optional) – To print plots to screen or not. default is True.

  • spline_outlier1 (float, optional) – Outlier criterion used in first splinefit, before RHdot (m)

  • spline_outlier2 (float, optional) – Outlier criterion used in second splinefit, after IF & RHdot (meters)

  • knots (integer, optional) – Knots per day, spline fit only. default is 8.

  • sigma (float, optional) – Simple sigma outlier criterion (e.g. 1 for 1sigma, 3 for 3sigma) default is 2.5

  • extension (str, optional) – Solution subdirectory.

  • rhdot (bool, optional) – Set to True to turn on spline fitting for RHdot correction. default is True.

  • doy1 (int, optional) – Initial day of year, default is 1.

  • doy2 (int, optional) – End day of year. Default is 366.

  • testing (bool, optional) – Set to False for older code. default is now True.

  • ampl (float, optional) – New amplitude constraint. Default is to do nothing. Now allows a list of amplitude values for the frequencies listed in your json. You have to use the same order of frequencies - but do not have to list them all, i.e. if you had fr 1 20 101 102 and you only wanted to use GPS, you could provide just two ampl values and it would return L1 and L2 GPS. If you had a subdaily value stored before, that is currently restricted to one value for all frequencies. That can be changed if someone submits a PR.

  • azim1 (int, optional) – minimum azimuth. Default is 0.

  • azim2 (int, optional) – Max azimuth. Default is 360.

  • h1 (float, optional) – lowest allowed reflector height in meters. Default is 0.4

  • h2 (float, optional) – highest allowed reflector height in meters. Default is 300

  • peak2noise (float, optional) – New peak to noise constraint. Default is 0.

  • kplt (bool, optional) – plot for kristine

  • subdir (str, optional) – name for output subdirectory in REFL_CODE/Files

  • delta_out (int, optional) – how frequently - in seconds - you want smooth spline model output written default is 1800 seconds

  • if_corr (bool, option) – whether you want the inter-frequency removed default is true

  • hires_figs (bool, optional) – whether high resolution figures are made

  • apply_rhdot (bool, optional) – whether you want the RH dot correction applied for a lake or river you would not want it to be.

  • fs (int, optional) – fontsize for Figures. default is 10 for now.

  • alt_sigma (bool, optional) – whether you want to use Nievinski definition for outlier criterion. in part 1 of the code (the crude outlier detector)

  • gap_min_val (float, optional) – removes splinefit values from output txt and plot for gaps bigger than this value, in hours

  • year_end (int, optional) – 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