Skip to content

Commit

Permalink
Merge pull request #4 from VForWaTer/dev_gis
Browse files Browse the repository at this point in the history
make_hillslope_geometry
  • Loading branch information
Ash-Manoj authored Nov 5, 2024
2 parents e74c7f1 + 8110ef9 commit 0dda3b6
Show file tree
Hide file tree
Showing 32 changed files with 10,775 additions and 2,116 deletions.
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')"

# 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

0 comments on commit 0dda3b6

Please sign in to comment.