gnssrefl.snowdepth_cl module

gnssrefl.snowdepth_cl.main()
gnssrefl.snowdepth_cl.parse_arguments()
gnssrefl.snowdepth_cl.snowdepth(station: str, year: int, minS: float = None, maxS: float = None, longer: bool = False, plt: bool = True, bare_date1: str = None, bare_date2: str = None, plt_enddate: str = None, simple: bool = False, medfilter: float = None, ReqTracks: int = None, barereq_days: int = 15, fr: int = None, hires_figs: bool = False)

Calculates snow depth for a given station and water year. Before you run this code you must have run gnssir for each day of interest.

You can then run daily_avg to concatenate the results or you can input appropriate values to optional inputs medfilter and ReqTracks.

Currently set for northern hemisphere constraints. This could easily be fixed for the southern hemisphere by reading the json input file. Default values use the median of September results to set “bare soil value” These can be overriden with bare_date1 and bare_date2 (as one would do in Alaska)

Output is currently written to a plain text file and a plot is written to a png file. Both are located in the $REFL_CODE/Files/station directory

If simple is set to true, the algorithms computes bare soil (and thus snow depth), using all values together. The default defines bare soil values every 10 degrees in azimuth.

2024 Feb 6 : stopped the code from setting snowdepth values < 5 cm to zero. This means that “negative” snowdepth will be in the files, but it should not be interpreted to be a new form of snow.

Examples

snowdepth p101 2022

would use results from a previous run of daily_avg

snowdepth p101 2022 -medfilter 0.25 -ReqTracks 50

would run daily_avg for you using 50 tracks/0.25 meter median filter

Parameters:
  • station (str) – 4 character station name

  • year (int) – water year (i.e. jan-june of that year and oct-dec of the previous year)

  • minS (float, optional) – minimum snow depth for y-axis limit (m), optional

  • maxS (float, optional) – maximum snow depth for y-axis limit (m), optional

  • longer (bool, optional) – whether you want to plot longer time series (useful for Alaskan sites)

  • plt (bool, optional) – whether you want the plot to come to the screen

  • bare_date1 (str, optional) – an override for start bare soil definition

  • bare_date2 (str, optional) – an override for end bare soil definition

  • plt_enddate (str, optional) – an override for where you want the plot to end earlier than default

  • simple (bool, optional) – whether you want to use simple algoirthm. Default is False which means you use azimuth corrected bare soil values

  • medfilter (float, optional) – to avoid running daily_avg, you can set median filter in meters; this is used to remove large outliers

  • ReqTracks (int, optional) – to avoid running daily_avg, you can set required number of tracks to create a daily average RH

  • barereq_days (int, optional) – how many bare soil days are required to trust the result, default is 15

  • fr (int, optional) – if you want to restrict to a single frequency at the daily-avg stage (1, 20, etc)

  • hires_figs (bool, optional) – whether you want eps instead of png plots