forked from DOI-USGS/lake-temperature-out
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1_fetch.yml
206 lines (175 loc) · 6.89 KB
/
1_fetch.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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
target_default: 1_fetch
packages:
- sbtools
- readr
- jsonlite
sources:
- 1_fetch/src/fetch_sb_item_files.R
- 1_fetch/src/fetch_caldera_file_helpers.R
targets:
1_fetch:
depends:
# mntoha data release targets
- 1_fetch/out/lake_metadata.csv
- 1_fetch/out/config.json
- 1_fetch/out/irradiance_downloaded.yml
- 1_fetch/out/pb0_temp_pred_downloaded.yml
- 1_fetch/out/clarity_downloaded.yml
- 1_fetch/out/iceflags_downloaded.yml
- 1_fetch/out/glm2_lake_metadata.csv
# multi-state glm2 data release targets
- 1_fetch/out/glm2_pb0_config.json
- 1_fetch/out/glm2_pball_config.json
- 1_fetch/out/glm2_pb0_pball_temp_pred_downloaded.yml
- 1_fetch/out/glm2_iceflags_downloaded.yml
# error estimation temp data targets
- 1_fetch/out/temperature_observations.zip
- 1_fetch/out/pb0_matched_to_observations.zip
- 1_fetch/out/pgdl_matched_to_observations.zip
# climate projections glm3 data release target
- 1_fetch/out/pb0_temp_projections.yml
- 1_fetch/out/pb0_temp_projections_nml.rds.ind
sb_dl_date:
command: c(I("2021-04-08"))
##-- Download files for mntoha data release --##
toha_sbid:
command: c(I("5e5d0bb9e4b01d50924f2b36"))
clarity_ice_sbid:
command: c(I("5e5d0b96e4b01d50924f2b34"))
1_fetch/out/lake_metadata.csv:
command: download_sb_single_file(
target_name = target_name,
sb_id = I("5e5c1c1ce4b01d50924f27e7"),
sb_filename = I('lake_metadata.csv'),
dummy = sb_dl_date)
1_fetch/out/config.json:
command: download_sb_single_file(
target_name = target_name,
sb_id = I("5e5c1c36e4b01d50924f27ea"),
sb_filename = I('pb0_config.json'),
dummy = sb_dl_date)
1_fetch/out/irradiance_downloaded.yml:
command: download_sb_files(
target_name = target_name,
sb_id = toha_sbid,
keyword = I("irradiance"),
dest_folder = I("1_fetch/tmp"),
dummy = sb_dl_date)
1_fetch/out/pgdl_temp_pred_downloaded.yml:
command: download_sb_files(
target_name = target_name,
sb_id = toha_sbid,
keyword = I("pgdl_predictions"),
dest_folder = I("1_fetch/tmp"),
dummy = sb_dl_date)
1_fetch/out/pb0_temp_pred_downloaded.yml:
command: download_sb_files(
target_name = target_name,
sb_id = toha_sbid,
keyword = I("pb0_predictions"),
dest_folder = I("1_fetch/tmp"),
dummy = sb_dl_date)
1_fetch/out/clarity_downloaded.yml:
command: download_sb_files(
target_name = target_name,
sb_id = clarity_ice_sbid,
keyword = I("clarity"),
dest_folder = I("1_fetch/tmp"),
dummy = sb_dl_date)
1_fetch/out/iceflags_downloaded.yml:
command: download_sb_files(
target_name = target_name,
sb_id = clarity_ice_sbid,
keyword = I("ice_flags"),
dest_folder = I("1_fetch/tmp"),
dummy = sb_dl_date)
##-- Download files for multi-state glm2 data release --##
1_fetch/out/glm2_lake_metadata.csv:
command: download_sb_single_file(
target_name = target_name,
sb_id = I("5db8194be4b0b0c58b5a4c3c"),
sb_filename = I('01_lake_metadata.csv'),
dummy = sb_dl_date)
glm2_config_sbid:
command: c(I("5db81967e4b0b0c58b5a4c3f"))
1_fetch/out/glm2_pb0_config.json:
command: download_sb_single_file(
target_name = target_name,
sb_id = glm2_config_sbid,
sb_filename = I('pb0_config.json'),
dummy = sb_dl_date)
1_fetch/out/glm2_pball_config.json:
command: download_sb_single_file(
target_name = target_name,
sb_id = glm2_config_sbid,
sb_filename = I('pball_config.json'),
dummy = sb_dl_date)
# Add prefix to multi-file downloads in case previous
# pb0 ones (from mntoha release) are named the same
# This contains PB0 GLM2 and PBALL data in each zip.
1_fetch/out/glm2_pb0_pball_temp_pred_downloaded.yml:
command: download_sb_files(
target_name = target_name,
sb_id = I("5db819a8e4b0b0c58b5a4c45"),
keyword = I("predictions"),
dest_folder = I("1_fetch/tmp"),
dummy = sb_dl_date,
dest_file_prefix = I("glm2"))
1_fetch/out/glm2_iceflags_downloaded.yml:
command: download_sb_files(
target_name = target_name,
sb_id = I("5db81996e4b0b0c58b5a4c43"),
keyword = I("ice_flags"),
dest_folder = I("1_fetch/tmp"),
dummy = sb_dl_date,
dest_file_prefix = I("glm2"))
##-- Download files for error estimation --##
# All observed temperature data is in one
# CSV file that is zipped up
1_fetch/out/temperature_observations.zip:
command: download_sb_single_file(
target_name = target_name,
sb_id = I("5e5d0b68e4b01d50924f2b32"),
sb_filename = I("temperature_observations.zip"),
dummy = sb_dl_date)
# PB0 temp data matched to obs depths and dates
1_fetch/out/pb0_matched_to_observations.zip:
command: download_sb_single_file(
target_name = target_name,
sb_id = I("5e774324e4b01d509270e29f"),
sb_filename = I("pb0_matched_to_observations.zip"),
dummy = sb_dl_date)
# PGDL temp data matched to obs depths and dates
1_fetch/out/pgdl_matched_to_observations.zip:
command: download_sb_single_file(
target_name = target_name,
sb_id = I("5e774324e4b01d509270e29f"),
sb_filename = I("pgdl_matched_to_observations.zip"),
dummy = sb_dl_date)
##-- Access files for GLM3 + GCM projections data release --##
# TODO: Switch to downloading the NetCDF file(s) from ScienceBase
# to use as input instead. That would be less brittle.
# Identifying what lakes / GLM temp output files to use to for
# lake thermal metrics summaries depends on us changing this
# date to refresh the list of files and hashes. Not the most
# ideal process, but the function + practicality of this approach
# is a bit of a compromise right now so we can complete this work.
caldera_access_date:
command: c(I('2022-02-16'))
# These files from our process-models pipeline are also pushed to ScienceBase
# item `6206d3c2d34ec05caca53071` but since we are running this on Tallgrass
# we have access to Caldera and can skip the need to re-download.
1_fetch/out/pb0_temp_projections.yml:
command: indicate_dir_files(
target_name,
path = I('../lake-temperature-process-models/3_extract/out'),
pattern = I('GLM_nhdhr_(.*)(GFDL|IPSL|MIROC5|MRI|ACCESS|CNRM).feather'))
depends:
- caldera_access_date
# These files from our process-models pipeline are also pushed to ScienceBase
# item `6206d3c2d34ec05caca53071` but since we are running this on Tallgrass
# we have access to Caldera and can skip the need to re-download.
1_fetch/out/pb0_temp_projections_nml.rds.ind:
command: copy_caldera_files(target_name, files_in = I('../lake-temperature-process-models/1_prep/in/nml_list.rds'))
depends:
- caldera_access_date