Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make_hillslope_geometry #4

Merged
merged 14 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions .gitignore

This file was deleted.

26 changes: 13 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
# Pull any base image that includes R
FROM r-base:4.2.0
FROM rocker/geospatial

# the parameter parsing function always needs the rjson and yaml packages
RUN R -e "install.packages(c('jsonlite', 'yaml'))"

# install json2aRgs v0.3.0 to parse parameters from /in/parameters.json
RUN wget -q https://cran.r-project.org/src/contrib/json2aRgs_0.3.0.tar.gz
RUN R CMD INSTALL json2aRgs_0.3.0.tar.gz

# remove json2aRgs tarball
RUN rm json2aRgs_0.3.0.tar.gz
# install json2aRgs latest version from github
RUN R -e 'install.packages("remotes")'
RUN R -e 'remotes::install_github("VForWaTer/json2aRgs")'

# install Catflow-R-Package dependencies
RUN R -e "install.packages(c('deSolve', 'RColorBrewer', 'zoo', 'xts'))"

# install gdal
RUN apt-get update && apt-get install -y libgdal-dev

# install representative hillslope dependencies
RUN R -e "install.packages(c('rgdal', 'raster'))"

# create the tool input structure
RUN mkdir /in
COPY ./in /in
RUN mkdir /out
RUN mkdir /src
COPY ./src /src

RUN R -e "install.packages(c('raster'))"

# download latest version of Catflow-R-Package from github, untar and rename
RUN wget -qO- https://github.com/CATFLOW/Catflow-R-Package/archive/refs/heads/main.tar.gz | tar xz -C src/ && mv /src/Catflow-R-Package-main /src/Catflow-R-Package

# install Catflow-R-Package from source
RUN R -e "install.packages('/src/Catflow-R-Package/Catflow', repos = NULL, type = 'source')"
Ash-Manoj marked this conversation as resolved.
Show resolved Hide resolved

# install representative hillslope dependencies
# Download rgdal package archive, untar, and rename
RUN wget -qO- https://cran.r-project.org/src/contrib/Archive/rgdal/rgdal_1.6-7.tar.gz | tar xz -C src/

# Install rgdal package from source
RUN R -e "install.packages('/src/rgdal', repos = NULL, type = 'source')"

# delete Catflow-R-Pacakge source code
RUN rm -rf /src/Catflow-R-Package

Expand Down
File renamed without changes.
98 changes: 0 additions & 98 deletions in/climadat.csv

This file was deleted.

File renamed without changes.
File renamed without changes.
11 changes: 0 additions & 11 deletions in/fac.dat

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 21 additions & 0 deletions in/input.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"make_representative_hillslope": {
"parameters":{
"hillslope_id" : -1,
"no_flow_area" : 0.30,
"min_cells" : 10,
"hill_type" : "constant",
"depth" : 2.1
},
"data":{
"flow_accumulation" : "/in/flow_accumulation.tif",
"hillslopes" : "/in/hillslope.tif",
"elev2river" : "/in/elevation.tif",
"dist2river" : "/in/distance.tif",
"filled_dem" : "/in/fill_DEM.tif",
"aspect" : "/in/aspect.tif",
"river_id" : "/in/streams.tif"
}

}
}
Binary file removed in/make_geometry_out/geom.Rds
Binary file not shown.
103 changes: 0 additions & 103 deletions in/parameters.json

This file was deleted.

Loading