Skip to content

Commit 0b91f6f

Browse files
committed
Add process script for CCF water level
DD-285
1 parent c266275 commit 0b91f6f

2 files changed

Lines changed: 64 additions & 3 deletions

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Tue Jun 17 09:03:21 2025
4+
5+
@author: smunger
6+
7+
# Interior water levels at Clifton Court reported by SCADA in units of feet NAVD88.,
8+
# These were adjusted to NAVD88 by adding the NGVD29 to NAVD88 conversion of 2.56 ft
9+
# Following the calibration adjustment from survey dated of 4/15/2024
10+
# 0.27 ft is subtracted from the upstream gage (2.57ft-0.27ft)
11+
# 0.22 ft is added to the downstream gage (2.57ft+0.22ft)
12+
# convert to PST
13+
14+
"""
15+
import pandas as pd
16+
import matplotlib.pyplot as plt
17+
18+
path_fn =r'\\nasbdo\Modeling_Data\clifton_court\ccf_water_levels_wonderware_2020_2024.csv'
19+
20+
21+
def to_pst(ts):
22+
""" Convert to PST
23+
24+
Parameters
25+
----------
26+
infile : str
27+
path to the Wonderware file
28+
"""
29+
pst = 'ETC/GMT+8'
30+
pdt = 'US/Pacific'
31+
32+
33+
ts.index = ts.index.tz_localize(pdt, nonexistent='shift_forward',ambiguous="infer").tz_convert(pst)
34+
ts.index = ts.index.floor("1min")
35+
ts = ts[~ts.index.duplicated(keep="first")]
36+
ts.index = ts.index.tz_localize(None)
37+
return ts
38+
39+
40+
41+
ts_raw = pd.read_csv(path_fn,index_col=0,parse_dates=[0],na_values=["(null)"])
42+
ts = to_pst(ts_raw)
43+
ts.columns=["ccf_up","ccf_down"]
44+
45+
# make datum and instrument correction
46+
ts['ccf_up'] = ts['ccf_up']+2.57-0.27
47+
ts['ccf_down'] = ts['ccf_down']+2.57+0.22
48+
49+
# Remove outliers -- pretty agressively.
50+
ts['ccf_up'] = ts['ccf_up'].mask((ts.ccf_up>8.5) | (ts.ccf_up<-0.5))
51+
ts['ccf_down'] = ts['ccf_down'].mask((ts.ccf_down>4.5) | (ts.ccf_down<0))
52+
53+
ts.to_csv("dwr_ccf_waterlevels_NAVD88_2020_2024.csv")
54+
ts.plot()
55+
plt.show()

dms_datastore/processed/processed_config.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
repo: "//cnrastore-bdo/Modeling_Data/repo/continuous/processed/"
2-
screened: "//cnrastore-bdo/Modeling_Data/repo/continuous/screened/"
3-
processed: "//cnrastore-bdo/Modeling_Data/repo/continuous/processed/"
1+
repo: //cnrastore-bdo/Modeling_Data/repo/continuous/processed/
2+
screened: //cnrastore-bdo/Modeling_Data/repo/continuous/screened/
3+
processed: //cnrastore-bdo/Modeling_Data/repo/continuous/processed/
44

55
yolo:
66
start_date: 2022-01-01 00:00
@@ -23,3 +23,9 @@ sjr:
2323
data_sources:
2424
vns_flow: usgs_vns_11303500_flow_*.csv
2525
msd_flow: ncro_msd__b95820q_flow_*.csv
26+
ccf:
27+
start_date: 2022-01-01 00:00
28+
end_date: 2025-08-01 00:00
29+
output:
30+
- //cnrastore-bdo/Modeling_Data/repo/continuous/proprietary/processed/ccf_ele_up.csv
31+
- //cnrastore-bdo/Modeling_Data/repo/continuous/proprietary/processed/ccf_ele_down.csv

0 commit comments

Comments
 (0)