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 7
/
6_network.yml
138 lines (116 loc) · 5.63 KB
/
6_network.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
#target_default: site_reach_mapping.rds
packages:
- scipiper
- dplyr
- sf
- parallel
- nhdplusTools
- tidyr
- assertthat
- sbtools
- ggmap
- ggsn
sources:
- 6_network/src/get_network.R
- 6_network/src/match_sites_reaches.R
- 6_network/src/plot_tasks.R
- 6_network/src/visuals.R
targets:
6_all_plots:
depends:
- 6_network/out/most_sites_reaches_plots.zip.ind
- 6_network/out/longest_reaches_plots.zip.ind
- 6_network/out/shortest_reaches_plots.zip.ind
- 6_network/out/random_site_reaches_plots.zip.ind
- 6_network/out/order_one_reaches_plots.zip.ind
- 6_network/out/site_reach_distances.png.ind
- 6_network/out/sites_per_reach.png.ind
- 6_network/out/site_distance_vs_reach_length.png.ind
# download and indicate the national geospatial fabric.
# comes from ScienceBase: https://www.sciencebase.gov/catalog/item/5e29d1a0e4b0a79317cf7f63
#may need permission
6_network/in/GFv1.1.gdb.ind:
command: get_national_gf(
out_ind=target_name,
sb_id = I('5e29d1a0e4b0a79317cf7f63'),
sb_name = I('GFv1.1.gdb.zip'))
#pull out endpoints of each reach
6_network/out/reach_endpoints.rds.ind:
command: find_endpoints(
out_ind = target_name,
national_network = I('6_network/in/GFv1.1.gdb'))
#determine up/downstream endpoints
6_network/out/reach_direction.rds.ind:
command: compute_up_down_stream_endpoints(
out_ind = target_name,
reaches_bounded_ind = '6_network/out/reach_endpoints.rds.ind')
#match sites with flowlines
6_network/out/site_flowlines.rds.ind:
command: get_site_flowlines(
outind = target_name,
reaches_direction_ind = '6_network/out/reach_direction.rds.ind',
sites_ind = '5_data_munge/out/stream_sites_us.rds.ind',
search_radius = 500)
# create a crosswalk to go from sites to reach IDs
6_network/out/site_stream_crosswalk.rds.ind:
command: create_crosswalk(
out_ind = target_name,
matched_ind = '6_network/out/site_flowlines.rds.ind',
sites_ind = '5_data_munge/out/stream_sites_us.rds.ind')
reaches_direction_latlon:
command: transform_network_file('6_network/out/reach_direction.rds.ind',
crs = I(4326))
#from the set of reaches that were matched with sites, generate graphics
#for a random subset, plus focus on edge cases:
# longest/shortest reaches, most sites, network density? low stream order?
#summary metrics?
reaches_to_check:
command: sample_reaches(matched_sites_ind = '6_network/out/site_flowlines.rds.ind',
full_network = reaches_direction_latlon)
##### visuals ######
# these are some targeted and random checks on site-to-reach matches
# gd_get these indicator files to grab the files from drive
6_network/out/longest_reaches_plots.zip.ind:
command: make_site_reach_plots(outind = target_name,
reaches_to_check = reaches_to_check,
network_latlon = reaches_direction_latlon,
category = I('longest_reaches'),
'6_network/src/plot_tasks.R',
'6_network/src/match_sites_reaches.R')
6_network/out/shortest_reaches_plots.zip.ind:
command: make_site_reach_plots(outind = target_name,
reaches_to_check = reaches_to_check,
network_latlon = reaches_direction_latlon,
category = I('shortest_reaches'),
'6_network/src/plot_tasks.R',
'6_network/src/match_sites_reaches.R')
6_network/out/most_sites_reaches_plots.zip.ind:
command: make_site_reach_plots(outind = target_name,
reaches_to_check = reaches_to_check,
network_latlon = reaches_direction_latlon,
category = I('most_sites_reaches'),
'6_network/src/plot_tasks.R',
'6_network/src/match_sites_reaches.R')
6_network/out/random_site_reaches_plots.zip.ind:
command: make_site_reach_plots(outind = target_name,
reaches_to_check = reaches_to_check,
network_latlon = reaches_direction_latlon,
category = I('random_site_reaches'),
'6_network/src/plot_tasks.R',
'6_network/src/match_sites_reaches.R')
6_network/out/site_reach_distances.png.ind:
command: site_reach_distance_plot(target_name,
sites_reaches_ind = '6_network/out/site_flowlines.rds.ind')
6_network/out/sites_per_reach.png.ind:
command: sites_per_reach_plot(target_name,
sites_reaches_ind = '6_network/out/site_flowlines.rds.ind')
6_network/out/site_distance_vs_reach_length.png.ind:
command: distance_vs_reach_length_plot(target_name,
sites_reaches_ind = '6_network/out/site_flowlines.rds.ind')
6_network/out/order_one_reaches_plots.zip.ind:
command: make_site_reach_plots(outind = target_name,
reaches_to_check = reaches_to_check,
network_latlon = reaches_direction_latlon,
category = I('order_one_reaches'),
'6_network/src/plot_tasks.R',
'6_network/src/match_sites_reaches.R')