forked from USGS-R/delaware-model-prep
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[USGS-R#49] integrating catchment attribute code in pipeline
- Loading branch information
Showing
5 changed files
with
181 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# The purpose of these functions is to interface between | ||
# the scipiper pipeline and the Python code | ||
download_and_combine_sb_attr_data <- function(out_ind) { | ||
reticulate::use_condaenv("rgcn") | ||
out_file <- as_data_file(out_ind) | ||
catch_attr_py <- | ||
reticulate::import_from_path('catch_attr', path = '1_network/src/') | ||
catch_attr_py$download_and_combine_attr_data(out_file) | ||
gd_put(out_ind) | ||
} | ||
|
||
|
||
relate_attr_to_drb_segs <- | ||
function(out_ind, all_attr, geofabric, drb_network) { | ||
reticulate::use_condaenv("rgcn") | ||
out_file <- as_data_file(out_ind) | ||
attr_file <- as_data_file(all_attr) | ||
geofab_file <- as_data_file(geofabric) | ||
drb_net_file <- as_data_file(drb_network) | ||
|
||
catch_attr_py <- | ||
reticulate::import_from_path('catch_attr', path = '1_network/src/') | ||
catch_attr_py$relate_attr_to_drb_segs( | ||
out_file = out_file, | ||
attr_file = attr_file, | ||
geofab_file = geofab_file, | ||
drb_net_file = drb_net_file | ||
) | ||
gd_put(out_ind) | ||
} | ||
|
||
|
||
fetch_combine_catch_attr_metadata <- function(out_ind) { | ||
reticulate::use_condaenv("rgcn") | ||
out_file <- as_data_file(out_ind) | ||
catch_attr_py <- | ||
reticulate::import_from_path('catch_attr', path = '1_network/src/') | ||
catch_attr_py$fetch_combine_catch_attr_metadata(out_file) | ||
gd_put(out_ind) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.