forked from DOI-USGS/lake-temperature-out
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path3_summarize.yml
155 lines (133 loc) · 5.53 KB
/
3_summarize.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
target_default: 3_summarize
packages:
- arrow
- data.table
- dplyr
- readr
- tidyr
sources:
- 3_summarize/src/combine_files_to_zip.R
- 3_summarize/src/calculate_total_benthic_area.R
- 2_process/src/calculate_toha.R # Has the benthic area fxn & resample_hypso
- 3_summarize/src/annual_thermal_metrics.R
- 3_summarize/src/do_annual_thermal_metric_tasks.R
- 3_summarize/src/plot_annual_metric_summaries.R
targets:
3_summarize:
depends:
# mntoha data release targets
- 3_summarize/out/3_summarize_zip_pb0_toha.yml
- 3_summarize/out/3_summarize_zip_pgdl_toha.yml
- 3_summarize/out/total_benthic_areas.csv
- 3_summarize/out/annual_metrics_pgdl.csv
- 3_summarize/out/annual_metrics_pb0.csv
# multi-state glm2 data release targets
- 3_summarize/out/annual_metrics_glm2pb0.csv
- 3_summarize/out/annual_metrics_glm2pball.csv
# climate projections glm3 data release target
- 3_summarize/out/annual_metrics_glm3pb0_gcms.csv
##-- MN TOHA Data Release --##
### Zip up lake toha files by lake group ###
3_summarize/out/3_summarize_zip_pb0_toha.yml:
command: rezip(
target_name = target_name,
sb_group_xwalk = sb_group_info,
sb_group_ids = sb_group_ids,
files_to_zip_ind = '2_process/out/2_pb0_lake_tasks.ind',
dest_dir = I('3_summarize/tmp'),
zip_out_prefix = I('pb0_toha'))
3_summarize/out/3_summarize_zip_pgdl_toha.yml:
command: rezip(
target_name = target_name,
sb_group_xwalk = sb_group_info,
sb_group_ids = sb_group_ids,
files_to_zip_ind = '2_process/out/2_pgdl_lake_tasks.ind',
dest_dir = I('3_summarize/tmp'),
zip_out_prefix = I('pgdl_toha'))
## Calculate total benthic area to use with TOHA areas --> TOHA as % Benthic Area ##
3_summarize/out/total_benthic_areas.csv:
command: calculate_total_benthic_area(
target_name = target_name,
morphometry = morphometry)
## Calculate a collection of annual thermal metrics
# Based these additional metrics on the ones included in a previous lake modeling
# data release (see https://www.sciencebase.gov/catalog/item/57d9e887e4b090824ffb1098)
temp_range_info:
command: read_tsv("3_summarize/in/temp_ranges_for_metrics.txt")
temp_ranges:
command: select(temp_range_info, I('Temp_Low'), I('Temp_High'))
3_summarize/out/annual_metrics_pgdl.csv:
command: do_annual_metrics_multi_lake(
final_target = target_name,
site_file_yml = "2_process/out/2_pgdl_grp_tasks_completed.yml",
ice_file_yml = "2_process/out/iceflags_unzipped.yml",
n_cores = 40,
morphometry = morphometry,
temp_ranges = temp_ranges,
'2_process/src/calculate_toha.R',
'3_summarize/src/annual_thermal_metrics.R',
'3_summarize/src/do_annual_thermal_metric_tasks.R')
3_summarize/out/annual_metrics_pb0.csv:
command: do_annual_metrics_multi_lake(
final_target = target_name,
site_file_yml = "2_process/out/2_pb0_grp_tasks_completed.yml",
ice_file_yml = "2_process/out/iceflags_unzipped.yml",
n_cores = 40,
morphometry = morphometry,
temp_ranges = temp_ranges,
'2_process/src/calculate_toha.R',
'3_summarize/src/annual_thermal_metrics.R',
'3_summarize/src/do_annual_thermal_metric_tasks.R')
##-- Multi-state GLM2 Data Release --##
3_summarize/out/annual_metrics_glm2pb0.csv:
command: do_annual_metrics_multi_lake(
final_target = target_name,
site_file_yml = "2_process/out/2_glm2_pb0_unzipped.yml",
ice_file_yml = "2_process/out/glm2_iceflags_unzipped.yml",
n_cores = 40,
morphometry = glm2_pb0_morphometry,
temp_ranges = temp_ranges,
site_file_regex = I("(pb0)_(.*)_temperatures(.csv)"),
ice_file_regex = I("pb0_(.*)_ice_flag.csv"),
tmpdir_suffix = I("_glm2"),
'2_process/src/calculate_toha.R',
'3_summarize/src/annual_thermal_metrics.R',
'3_summarize/src/do_annual_thermal_metric_tasks.R')
3_summarize/out/annual_metrics_glm2pball.csv:
command: do_annual_metrics_multi_lake(
final_target = target_name,
site_file_yml = "2_process/out/2_glm2_pball_unzipped.yml",
ice_file_yml = "2_process/out/glm2_iceflags_unzipped.yml",
n_cores = 40,
site_file_regex = I("(pball)_(.*)_temperatures(.csv)"),
ice_file_regex = I("pball_(.*)_ice_flag.csv"),
morph_prefix = I("glm2_pball_"),
tmpdir_suffix = I("_glm2"),
'2_process/src/calculate_toha.R',
'3_summarize/src/annual_thermal_metrics.R')
depends:
- temp_ranges
##-- GLM3 + GCM Projections Data Release --##
# Do all GCMs at once and combine into a single file
3_summarize/out/annual_metrics_glm3pb0_gcms.csv:
command: do_annual_metrics_multi_lake(
final_target = target_name,
site_file_yml = "1_fetch/out/pb0_temp_projections.yml",
ice_file_yml = I(NULL),
n_cores = 79,
morphometry = glm3_pb0gcm_proj_morphometry,
temp_ranges = temp_ranges,
site_file_regex = I("(GLM)_(.*)_(.*).feather"),
tmpdir_suffix = I("_proj"),
model_id_colname = I("GCM"),
suffix_as_model_id = I(TRUE),
'2_process/src/calculate_toha.R',
'3_summarize/src/annual_thermal_metrics.R',
'3_summarize/src/do_annual_thermal_metric_tasks.R')
# Verify outputs through some plots:
3_summarize/out_plots/annual_metrics_plots_gcms.yml:
command: plot_annual_metric_summaries(
target_name,
in_file = "3_summarize/out/annual_metrics_glm3pb0_gcms.csv",
target_dir = I("3_summarize/out_plots"),
model_id_colname = I("GCM"))