This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
3_predictions.yml
104 lines (86 loc) · 3.74 KB
/
3_predictions.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
target_default: 3_predictions
packages:
- RcppCNPy
- tidyverse
- sf
- feather
- yaml
- tidync
- arrow
sources:
- 3_predictions/src/nc_to_feather.R
- 3_predictions/src/munge_predictions.R
- 3_predictions/src/download_files.R
- 3_predictions/src/dwallin_functions.R
targets:
3_predictions:
depends:
- 3_predictions/out/compare_predictions_obs.feather.ind
- 3_predictions/out/model_evaluation.csv
# includes output in 3_predictions/cfg/uncal_settings.yml
3_predictions/out/uncal_sntemp_input_output.feather.ind:
command: extract_sntemp_nc(
out_ind = target_name,
firstdate = I('1979-01-01'),
in_ind = '3_predictions/in/uncal_sntemp_input_output.nc.ind')
3_predictions/out/uncal_sntemp_preds.csv.ind:
command: pull_sntemp_preds(
sntemp_ind = '3_predictions/out/uncal_sntemp_input_output.feather.ind',
out_ind = target_name)
3_predictions/out/rgcn_v1_preds.feather.ind:
command: munge_rgcn_output(in_ind = '3_predictions/in/rgcn_v1_preds_raw.npy.ind', out_ind = target_name)
# put it all together!
3_predictions/out/compare_predictions_obs.feather.ind:
command: combine_preds_obs(
obs_ind = '2_observations/out/obs_temp_drb.rds.ind',
sntemp_ind = '3_predictions/out/uncal_sntemp_preds.csv.ind',
rgcn_v1_ind = '3_predictions/out/rgcn_v1_preds.feather.ind',
rgcn_v2_ind = '3_predictions/in/rgcn_v2_preds.feather.ind',
rgcn_v2_full_ind = '3_predictions/in/rgcn_v2_preds_full.feather.ind',
out_ind = target_name)
# write some model comparisons/stats and git commit for each comparison
3_predictions/out/model_evaluation.csv:
command: calc_metrics(
compare_ind = '3_predictions/out/compare_predictions_obs.feather.ind',
out_file = target_name)
# get GLM reservoir predictions
3_predictions/in/reservoir_downstream_preds.csv.ind:
command: get_sb_item(out_ind = target_name,
sb_id = I('624f21fad34e21f82769a7b1'),
sb_names = I('reservoir_downstream_preds.csv'))
# calculate decay rates to be used to weight GLM vs PRMS-SNTemp preds
# for Cannonsville
test_period:
command: c(I(c(seq(as.Date('1979-10-01'), as.Date('1984-09-30'), 1),
seq(as.Date('2010-10-01'), as.Date('2015-09-30'), 1),
seq(as.Date('2020-10-01'), as.Date('2021-09-30'), 1))))
cannonsville_decay_estimate:
command: calc_decay(
segs_downstream = I(c('1566', '1563', '1565' , '1571', '1572')),
reservoir_nhdid = I('nhdhr_120022743'),
glm_preds_file = '3_predictions/in/reservoir_downstream_preds.csv.ind',
preds_obs_ind = '3_predictions/out/compare_predictions_obs.feather.ind',
crosswalk_ind = '2_observations/out/crosswalk_site_reach.rds.ind',
reservoir_subseg = I('128_1'),
test_period = test_period)
pepacton_decay_estimate:
command: calc_decay(
segs_downstream = I(c('1444', '1450', '1459', '1461', '1462', '1463')),
reservoir_nhdid = I('nhdhr_151957878'),
glm_preds_file = '3_predictions/in/reservoir_downstream_preds.csv.ind',
preds_obs_ind = '3_predictions/out/compare_predictions_obs.feather.ind',
crosswalk_ind = '2_observations/out/crosswalk_site_reach.rds.ind',
reservoir_subseg = I('15_1'),
test_period = test_period)
# object that retains observations and sntemp predictions for comparison purposes
dwallin_preds:
command: combine_dwallin_models(
west = cannonsville_decay_estimate,
east = pepacton_decay_estimate,
distance_ind = '1_network/out/subseg_distance_matrix.rds.ind',
confluence_subseg = I('140_1'),
west_subseg = I('128_1'),
east_subseg = I('15_1'))
# pare down columns and write to file for data release
3_predictions/out/dwallin_stream_preds.csv.ind:
command: simplify_and_write(dwallin_preds, target_name)