From c696ba2501917a5060fab70291554e3b42d36bc1 Mon Sep 17 00:00:00 2001 From: kristinemlarson Date: Tue, 3 Dec 2024 16:41:43 -0800 Subject: [PATCH] primarily added date1 and date2 to daily_avg and subdaily --- .gitignore | 1 + CHANGELOG.md | 10 ++- README.md | 5 +- docs/pages/community.md | 130 --------------------------------------- gnssrefl/daily_avg.py | 49 ++++++++++++++- gnssrefl/daily_avg_cl.py | 49 ++++++++++++--- pyproject.toml | 2 +- 7 files changed, 101 insertions(+), 145 deletions(-) delete mode 100644 docs/pages/community.md diff --git a/.gitignore b/.gitignore index 1a173a221..338b90930 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ env gnss/* +rise_set_tracks.py developer_notes.md new.pyproject.toml meson.build diff --git a/CHANGELOG.md b/CHANGELOG.md index aba38965e..cf9ed193f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,14 @@ 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 date1 and date2 as optional inputs to subdaily. These can be used instead of the doy1, doy2, -and year_end inputs. +## 3.10.6 +December 3, 2024 -added link to Fagundes et al. +I added date1 and date2 as optional inputs to subdaily. These can be used instead of the doy1, doy2, +and year_end inputs. for now both kinds are allowed though I will likely change that at some point. + +I added date1 and date2 to daily_avg. You can narrow your use of data. It set to correct values (i.e. it +is truly a date in yyyymmdd format), it will override any -year1 and -year2 values. ## 3.10.5 diff --git a/README.md b/README.md index 9840951a5..1686985a5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# gnssrefl v3.10.5 +# gnssrefl v3.10.6 gnssrefl is an open source software package for GNSS Interferometric Reflectometry (GNSS-IR). When showing results created using gnssrefl, please use: @@ -18,6 +18,9 @@ gnssrefl also has a DOI from zenodo. The latest pypi version can be found here [![PyPI Version](https://img.shields.io/pypi/v/gnssrefl.svg)](https://pypi.python.org/pypi/gnssrefl) +Latest Feature - you can set beginning and end dates in daily_avg and subdaily. The parameters are +called date1 and date2. See the descriptions of these modules in the usual place. + Questions and bug reports for gnssrefl (but not the notebooks) **must** be submitted via the **Issues** button at the [github repository](https://github.com/kristinemlarson/gnssrefl/issues). The notebooks were created by Earthscope with NASA funding. I formally asked Earthscope about maintenance of the notebooks and received the following response from them: diff --git a/docs/pages/community.md b/docs/pages/community.md deleted file mode 100644 index 5fa7f4033..000000000 --- a/docs/pages/community.md +++ /dev/null @@ -1,130 +0,0 @@ -# Community GNSS-IR Publications - -Changes to this file will only be allowed thru a pull request on github. - - -## Software - -- [Larson K.M., gnssrefl: an open source python software package for environmental GNSS interferometric reflectometry applications, GPS Solutions, Volume 28, article number 165, 2024](https://link.springer.com/article/10.1007/s10291-024-01694-8) - -## Soil Moisture - -- [Larson, K.M., E.E. Small, E. Gutmann, A. Bilich, J. Braun, V. Zavorotny, Use of GPS receivers as a soil moisture network for water cycle studies, Geophys. Res. Lett., 35, L24405, doi:10.1029/2008GL036013, 2008](https://www.kristinelarson.net/wp-content/uploads/2015/10/larson_soil_grl2008.pdf) - -- [Chew, C.C., E.E. Small, K.M. Larson, and V. Zavorotny, Effects of Near-Surface Soil Moisture on GPS SNR Data: Development of a Retrieval Algorithm for Volumetric Soil Moisture, IEEE TGRS, Vol. 52(1), 537-543, doi:10.1109/TGRS.2013.2242332, 2014](https://www.kristinelarson.net/wp-content/uploads/2015/10/Chew_etal_Proof.pdf) - -- Chew, C.C., E.E. Small, and K.M. Larson, An Algorithm for Soil Moisture Estimation Using -GPS Interferometric Reflectometry for Bare and Vegetated Soil, GPS Solutions, -Vol. 20(3), 525-537, doi:10.1007/s10291-015-0462-4, 2016 - -- Chew, C.C., E.E. Small, K.M. Larson, and V. Zavorotny, Vegetation Sensing Using -GPS interferometric reflectometry: Theoretical Effects of Canopy Parameters on Signal to -Noise Ratio Data, IEEE TGRS,Vol. 53(5), 2755-2763, doi: 10.1109/TGRS.2014.2364513, 2015 - -## Snow - -- [Larson, K.M., E. Gutmann, V. Zavorotny, J. Braun, M. Williams, and F. G. Nievinski, Can we measure snow depth with GPS receivers?, Geophys. Res. Lett., Vol. 36, L17502, doi:10.1029/2009GL039430, 2009](https://www.kristinelarson.net/wp-content/uploads/2015/10/larsonetal_snow_2009.pdf) - -- [Nievinski, F.G. and K.M. Larson, Inverse Modeling of GPS Multipath for Snow Depth Estimation, Part I: Formulation and Simulations, IEEE TGRS, Vol. 52(10), 6555-6563, doi:10.1109/TGRS.2013.2297681, 2014](https://morefunwithgps.com/public_html/Inverse_Modeling_of_GPS_Multipath_for_Snow_Depth_EstimationPart_I_Formulation_and_Simulations.pdf) - -- [Nievinski, F.G. and K.M. Larson, Inverse Modeling of GPS Multipath for Snow Depth Estimation, Part II: Application and Validation, IEEE TGRS, Vol. 52(10), 6564-6573, doi:10.1109/TGRS.2013.2297688, 2014](https://morefunwithgps.com/public_html/Inverse_Modeling_of_GPS_Multipath_for_Snow_Depth_EstimationPart_II_Application_and_Validation.pdf) - -- [Altuntas, C., M.C. Iban, E. Şentürk, U.M. Durdag, and N. Tunalioglu, Machine learning-based snow depth retrieval using GNSS signal-to-noise ratio data, GPS Solutions, Vol. 26(117), 1-12, doi:10.1007/s10291-022-01307-2, 2022](https://link.springer.com/article/10.1007/s10291-022-01307-2) - -- [Altuntas, C. and N. Tunalioglu, Enhancing snow depth estimations through iterative satellite elevation range selection in GNSS-IR to account for terrain variation, IEEE TGRS, Vol. 61, Article no: 5802309, 1-9, doi:10.1109/TGRS.2023.3312925, 2023](https://ieeexplore.ieee.org/abstract/document/10243156) - -- [McCreight, E.E. Small, and K.M. Larson, Snow Depth, Density, and SWE estimates Derived from GPS Reflection Data: Validation in the Western U.S., Water Resources Research,Vol. 50(8), doi:10.1002/2014WR015561, 2014](https://www.kristinelarson.net/wp-content/uploads/2015/10/McCreightSmallLarson.pdf) - -## Tides - -- Löfgren, J., R. Haas, and H.-G. Scherneck,2014: Sea level time series and ocean tide -analysis from multipath signals at five GPS sites in different parts of the world. -J. Geodyn., 80, 66–80, doi:10.1016/ j.jog.2014.02.012, 2014 - -- Strandberg, J., T. Hobiger, and R. Haas, 2016: Improving GNSS-R sea level -determination through inverse modeling of SNR data. Radio Sci., 51, 1286–1296, doi:10.1002/2016RS006057, 2016. - -- [Larson, K.M., J. Löfgren, and R. Haas, Coastal Sea Level Measurements Using A Single Geodetic GPS Receiver, Adv. Space Res., Vol. 51(8), 1301-1310, 2013, doi:10.1016/j.asr.2012.04.017, 2013](https://www.kristinelarson.net/wp-content/uploads/2015/10/Larson_TideGauge.pdf) - -- [Larson, K.M., R. Ray, F. Nievinski, and J. Freymueller, The Accidental Tide Gauge: A Case Study of GPS Reflections from Kachemak Bay, Alaska, IEEE GRSL, Vol 10(5), 1200-1205, doi:10.1109/LGRS.2012.2236075, 2013](https://www.kristinelarson.net/wp-content/uploads/2015/10/LarsonIEEE_2013.pdf) - -- [Larson, K.M., R.D. Ray, and S.P. Williams, A ten year comparison of water levels measured with a geodetic GPS receiver versus a conventional tide gauge, J. Atmos. Ocean Tech, Vol. 34(2), 295-307, doi: 10.1175/JTECH-D-16-0101.1, 2017](https://www.kristinelarson.net/wp-content/uploads/2015/12/LarsonRayWilliams-2017-FridayHarbor.pdf) - -- [Peng, D., L. Feng, K.M. Larson, and E. Hill, Measuring Coastal Absolute Sea-Level Changes Using GNSS Interferometric Reflectometry, Remote Sens. 13(21), 4319, 2021](https://www.mdpi.com/2072-4292/13/21/4319) - -- Larson, K. M., Lay, T., Yamazaki, Y., Cheung, K. F., Ye, L., Williams, S. D. P., & Davis, J. L., Dynamic sea -level variation from GNSS: 2020 Shumagin earthquake tsunami resonance and Hurricane Laura. Geophysical -Research Letters, 48, e2020GL091378. https://doi. org/10.1029/2020GL091378, 2021. - -- Purnell, D. Gomez, N., Chan, NH, Strandberg, J., Hobiger, T. Quantifying the Uncertainty in Ground-Based GNSS-Reflectometry -Sea Level Measurements, IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, DOI:10.1109/JSTARS.2020.3010413, 2021 - -- [Altuntas, C. and N. Tunalioglu, A systematic approach for identifying optimal azimuth and elevation angle masks in GNSS-IR: validation through a sea level experiment, GPS Solutions, Vol 27(4), 198, doi:10.1007/s10291-023-01535-0, 2023](https://link.springer.com/article/10.1007/s10291-023-01535-0) - -- [Larson, K.M. and S.D.P. Williams, Water level measurements using reflected GNSS signals](https://ihr.iho.int/articles/water-level-measurements-using-reflected-gnss-signals/) - - -## Lakes and Rivers - -- [Purnell, D., Gomez N., Minarik, W., Langston, G., Real-Time Water Levels using GNSS-IR: a potential tool for flood monitoring](https://agupubs.onlinelibrary.wiley.com/doi/10.1029/2023GL105039) - -- [Holden, L. and K.M. Larson, Ten Years of Lake Taupo Surface Height Estimates Using the GNSS Interferometric Reflectometry, Journal of Geodesy. Vol 95(74),10.1007/s00190-021-01523-7, 2021](https://www.kristinelarson.net/wp-content/uploads/2021/05/Holden-May2021.pdf) - -- [Fagundes, M.A.R., Mendonça-Tinti, I., Iescheck, A.L., Akos, D.M., & Geremia-Nievinski, F. An open-source low-cost sensor for SNR-based GNSS reflectometry: Design and long-term validation towards sea-level altimetry. GPS Solutions, 25(2), 73, 2021](https://link.springer.com/article/10.1007/s10291-021-01087-1) - -## Permafrost - -- Liu, L. and K.M. Larson, Decadal changes of surface elevation over permafrost area estimated using -reflected GPS signals, The Cryosphere, Vol 12, 477–489, doi:10.5194/tc-12-477-2018, 2018 - -## Coastal Subsidence - -- [Karegar, M.A., Larson, K.M., Kusche, J., & Dixon, T.H. Novel quantification of shallow sediment compaction by GPS interferometric reflectometry and implications for flood susceptibility. Geophysical Research Letters, 47(14), e2020GL087807, 2020.](https://agupubs.onlinelibrary.wiley.com/doi/full/10.1029/2020GL087807) - - -## Ice - -- [Derek James Pickell, Robert Lyman Hawley, and Adam LeWinter, -Spatio-Temporal Patterns of Accumulation and Surface Roughness in Interior Greenland with a GNSS-IR Network, -preprint, DOI 10.5194/egusphere-2024-2898, 2024](https://egusphere.copernicus.org/preprints/2024/egusphere-2024-2898/) - -- [Albin Wells, David Rounce, Louis Sass, Caitlyn Florentine, Adam Garbo, Emily Baker, -Christopher McNeil, -GNSS reflectometry from low-cost sensors for continuous in situ contemporaneous glacier mass balance and flux divergence, -Journal of Glaciology, DOI: https://doi.org/10.1017/jog.2024.54, 2024]( https://www.cambridge.org/core/journals/journal-of-glaciology/article/gnss-reflectometry-from-lowcost-sensors-for-continuous-in-situ-contemporaneous-glacier-mass-balance-and-flux-divergence/7F36028E3EBA46B8A1D3CB974D40B9D0) - -- [Larson, K.M., J. Wahr, and P. Kuipers Munneke, Constraints on Snow Accumulation and Firn Density in Greenland Using GPS Receivers, J. Glaciology, Vol. 61, No. 225, doi:10.3189/2015JoG14J130, 2015](https://www.kristinelarson.net/wp-content/uploads/2015/10/LarsonWahrKuipers_2015.pdf) - -- [Shean, D., K. Christianson, K.M. Larson, S.R.M. Ligtenberg, I.R. Joughin, B. E. Smith, C.M. Stevens, M. Bushuk, and D.M. Holland, GPS-derived estimates of surface mass balance and ocean-induced basal melt for Pine Island Glacier ice shelf, Antarctica, The Cryosphere Vol. 11, 2655-2674, doi:10.5194/tc-11-2655, 2017](https://tc.copernicus.org/articles/11/2655/2017/tc-11-2655-2017.pdf) - -- [Pinat,E.;Defraigne,P.; Bergeot, N.; Chevalier, J.-M.; Bertrand, B. Long-Term Snow Height Variations in Antarctica from GNSS Interferometric Reflectometry. Remote Sens. 13, 1164. 2021](https:// doi.org/10.3390/rs13061164) - -- [Larson, K.M., M. MacFerrin, and T. Nylen, Brief Communication: Update on the GPS Reflection Technique for Measuring Snow Accumulation in Greenland, The Cryosphere, Vol. 14, 1985–1988, doi:10.5194/tc-2019-303, 2020.](https://tc.copernicus.org/articles/14/1985/2020/) - -## Models and Simulators - -- [Nievinski, F.G. and K.M. Larson, An Open Source GPS Multipath Simulator in Matlab/Octave Nievinski, GPS Solutions, Vol 18(3), 473-481, doi:10.1007/s10291-014-0370-z, 2014](https://www.kristinelarson.net/wp-content/uploads/2015/10/Nievinski_Simulator.pdf) - -- Zavorotny, V., K.M. Larson, J. Braun, E.E. Small, E. Gutmann, and A. -Bilich, A physical model of GPS multipath caused by land reflections: toward bare soil moisture -retrievals, IEEE J-STARS, Vol. 3 (1), pp. 100-110, 10.1109/JSTARS.2009.2033608, 2010 - -- Nievinski, F.G. and K.M. Larson, Forward modeling of multipath for near-surface reflectometry -and positioning applications, GPS Solutions,Vol 18(2), 309-322,10.1007/s10291-013-0331-y, 2014 - -## Software - -- [Altuntas, C. and N. Tunalioglu, GIRAS: an open-source MATLAB-based software for GNSS-IR analysis, GPS Solutions, Vol 26(16), 1-8, doi:10.1007/s10291-021-01201-3, 2022](https://link.springer.com/article/10.1007/s10291-021-01201-3) - - -## Vegetation - -- [Wei, W., K.M. Larson, E.E. Small, C. Chew, and J.J. Braun, Using Geodetic GPS Receivers to Measure Vegetation Water Content, GPS Solutions, Vol. 19(2), 237-248,doi:10.1007/s10291-014-0383-7, 2015](https://www.kristinelarson.net/wp-content/uploads/2015/10/VegSensing_SNR.pdf) - -- [Jones, M.O., J.S. Kimball, E.E. Small, and K.M. Larson, Comparing Land Surface Phenology Derived from Satellite and GPS Network Microwave Remote Sensing, Int. Journ. Biometeor., Vol. 58(6), 1305-1315, doi:10.1007/s00484-013-0726-z, 2014](https://www.kristinelarson.net/wp-content/uploads/2015/10/JonesMJ_etal_2013.pdf) - -- [Evans, S.G., E.E. Small, and K.M. Larson, Comparison of vegetation phenology in the western United States from reflected GPS microwave signals and NDVI, Int. Journal Remote Sensing, Vol. 35(9), 2996-3017, doi:10.1080/01431161.2014.894660, 2014](https://www.kristinelarson.net/wp-content/uploads/2015/10/Evans_NMRI.pdf) - -## Miscellaneous - - - [Karegar, M.A., & Kusche, J. Imprints of COVID‐19 lockdown on GNSS observations: An initial demonstration using GNSS interferometric reflectometry. Geophysical Research Letters, 47(19), e2020GL089647. 2020](https://agupubs.onlinelibrary.wiley.com/doi/epdf/10.1029/2020GL089647) diff --git a/gnssrefl/daily_avg.py b/gnssrefl/daily_avg.py index e688b66ef..65d5b6b4f 100644 --- a/gnssrefl/daily_avg.py +++ b/gnssrefl/daily_avg.py @@ -96,7 +96,7 @@ def fbias_daily_avg(station): def readin_plot_daily(station,extension,year1,year2,fr,alldatafile,csvformat, - howBig,ReqTracks,azim1,azim2,test,subdir,plot_limits): + howBig,ReqTracks,azim1,azim2,test,subdir,plot_limits,**kwargs): """ worker code for daily_avg_cl.py @@ -114,10 +114,10 @@ def readin_plot_daily(station,extension,year1,year2,fr,alldatafile,csvformat, extension : str folder extension - usually empty string - year1 : integer + year1 : int first year - year2 : integer + year2 : int last year fr : integer @@ -162,6 +162,27 @@ def readin_plot_daily(station,extension,year1,year2,fr,alldatafile,csvformat, observation times """ + date1 = kwargs.get('date1',None) + date2 = kwargs.get('date2',None) + mjd1=None + mjd2=None + if date1 is not None: + try: + m = int(date1[4:6]) + d = int(date1[6:8]) + mjd1,duh = g.mjd(year1,m,d,0,0,0) + except: + date1 = None # illegal input + if date2 is not None: + try: + m = int(date2[4:6]) + d = int(date2[6:8]) + mjd2,duh = g.mjd(year2,m,d,0,0,0) + mjd2=mjd2 + 1 + except: + # illegal input + date2 = None + print('Median Filter', howBig, ' Required number of tracks/day ', ReqTracks) xdir = os.environ['REFL_CODE'] print('All RH retrievals - including bad ones - will be written to: ' ) @@ -211,8 +232,30 @@ def readin_plot_daily(station,extension,year1,year2,fr,alldatafile,csvformat, for f in all_files: fname = direc + f L = len(f) + keep_this_one1 = True + keep_this_one2 = True # file names must have 7 characters in them ... and end in txt for that matter if (L == 7): + mjd = g.ydoy2mjd(yr,int(f[0:3])) + if mjd1 is not None: + if (mjd >= mjd1): + keep_this_one1 = True + else: + keep_this_one1 = False + if mjd2 is not None: + if (mjd <= mjd2): + keep_this_one2 = True + else: + keep_this_one2 = False + if keep_this_one1 & keep_this_one2: + keepit = True + else: + keepit = False + + #if not keepit: + # print('thrown out because it was not between your dates',f) + + if (L == 7) & keepit: NumFiles += 1 # check that it is a file and not a directory and that it has something/anything in it try: diff --git a/gnssrefl/daily_avg_cl.py b/gnssrefl/daily_avg_cl.py index cb5b79930..537c1fdf6 100644 --- a/gnssrefl/daily_avg_cl.py +++ b/gnssrefl/daily_avg_cl.py @@ -27,6 +27,8 @@ def parse_arguments(): parser.add_argument("-test", default=None, type=str, help="augmentation to plot") parser.add_argument("-subdir", default=None, type=str, help="non-default subdirectory for output ") parser.add_argument("-plot_limits", default=None, type=str, help="add median value and limits to plot, default is False ") + parser.add_argument("-date1", default=None, type=str, help="Optional beginning date, yyyymmdd") + parser.add_argument("-date2", default=None, type=str, help="Optional ending date, yyyymmdd") args = parser.parse_args().__dict__ # convert all expected boolean inputs from strings to booleans @@ -38,8 +40,9 @@ def parse_arguments(): def daily_avg(station: str , medfilter: float, ReqTracks: int, txtfile: str = None, plt: bool = True, - extension: str = '', year1: int = 2005, year2: int = 2030, fr: int = 0, csv: bool = False, - azim1: int = 0, azim2: int = 360, test: bool = False, subdir: str=None,plot_limits: bool=False): + extension: str = '', year1: int = None, year2: int = None, fr: int = 0, csv: bool = False, + azim1: int = 0, azim2: int = 360, test: bool = False, subdir: str=None,plot_limits: bool=False, + date1: str=None, date2: str=None): """ The goal of this code is to consolidate individual RH results into a single file consisting of daily averaged RH without outliers. These daily average values are nominally associated @@ -93,7 +96,8 @@ def daily_avg(station: str , medfilter: float, ReqTracks: int, txtfile: str = No daily_avg p041 0 0 this will use median filter and required tracks values from within the json. The parameter names are slightly different, daily_avg_medianfilter and dailyavg_reqtracks. - + daily_avg p041 0.5 50 -date1 20200501 -date2 20210601 + only uses data beteween May 1, 2020 and June 1, 2021 Parameters ---------- @@ -121,11 +125,11 @@ def daily_avg(station: str , medfilter: float, ReqTracks: int, txtfile: str = No year1 : int, optional restrict to years starting with. - default is 2005. + default is 2005 (set below). year2 : int, optional restrict to years ending with. - default is 2030. + default is 2035 (set below). fr : int, optional GNSS frequency. If none input, all are used. Value options: @@ -178,8 +182,21 @@ def daily_avg(station: str , medfilter: float, ReqTracks: int, txtfile: str = No plot_limits: bool, optional adds the median value and median filter limits to the plot. default is False + date1: str, optional + you only want data starting from this date, format yyyymmdd + this will supercede year1 + date2: str, optional + you only want data ending from this date, format yyyymmdd + this will supercede year2 """ + # set some defaults so they are easy to find + if year1 is None: + year1 = 2005 + + if year2 is None: + year2 = 2035 + if len(station) != 4: print('Station names must have four characters. Exiting.') sys.exit() @@ -231,16 +248,34 @@ def daily_avg(station: str , medfilter: float, ReqTracks: int, txtfile: str = No alldatafile = txtdir + '/' + station + '_allRH.txt' # read in the files + if date1 is not None: + # overwrite year1 + try: + year1 = int(date1[0:4]) + except: + # illegal year + year1= 2005 + print('Illegal date1. Ignoring and using default year1 ', year1) + date1 = None + + if date2 is not None: + try: + year2 = int(date2[0:4]) + except: + year2=2030 + print('Illegal date2. Ignoring and using default year2 ', year2) + date2 = None + tv, obstimes = da.readin_plot_daily(station, extension, year1, year2, fr, - alldatafile, csv, medfilter, ReqTracks,azim1,azim2,test,subdir,plot_limits) + alldatafile, csv, medfilter, ReqTracks,azim1,azim2,test,subdir,plot_limits,date1=date1,date2=date2) # default is to show the plots nr,nc = tv.shape if plt2screen & (nr > 0): matplt.show() - # now write out the result file: + # now write out the result file: if txtfile is None: if csv: outfile = txtdir + '/' + station + '_dailyRH.csv' diff --git a/pyproject.toml b/pyproject.toml index 106c9714a..99413e2bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "mesonpy" [project] name = "gnssrefl" -version = "3.10.5" +version = "3.10.6" description = "A GNSS reflectometry software package " readme = "README.md" maintainers = [