-
Notifications
You must be signed in to change notification settings - Fork 2
/
10_get_data.yml
116 lines (88 loc) · 3.65 KB
/
10_get_data.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
target_default: 10_get_data
packages:
- dataRetrieval
- yaml
- EGRET
- dplyr
sources:
- 10_get_data/code/get_daily_data_nwis.R
- 10_get_data/code/precip_fxns.R
- 10_get_data/code/filter_raw_conc.R
targets:
10_get_data:
depends:
- discharge
- discharge_info
- tp
- tp_daily
- tp_info
- tp_loads_gclas
- tp_gclas
- ortho_p_filt
- ortho_p_filt_info
- ortho_p_unfilt
- diss_p
- ss_info
- ss_daily
- msn_precip
- 10_get_data/out/msn_precip.csv
- 10_get_data/out/tp_conc_gclas.csv
# read in configuration details, like pcodes, site numbers, etc.
config:
command: yaml.load_file('10_get_data/config/dataRetrieval_config.yml')
site_no:
command: config[['site_no']]
pcodes:
command: config[['pcodes']]
start_date:
command: config[['start_date']]
end_date:
command: config[['end_date']]
discharge:
command: readNWISDaily(siteNumber = site_no, startDate = start_date, endDate = end_date)
discharge_info:
command: readNWISInfo(siteNumber = site_no, parameterCd = I('00060'))
# raw TP conc data, multiple obs per day
tp:
command: readNWISSample(siteNumber = site_no, parameterCd = I('00665'), startDate = start_date, endDate = end_date)
# get daily values generated by GCLAS
tp_daily_wy1997:
command: read.csv('10_get_data/raw/Yahara_daily_conc_WY1997.csv', skip = I(2), stringsAsFactors = FALSE)
# daily values, subsetted to days we have conc observations
tp_daily:
command: get_daily_p(start = start_date, end = end_date, site = site_no, pcode = I('00665'), tp_samples = tp, tp_1997 = tp_daily_wy1997)
# same as above, but flow-normalized
tp_daily_fn:
command: get_daily_p_fn(start = start_date, end = end_date, site = site_no, pcode = I('91050'), tp_samples = tp, q = discharge, tp_1997 = tp_daily_wy1997)
# combine missing 1997 data and all gclas dailies
10_get_data/out/tp_conc_gclas.csv:
command: get_daily_p_all(filename = target_name, start = start_date, end = end_date, site = site_no, pcode = I('00665'), tp_1997 = tp_daily_wy1997)
# get into format needed
tp_gclas:
command: readUserSample(filePath = I('10_get_data/out'), fileName = I('tp_conc_gclas.csv'))
# gclas daily loads
tp_loads_gclas:
command: get_gclas_p(start = start_date, end = end_date, site = site_no, pcode = I('91050'))
tp_info:
command: readNWISInfo(siteNumber = site_no, parameterCd = I('00665'))
# get other p species raw concentrations
ortho_p_filt:
command: readNWISSample(siteNumber = site_no, parameterCd = I('00671'), startDate = start_date, endDate = end_date)
ortho_p_filt_info:
command: readNWISInfo(siteNumber = site_no, parameterCd = I('00671'))
ortho_p_unfilt:
command: readNWISSample(siteNumber = site_no, parameterCd = I('70507'), startDate = start_date, endDate = end_date)
diss_p:
command: readNWISSample(siteNumber = site_no, parameterCd = I('00666'), startDate = start_date, endDate = end_date)
# get SS raw concentrations
ss:
command: readNWISSample(siteNumber = site_no, parameterCd = I('80154'), startDate = start_date, endDate = end_date)
ss_info:
command: readNWISInfo(site_no, I('80154'))
ss_daily:
command: get_daily_ss(start = start_date, end = end_date, site = site_no, pcode = I('80154'), ss_samples = ss)
# read in precip data - provided by Dale R.
msn_precip:
command: get_precip(file_loc = '10_get_data/raw/msn_weather_record.csv')
10_get_data/out/msn_precip.csv:
command: write.csv(msn_precip, target_name, row.names = FALSE)