UPL_01 Generate Parameters for Clog Comparison¶
UPL01 is compared to each site for clogs, with each site given a value of 1 for clog and 0 for not. Each site is then weighted. When the sum of all weighted values exceeds 66, UPL01 is considered clogged.
To compare each site to UPL01, a number of parameters must be determined. This Jupyter Notebook determines the correct parameters for each pair. Ideally each pair does a good job of identifying clogs on its own.
We will attempt to use parameters developed for UPL02 and see if they work correctly for UPL01 as well.
[1]:
# must install ipympl (Ipython-matplotlib) and nodejs
from ipywidgets.embed import embed_minimal_html
from ipywidgets import Layout
import matplotlib.pyplot as plt
# Jupyter magic to make plots display interactive
%matplotlib ipympl
# expand all plots to comfortable viewing size
#plt.rcParams['figure.figsize'] = [5, 2.5]
plt.rcParams['figure.dpi'] = 150
Layout(width='600px', height='400px')
import pandas as pd
import sys
sys.path.append("../")
from post_gce_qc import qaqc, data_transfer, cross_probe_qc, main
First run QA on all the data.
[17]:
all_flags = main.main(2019, 2025, probes={'all_params'}, data_path='../config_new.yaml', qa_params='../qa_param.yaml',
fname_base='MS00413_PPT_L1_5min_', write_csv=False)
Loading all PPT data from ../config_new.yaml
Load data from VAR_02
VAR_02: All quality checks and quality assurance rules applied
------------------
Load data from UPL_01
UPL_01: All quality checks and quality assurance rules applied
------------------
Load data from UPL_02
UPL_02: All quality checks and quality assurance rules applied
------------------
Load data from UPL_04
UPL_04: All quality checks and quality assurance rules applied
------------------
Load data from CEN_01
CEN_01: All quality checks and quality assurance rules applied
------------------
Load data from CEN_02
CEN_02: All quality checks and quality assurance rules applied
------------------
Load data from CEN_04
CEN_04: All quality checks and quality assurance rules applied
------------------
Load data from CS2_02
CS2_02: All quality checks and quality assurance rules applied
------------------
Load data from PRI_03
PRI_03: All quality checks and quality assurance rules applied
------------------
Load data from PRI_01
PRI_01: All quality checks and quality assurance rules applied
------------------
Load data from H15_02
H15_02: All quality checks and quality assurance rules applied
------------------
Load data from GSM_02
GSM_02: All quality checks and quality assurance rules applied
------------------
Generating cross probe tables
Checking for flagging consistency on VAR_02
304: UserWarning: Precip set to 0 without E flag or manual flag. E flag added
352: UserWarning: More than one flag assigned at the same time. Only one flag is retained by precedence.
Checking for flagging consistency on UPL_01
Performing cross probe on UPL_02
352: UserWarning: More than one flag assigned at the same time. Only one flag is retained by precedence.
Checking for flagging consistency on UPL_02
352: UserWarning: More than one flag assigned at the same time. Only one flag is retained by precedence.
Checking for flagging consistency on UPL_04
Performing cross probe on CEN_01
Checking for flagging consistency on CEN_01
352: UserWarning: More than one flag assigned at the same time. Only one flag is retained by precedence.
Performing cross probe on CEN_02
Checking for flagging consistency on CEN_02
Checking for flagging consistency on CEN_04
Performing cross probe on CS2_02
Checking for flagging consistency on CS2_02
352: UserWarning: More than one flag assigned at the same time. Only one flag is retained by precedence.
Performing cross probe on PRI_03
Checking for flagging consistency on PRI_03
Checking for flagging consistency on PRI_01
Checking for flagging consistency on H15_02
352: UserWarning: More than one flag assigned at the same time. Only one flag is retained by precedence.
352: UserWarning: More than one flag assigned at the same time. Only one flag is retained by precedence.
Checking for flagging consistency on GSM_02
Test UPL_02 Parameters¶
[18]:
# 1. build pivot table for cross site comparison
xppt = cross_probe_qc.BuildXTable.assemble_cross_table(all_flags, ppt_col='adj_precip')
xacc = cross_probe_qc.BuildXTable.assemble_wy_acc(xppt)
[19]:
# 2. get parameters
param = qaqc._load_yaml('../qa_param.yaml')
fnc_param = param['UPL_02']['auto_flag']['flag_x_clogs']
fnc_weights = param['UPL_02']['auto_flag']['weight_x_clogs']
fnc_param['UPL_02'] = fnc_param['UPL_01']
_ = fnc_param.pop('UPL_01')
fnc_weights['UPL_02'] = fnc_weights['UPL_01']
_ = fnc_weights.pop('UPL_01')
[20]:
# 3. create ACC ratios
xprobe = cross_probe_qc.XProbesQc(xacc.index, 'UPL_01')
xprobe.set_accum_ratio(xacc)
[32]:
plt.close(1)
xprobe.plot_clog_wind_thresholds('UPL_02', xppt, xacc, -0.32, min_accum=[58], days=[8, 14], prec=[0.03])
I only have records showing a single clog and 1 logger failure. Let’s try to scale back a bit. Unfortunately the one snow plug was on October 10, so it may be hard to include a clog so early without letting in a lot of craziness in other years. It’s a very broken pattern…
[33]:
plt.close(2)
xprobe.plot_clog_wind_thresholds('UPL_02', xppt, xacc, -0.32, min_accum=[58], days=[8, 14], prec=[0.03, 0.032, 0.034, 0.036, 0.038, 0.04])
[35]:
plt.close(3)
xprobe.plot_clog_wind_thresholds('UPL_02', xppt, xacc, -0.32, min_accum=[58], days=[6, 8, 14], prec=[0.03, 0.045, 0.05])
Even at 0.05 there are still days that are being flagged. We should check those days out more explicitly. The 6 D is a little tempting… Let’s look at water year 2020.
2020¶
[49]:
plt.close(4)
xprobe.plot_clog_wind_thresholds('UPL_02', xppt, xacc, -0.32, min_accum=[58], days=[6, 14], prec=[0.03, 0.04, 0.05])
[53]:
day = pd.to_datetime('1/1/20 00')
plt.close(5)
all_flags['UPL_01'].plot_flagged_day(day, 'UPL_01', tdelta='15D', auto_qa_event=xprobe.event, paired_tank=all_flags['UPL_02'].data.tank_height)
[53]:
(<Axes: xlabel='Date', ylabel='Precip (mm)'>,
<Axes: title={'center': 'UPL_01 - 2020-01-01 00:00:00'}, xlabel='Date', ylabel='Tank Height (mm)'>)
Definitely not a real clog. A precision of 0.04 with a 14 day window gets rid of it. The next one looks real, but is only being caught using the smaller 6 day window.
[57]:
day = pd.to_datetime('3/20/20 00')
plt.close(6)
all_flags['UPL_01'].plot_flagged_day(day, 'UPL_01', tdelta='25D', auto_qa_event=xprobe.event, paired_tank=all_flags['UPL_02'].data.tank_height)
[57]:
(<Axes: xlabel='Date', ylabel='Precip (mm)'>,
<Axes: title={'center': 'UPL_01 - 2020-03-20 00:00:00'}, xlabel='Date', ylabel='Tank Height (mm)'>)
I can manually flag that to take care of it, but let’s see what it looks like with a new lowest normal ratio.
[60]:
plt.close(7)
xprobe.plot_clog_wind_thresholds('UPL_02', xppt, xacc, -0.038, min_accum=[58], days=[14], prec=[0.04])
I already made the manual flag, so I’ll just put a hole in the middle of it since this automate flag starts late and ends early.
2021¶
[61]:
plt.close(8)
xprobe.plot_clog_wind_thresholds('UPL_02', xppt, xacc, -0.32, min_accum=[58], days=[6, 14], prec=[0.03, 0.04, 0.05])
Lets check it, but that looks like nothing.
[64]:
day = pd.to_datetime('10/11/20 00')
plt.close(9)
all_flags['UPL_01'].plot_flagged_day(day, 'UPL_01', tdelta='2D', auto_qa_event=xprobe.event, paired_tank=all_flags['UPL_02'].data.tank_height)
[64]:
(<Axes: xlabel='Date', ylabel='Precip (mm)'>,
<Axes: title={'center': 'UPL_01 - 2020-10-11 00:00:00'}, xlabel='Date', ylabel='Tank Height (mm)'>)
Yep, nothing. Manual unflag. I tried iterating through some different minimum accumulations, but they didn’t seem to help.
2022¶
[80]:
plt.close(13)
xprobe.plot_clog_wind_thresholds('UPL_02', xppt, xacc, -0.038, min_accum=[58], days=[14], prec=[0.03, 0.04, 0.043, 0.45, 0.05])
[75]:
day = pd.to_datetime('11/6/21')
plt.close(11)
all_flags['UPL_01'].plot_flagged_day(day, 'UPL_01', tdelta='1D', auto_qa_event=xprobe.event, paired_tank=all_flags['UPL_02'].data.tank_height)
[75]:
(<Axes: xlabel='Date', ylabel='Precip (mm)'>,
<Axes: title={'center': 'UPL_01 - 2021-11-06 00:00:00'}, xlabel='Date', ylabel='Tank Height (mm)'>)
There is a micro-clog. We can avoid it with a percision value of 0.04.
[76]:
day = pd.to_datetime('11/9/21')
plt.close(12)
all_flags['UPL_01'].plot_flagged_day(day, 'UPL_01', tdelta='4D', auto_qa_event=xprobe.event, paired_tank=all_flags['UPL_02'].data.tank_height)
[76]:
(<Axes: xlabel='Date', ylabel='Precip (mm)'>,
<Axes: title={'center': 'UPL_01 - 2021-11-09 00:00:00'}, xlabel='Date', ylabel='Tank Height (mm)'>)
That is a non-clog/false-positive. We’ll bump the precision of up 0.045.
2023¶
[81]:
plt.close(14)
xprobe.plot_clog_wind_thresholds('UPL_02', xppt, xacc, -0.038, min_accum=[58], days=[14], prec=[0.03, 0.04, 0.45, 0.05])
[83]:
day = pd.to_datetime('6/27/23')
plt.close(15)
all_flags['UPL_02'].plot_flagged_day(day, 'UPL_02', tdelta='4D', auto_qa_event=xprobe.event, paired_tank=all_flags['UPL_01'].data.tank_height)
[83]:
(<Axes: xlabel='Date', ylabel='Precip (mm)'>,
<Axes: title={'center': 'UPL_02 - 2023-06-27 00:00:00'}, xlabel='Date', ylabel='Tank Height (mm)'>)
This is an example of missing data and an unclog in UPL02, so we don’t want any flagging on UPL01. All but the lowest precision levels skip this one, so it’s an easy fix.
2024¶
[102]:
plt.close(16)
xprobe.plot_clog_wind_thresholds('UPL_02', xppt, xacc, -0.038, min_accum=[58], days=[14], prec=[0.03, 0.04, 0.45, 0.05])
Even at 0.05 this is still being flagged. Let’s double check, but we probably need to manually unflag.
[103]:
day = pd.to_datetime('11/18/23')
plt.close(17)
all_flags['UPL_02'].plot_flagged_day(day, 'UPL_02', tdelta='12D', auto_qa_event=xprobe.event, paired_tank=all_flags['UPL_01'].data.tank_height)
[103]:
(<Axes: xlabel='Date', ylabel='Precip (mm)'>,
<Axes: title={'center': 'UPL_02 - 2023-11-18 00:00:00'}, xlabel='Date', ylabel='Tank Height (mm)'>)
Great, we’re barely flagging after the clog is over. Note I had to switch UPL02 to the base probe to be able to visualize the clog.
[105]:
plt.close(18)
xprobe.plot_clog_wind_thresholds('UPL_02', xppt, xacc, -0.038, min_accum=[58], days=[8, 14], prec=[0.045])
Switching to an 8 day window would capture it pretty well.
[114]:
plt.close(19)
xprobe.plot_clog_wind_thresholds('UPL_02', xppt, xacc, -0.038, min_accum=[58], days=[8, 14], prec=[0.045])
With this precision threshold, the flagging for this event improves, but we trade one false positive for a different one. I’ll trust that the decision to use 14D when the relationship was reveresed was well thought out looking at the wide number of clogs at UPL02. I will manually flag the correct clog and unflag the false-positive.
Test UPL04 Relationship¶
This should be nearly identical to UPL02.
[115]:
plt.close(20)
xprobe.plot_clog_wind_thresholds('UPL_04', xppt, xacc, -0.038, min_accum=[58], days=[14], prec=[0.045])
[ ]:
Definitely needs a new lowest normal ratio.
[120]:
plt.close(21)
xprobe.plot_clog_wind_thresholds('UPL_04', xppt, xacc, -0.135, min_accum=[58], days=[6,14], prec=[0.045, 0.055])
The mid year start is still problematic. I’m going to rely on composite weighting to rule that one out. The second flag does a better job than the shelter did above, but is still off. Manual flags are in place.
Adjust GSM02 Relationship¶
[122]:
plt.close(22)
xprobe.plot_clog_wind_thresholds('GSM_02', xppt, xacc, -0.43, min_accum=[45], days=[6], prec=[0.1])
488: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`). Consider using `matplotlib.pyplot.close()`.
A couple of these look like they could be legitimate. I’ll double check.
10/27/18 - False Positive¶
This is exhibiting the right pattern in the ratio, it just is a storm that rained harder at Mack.
[127]:
day = pd.to_datetime('10/27/18')
plt.close(23)
all_flags['UPL_01'].plot_flagged_day(day, 'UPL_01', tdelta='6D', auto_qa_event=xprobe.event, paired_tank=all_flags['GSM_02'].data.tank_height)
[127]:
(<Axes: xlabel='Date', ylabel='Precip (mm)'>,
<Axes: title={'center': 'UPL_01 - 2018-10-27 00:00:00'}, xlabel='Date', ylabel='Tank Height (mm)'>)
10/15/21 - False Positive¶
Again, the pattern looks legitimate, there just isn’t any reason to think it’s a clog instead of a difference in geographic distribution.
[131]:
day = pd.to_datetime('10/15/21')
plt.close(24)
all_flags['UPL_01'].plot_flagged_day(day, 'UPL_01', tdelta='12D', auto_qa_event=xprobe.event, paired_tank=all_flags['GSM_02'].data.tank_height)
[131]:
(<Axes: xlabel='Date', ylabel='Precip (mm)'>,
<Axes: title={'center': 'UPL_01 - 2021-10-15 00:00:00'}, xlabel='Date', ylabel='Tank Height (mm)'>)
11/4/22 - False Positive¶
I can’t make heads or tails of this one. It looks like UPLO is getting more rain, so I don’t understand why the ratio is dropping.
[137]:
day = pd.to_datetime('11/4/22')
plt.close(25)
all_flags['UPL_01'].plot_flagged_day(day, 'UPL_01', tdelta='2D', auto_qa_event=xprobe.event, paired_tank=all_flags['GSM_02'].data.tank_height)
[137]:
(<Axes: xlabel='Date', ylabel='Precip (mm)'>,
<Axes: title={'center': 'UPL_01 - 2022-11-04 00:00:00'}, xlabel='Date', ylabel='Tank Height (mm)'>)
10/25/23 - False Positive¶
This one seems like it is all to do with some delayed precip at Mack catching up all at once, and not to do with any clog at UPL.
[138]:
day = pd.to_datetime('10/25/23')
plt.close(26)
all_flags['UPL_01'].plot_flagged_day(day, 'UPL_01', tdelta='12D', auto_qa_event=xprobe.event, paired_tank=all_flags['GSM_02'].data.tank_height)
[138]:
(<Axes: xlabel='Date', ylabel='Precip (mm)'>,
<Axes: title={'center': 'UPL_01 - 2023-10-25 00:00:00'}, xlabel='Date', ylabel='Tank Height (mm)'>)
10/31/24 - False Positive¶
This is another case of a legitimate difference in precip that is entirely due to geography and not at all due to clogging.
[226]:
day = pd.to_datetime('11/2/23')
plt.close(27)
all_flags['UPL_01'].plot_flagged_day(day, 'UPL_01', tdelta='1D', auto_qa_event=xprobe.event, paired_tank=all_flags['GSM_02'].data.tank_height)
[226]:
(<Axes: xlabel='Date', ylabel='Precip (mm)'>,
<Axes: title={'center': 'UPL_01 - 2023-11-02 00:00:00'}, xlabel='Date', ylabel='Tank Height (mm)'>)
Final Adjustments¶
3 out of the 5 ID’d clogs seemed legitimate, but were entirely due to geography. 2 of 5, however, were bogus. I’ll back off on the precision a little and see if it improves.
[144]:
plt.close(28)
xprobe.plot_clog_wind_thresholds('GSM_02', xppt, xacc, -0.43, min_accum=[45], days=[6], prec=[0.1, 0.11, 0.12])
0.01 and a low weight in the composite scoring works for me.
Adjust CS2_02 Relationship¶
[168]:
plt.close(29)
xprobe.plot_clog_wind_thresholds('CS2_02', xppt, xacc, -0.116, min_accum=[60], days=[6], prec=[0.1, 0.11, 0.12])
Same false positive as with GSM02 in water year 2025. I think 0.11 is reasonable here as well as long as the weight is low.
Adjust PRI_03 Relationship¶
[176]:
plt.close(30)
xprobe.plot_clog_wind_thresholds('PRI_03', xppt, xacc, -0.0615, min_accum=[70], days=[6], prec=[0.1, 0.11, 0.12])
Again, the same false positive in early 2024. I adjusted the lowest normal ratio a bit. The other point in 2018 is one we looked at for GSM02. It’s a legitimate dip in the ratio, but it is a geographic difference, not a clog. We’ll use the same parameters again, but just weight it low.
Adjust PRI_01 Relationship¶
[184]:
plt.close(31)
xprobe.plot_clog_wind_thresholds('PRI_01', xppt, xacc, -0.115, min_accum=[70], days=[6], prec=[0.08, 0.11, 0.12])
A little tweak to the lowest normal ratio, but otherwise it’s the same false positive as the others, and it doesn’t want to go away. Lowe weighting to the rescue.
Adjust VAR_02 Relationship¶
[197]:
plt.close(32)
xprobe.plot_clog_wind_thresholds('VAR_02', xppt, xacc, -0.28, min_accum=[40], days=[8], prec=[0.11, 0.12, 0.15])
I can’t seem to get rid of those 2 in water year 2024. I’ll take the win and use 0.15 with a low weight.
Adjust H1502 Relationship¶
[212]:
plt.close(33)
xprobe.plot_clog_wind_thresholds('H15_02', xppt, xacc, -0.03, min_accum=[40], days=[14], prec=[0.08, 0.09, 0.1])
0.1 seems to get rid of all the false positives there.
Adjust CEN_02 Relationship¶
[225]:
plt.close(34)
xprobe.plot_clog_wind_thresholds('CEN_02', xppt, xacc, -0.14, min_accum=[90], days=[8], prec=[0.06, 0.07, 0.08, 0.09, 0.1])
[228]:
day = pd.to_datetime('12/17/18')
plt.close(36)
all_flags['UPL_01'].plot_flagged_day(day, 'UPL_01', tdelta='2.5D', auto_qa_event=xprobe.event, paired_tank=all_flags['CEN_02'].data.tank_height)
[228]:
(<Axes: xlabel='Date', ylabel='Precip (mm)'>,
<Axes: title={'center': 'UPL_01 - 2018-12-17 00:00:00'}, xlabel='Date', ylabel='Tank Height (mm)'>)
Well, it’s a legit non-clog. Capturing the right pattern, just for the wrong reasons. This one’s just geograpy based. 0.07 or 0.1 are looking good based on this one.
[229]:
plt.close(37)
xprobe.plot_clog_wind_thresholds('CEN_02', xppt, xacc, -0.14, min_accum=[90], days=[8], prec=[0.06, 0.07, 0.08, 0.09, 0.1])
[231]:
day = pd.to_datetime('11/13/20')
plt.close(38)
all_flags['UPL_01'].plot_flagged_day(day, 'UPL_01', tdelta='4D', auto_qa_event=xprobe.event, paired_tank=all_flags['CEN_02'].data.tank_height)
[231]:
(<Axes: xlabel='Date', ylabel='Precip (mm)'>,
<Axes: title={'center': 'UPL_01 - 2020-11-13 00:00:00'}, xlabel='Date', ylabel='Tank Height (mm)'>)
>= 0.09 looks good for this one, since that’s a pretty weak “clog”.
[232]:
plt.close(39)
xprobe.plot_clog_wind_thresholds('CEN_02', xppt, xacc, -0.14, min_accum=[90], days=[8], prec=[0.06, 0.07, 0.08, 0.09, 0.1])
[238]:
day = pd.to_datetime('11/5/23')
plt.close(40)
all_flags['UPL_01'].plot_flagged_day(day, 'UPL_01', tdelta='3D', auto_qa_event=xprobe.event, paired_tank=all_flags['CEN_02'].data.tank_height)
[238]:
(<Axes: xlabel='Date', ylabel='Precip (mm)'>,
<Axes: title={'center': 'UPL_01 - 2023-11-05 00:00:00'}, xlabel='Date', ylabel='Tank Height (mm)'>)
That’s a very legitimate signal, but I don’t think it’s likely that it was a clog and not a geographic disparity.
[249]:
plt.close(41)
xprobe.plot_clog_wind_thresholds('CEN_02', xppt, xacc, -0.04, min_accum=[90], days=[8], prec=[0.06, 0.07, 0.08, 0.09, 0.1])
[246]:
day = pd.to_datetime('11/1/24')
plt.close(42)
all_flags['UPL_01'].plot_flagged_day(day, 'UPL_01', tdelta='2D', auto_qa_event=xprobe.event, paired_tank=all_flags['CEN_02'].data.tank_height)
[246]:
(<Axes: xlabel='Date', ylabel='Precip (mm)'>,
<Axes: title={'center': 'UPL_01 - 2024-11-01 00:00:00'}, xlabel='Date', ylabel='Tank Height (mm)'>)
[248]:
day = pd.to_datetime('11/13/24')
plt.close(43)
all_flags['UPL_01'].plot_flagged_day(day, 'UPL_01', tdelta='5D', auto_qa_event=xprobe.event, paired_tank=all_flags['CEN_02'].data.tank_height)
[248]:
(<Axes: xlabel='Date', ylabel='Precip (mm)'>,
<Axes: title={'center': 'UPL_01 - 2024-11-13 00:00:00'}, xlabel='Date', ylabel='Tank Height (mm)'>)
[255]:
plt.close(45)
xprobe.plot_clog_wind_thresholds('CEN_01', xppt, xacc, -0.04, min_accum=[90], days=[8], prec=[0.09])
0.09 seems to get rid of all of the totally false signals and keep some part of the signals that are legitimate, but not due to a clog. Hopefully that’s the right balance. It’s also the same value used by UPL_02.
Adjust CEN_01 Relationship¶
[260]:
plt.close(46)
xprobe.plot_clog_wind_thresholds('CEN_01', xppt, xacc, -0.04, min_accum=[90], days=[8], prec=[0.09, 0.1])
That highlights the same 3 spots that we left with CEN_02. Looks good. Doesn’t seem to be any additional weirdness from the clogs in 2019.
Final Composite Check¶
Much like UPL02, nothing really matched this probe very well. I think UPL02 needs to be able to signal a clog by itself. Let’s check the composite clog ID’s.
[257]:
params = qaqc._load_yaml('../qa_param.yaml')
fnc_params = params['UPL_01']['auto_flag']['flag_x_clogs']
wt_params = params['UPL_01']['auto_flag']['weight_x_clogs']
[258]:
# compare against each probe for clogs against the base probe
xprobe.set_x_clogs(xppt, xacc, fnc_params)
# Get the weighted value for each site to decide on final flags.
eventwt, Uwt, Cwt, = xprobe.get_weight_x_clog(wt_params)
xprobe.flag_x_clogs(eventwt, Uwt, Cwt)
[261]:
plt.close(47)
xacc[['UPL_01']].plot(grid=True, legend=True)
xacc.loc[xprobe.event.clog, 'UPL_01'].plot(grid=True, linestyle='', marker='.')
[261]:
<Axes: xlabel='Date'>
[262]:
day = pd.to_datetime('3/31/20')
plt.close(48)
all_flags['UPL_01'].plot_flagged_day(day, 'UPL_01', tdelta='5D', auto_qa_event=xprobe.event, paired_tank=all_flags['UPL_02'].data.tank_height)
[262]:
(<Axes: xlabel='Date', ylabel='Precip (mm)'>,
<Axes: title={'center': 'UPL_01 - 2020-03-31 00:00:00'}, xlabel='Date', ylabel='Tank Height (mm)'>)
Great clog ID!!
[264]:
day = pd.to_datetime('10/11/20')
plt.close(49)
all_flags['UPL_01'].plot_flagged_day(day, 'UPL_01', tdelta='1D', auto_qa_event=xprobe.event, paired_tank=all_flags['UPL_02'].data.tank_height)
[264]:
(<Axes: xlabel='Date', ylabel='Precip (mm)'>,
<Axes: title={'center': 'UPL_01 - 2020-10-11 00:00:00'}, xlabel='Date', ylabel='Tank Height (mm)'>)
Horrible clog ID! already have a manuall unflag in place.
[271]:
day = pd.to_datetime('11/18/23')
plt.close(50)
all_flags['UPL_02'].plot_flagged_day(day, 'UPL_02', tdelta='10D', auto_qa_event=xprobe.event, paired_tank=all_flags['UPL_01'].data.tank_height)
[271]:
(<Axes: xlabel='Date', ylabel='Precip (mm)'>,
<Axes: title={'center': 'UPL_02 - 2023-11-18 00:00:00'}, xlabel='Date', ylabel='Tank Height (mm)'>)
Even worse flagging. Already have a manual unflag in place.
[272]:
all_flags['UPL_01'].apply_manual_flags(params['UPL_01']['manual_flags'])
[277]:
clogs = all_flags['UPL_01'].event.event_code.str.contains('CLOG')
[279]:
plt.close(51)
xacc[['UPL_01', 'UPL_02']].plot(grid=True, legend=True)
xacc.loc[clogs, 'UPL_01'].plot(grid=True, linestyle='', marker='.')
[279]:
<Axes: xlabel='Date'>
[ ]: