From 612c1126cde0b029b04e39e77e08c01a7428b20f Mon Sep 17 00:00:00 2001 From: kristinemlarson <kristinem.larson@gmail.com> Date: Thu, 10 Aug 2023 17:10:25 -0600 Subject: [PATCH] fix bug in daily_avg when no RH values exist --- docs/pages/README_dailyavg.md | 24 ++++++------------------ gnssrefl/daily_avg.py | 4 ++++ software_tests | 2 ++ 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/docs/pages/README_dailyavg.md b/docs/pages/README_dailyavg.md index 75185ab1c5..18b8fccb7e 100644 --- a/docs/pages/README_dailyavg.md +++ b/docs/pages/README_dailyavg.md @@ -37,42 +37,30 @@ is printed to the screen and a plot is created. - daily average RH that meet the QC criteria -I illustrate the steps you might take with station MCHN. The antenna is very close to the water, so that is +I illustrate the steps you might take with station MCHN. The antenna is very close to the water, so that is good. But the receiver itself is operated suboptimally and only L1 GPS data can be used here. This severely limits the number of tracks that can be used. -I start out with almost no QC (outliers with 2 meters of the median value, only 5 satelliet arcs required per day): - +I start out with almost no QC (outliers with 2 meters of the median value, only 5 satellite arcs required per day): <code> daily_avg mchn 2 5 </code> <p align=center> <img width=500 src=../_static/mchn_01.png> -</p> -<p align=center> <img width=500 src=../_static/mchn_02.png> -</p> -<p align=center> <img width=500 src=../_static/mchn_03.png> </p> You can easily see the outliers - and that you need to use something more useful than 2 meters for the median filter. I will use 0.25 meters. I am also going to -change the required tracks to 10 +change the required tracks to 10: <p align=center> <img width=500 src=../_static/mchn_04.png> -</p> - -<p align=center> <img width=500 src=../_static/mchn_05.png> -</p> - - -<p align=center> <img width=500 src=../_static/mchn_06.png> </p> @@ -86,10 +74,10 @@ You can see that at least visually, this makes no change in the daily averages. <p align=center> <img width=500 src=../_static/mchn_07.png> -</p> - -<p align=center> <img width=500 src=../_static/mchn_08.png> </p> +I hope this module is helpful for you. If it is not, there is certainly nothing +wrong with doing your own QC using another software tool such as Matlab. + diff --git a/gnssrefl/daily_avg.py b/gnssrefl/daily_avg.py index e2882288e2..5f34e0dcb7 100644 --- a/gnssrefl/daily_avg.py +++ b/gnssrefl/daily_avg.py @@ -386,6 +386,10 @@ def quick_raw(alldatafile2,xdir,station,subdir): """ if os.path.exists(alldatafile2): raw = np.loadtxt(alldatafile2,comments='%') + if len(raw) == 0: + print('There are no RH data. At all. Exiting') + sys.exit() + ns= len(raw.shape) if ns == 2: nr,nc = raw.shape diff --git a/software_tests b/software_tests index feaf576884..08377b997a 100755 --- a/software_tests +++ b/software_tests @@ -55,9 +55,11 @@ gnssir_input p103 #make_json_input p103 0 0 0 + quickLook p103 2020 105 -plt F quickLook p103 2020 107 -plt F -fr 2 +gnssir p103 2020 105 -doy_end 109 daily_avg p103 0.5 10 -plt F subdaily p103 2020 -plt F