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
/
1_network.yml
88 lines (75 loc) · 3.35 KB
/
1_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
target_default: 1_network
packages:
- sf
- tidyverse
- lwgeom
- smoothr
- igraph
- purrr
- scipiper
- geojsonio
sources:
- 1_network/src/geo_fabric_functions.R
- 1_network/src/get_national_gf.R
- 1_network/src/calc_distance_functions.R
- 1_network/src/network_dam_res_reaches.R
- 1_network/src/reach_classification.R
targets:
1_network:
depends:
- 1_network/out/boundary.rds.ind
- 1_network/out/network.rds.ind
- 1_network/out/network.json.ind
- 1_network/out/subseg_distance_matrix.rds.ind
- 1_network/out/subseg_reservoir_mapping.rds.ind
# unzip the PRMS segments shapefile
1_network/in/delaware_stream_temp_by_segment/delaware_segments/delaware_segments.shp:
command: unzip('1_network/in/delaware_stream_temp_by_segment.zip', exdir=I('1_network/in'))
# read the dam and reservoir data
1_network/out/global_dams.rds.ind:
command: zipped_shp_to_rds(out_ind = target_name,
zip_ind = '1_network/in/dams-rev01-global-shp.zip.ind')
1_network/out/global_reservoirs.rds.ind:
command: zipped_shp_to_rds(out_ind = target_name,
zip_ind = '1_network/in/reservoirs-rev01-global-shp.zip.ind')
# download and indicate the national geospatial fabric.
# comes from ScienceBase: https://www.sciencebase.gov/catalog/item/5362b683e4b0c409c6289bf6
1_network/in/GeospatialFabric_National.gdb.ind:
command: get_national_gf(
out_ind=target_name,
sb_id = I('5362b683e4b0c409c6289bf6'),
sb_name = I('GeospatialFabric_National.gdb.zip'))
# refine the GF network to have reach breaks at every reach intersection, etc.
1_network/out/network.rds.ind:
command: revise_raw_network(
out_ind = target_name,
subset_network = I('1_network/in/delaware_stream_temp_by_segment/delaware_segments/delaware_segments.shp'),
national_network = I('1_network/in/GeospatialFabric_National.gdb'))
1_network/out/network.json.ind:
command: save_network_as_geojson(
out_ind = target_name,
network_ind = '1_network/out/network.rds.ind')
1_network/out/boundary.rds.ind:
command: create_boundary(
out_ind = target_name,
subset_network = I('1_network/in/delaware_stream_temp_by_segment/delaware_segments/delaware_segments.shp'),
national_network = I('1_network/in/GeospatialFabric_National.gdb'))
# generate network distance matrix
1_network/out/subseg_distance_matrix.rds.ind:
command: calc_dist_matrices(network_ind = '1_network/out/network.rds.ind', out_ind = target_name)
# intersect dams and reservoirs with reaches
1_network/out/filtered_dams_reservoirs.rds.ind:
command: filter_dams_reservoirs_by_boundary(out_ind = target_name,
dams_shp_ind = '1_network/out/global_dams.rds.ind',
reservoirs_shp_ind = '1_network/out/global_reservoirs.rds.ind',
boundary_ind = '1_network/out/boundary.rds.ind')
1_network/out/subseg_reservoir_mapping.rds.ind:
command: intersect_network_with_reservoirs(out_ind = target_name,
stream_network_ind = '1_network/out/network.rds.ind',
dams_reservoirs_ind = '1_network/out/filtered_dams_reservoirs.rds.ind')
# ID segments that are up/down from a reservoir
1_network/out/segments_relative_to_reservoirs.rds.ind:
command: classify_segments(
out_ind = target_name,
network_ind = '1_network/out/network.rds.ind',
reservoir_ind = '1_network/out/subseg_reservoir_mapping.rds.ind')