Skip to content
Snippets Groups Projects
Commit e5c918d7 authored by Knap, Harmen1's avatar Knap, Harmen1
Browse files

Merge branch 'harmen' of https://git.wur.nl/wsg35306/marina-practical into harmen

parents a7470e80 87314ffc
Branches
No related tags found
No related merge requests found
FROM jupyter/datascience-notebook:2022-09-21
RUN mamba install -y -c conda-forge ipysheet
RUN mamba install -y -c conda-forge jupyter_contrib_nbextensions
RUN jupyter nbextension enable toc2/main
RUN jupyter nbextension enable hide_input/main
\ No newline at end of file
#27-09-2022 - Lisanne Nauta: modified windows file paths to platform independent file paths
#18 April 2016 was the last update. The code was written by Maryna Strokal
#set directory
......@@ -62,7 +63,7 @@ cal_par_o <- function(g5inputs) {
combined <- cbind(Gdin,Gdon,Gp,ECDIP,ECDON,ECDOP,fRnatDIP,fRnatDON,fRnatDOP,FEwsDIN,FEwsDIP,FEwsDON,FEwsDOP,FErivDINo,FErivDIPo,FErivDONo,FErivDOPo)
extra.col <- data.frame(code=rep(g5inputs$code), combined[,])
write.csv(extra.col, "calculated_parameters\\g5par_o.csv", row.names=F)
write.csv(extra.col, file.path("calculated_parameters","g5par_o.csv"), row.names=F)
g5FEws_G<-extra.col # returns produced .csv with calculations
}
......@@ -97,18 +98,18 @@ cal_par_m <- function(g5inputs_FErivm) {
combined <- cbind(FErivDINm,FErivDIPm,FErivDONm,FErivDOPm)
combined.code <- data.frame(code=rep(g5inputs$code), combined[,])
write.csv(combined.code,"calculated_parameters\\g5par_m.csv", row.names=F)
write.csv(combined.code, file.path("calculated_parameters","g5par_m.csv"), row.names=F)
c0FErivm<-combined.code
}
#quantifying river export of DIN, DON, DIP, DOP
g5inputs<-read.csv("inputs\\g5inputs.csv", header=T, sep=",") # read .csv inputs
g5inputs<-read.csv(file.path("inputs","g5inputs.csv"), header=T, sep=",") # read .csv inputs
for (i in 1:length(g5inputs)) {
# i=1 for testing
g5inputs_FErivm<-read.csv("inputs\\g5inputs_FErivm.csv",header=T, sep=",")
g5inputs_FErivm<-read.csv(file.path("inputs","g5inputs_FErivm.csv"),header=T, sep=",")
g5par_o<-cal_par_o(g5inputs) # call function that quantifies model parameters: FEws, EC, FEriv for outlets
g5par_m<-cal_par_m(g5inputs_FErivm) # call functions that quantifies FEriv for mouths
......@@ -154,7 +155,7 @@ for (i in 1:length(g5inputs)) {
combined2 <- cbind(DINdiffe,DINdifma,DINdifhum,DINdiffxag,DINdifdpag,DINdiffxna,DINdifdpna,DINpntma,DINpnthumuncon,DINpnthumcon,DONdiffe,DONdifma,DONdifhum,DONdiflchag,DONdiflchna,DONpntma,DONpnthumuncon,DONpnthumcon,DIPdiffe,DIPdifma,DIPdifhum,DIPdifwthag,DIPdifwthna,DIPpntma,DIPpnthumuncon,DIPpnthumcon,DIPpntdetcon,DOPdiffe,DOPdifma,DOPdifhum,DOPdiflchag,DOPdiflchna,DOPpntma,DOPpnthumuncon,DOPpnthumcon,DOPpntdetcon)
extra.col2 <- data.frame(code=rep(g5inputs$code), combined2[,])
write.csv(extra.col2, "outputs\\g5outputs.csv", row.names=F)
write.csv(extra.col2, file.path("outputs","g5outputs.csv"), row.names=F)
}
......
code,areacell,frAgr,Nfe,Nma,Nhum,Nfxag,Ndpag,Nex,Nfxna,Ndpna,Npntma,Npnthumuncon,Npnthumcon,Pfe,Pma,Phum,Pex,Ppntma,Ppnthumuncon,Ppnthumcon,Ppntdetcon,FEpntDINhumcon,FEpntDONhumcon ,FEpntDIPhumcon ,FEpntDOPhumcon,Rnat,Ddin,Ddip,Ldin,Ldip,FQrem
1,58641.80078,0.618381419,174142000,119342649.2,23601181.4,21823000,167787008,151638000,35712400,101299000,116268358.8,10242022.12,6020005.062,87410600,21617388.78,3933530.233,28405800,24457611.22,3488224.924,880804.6568,369248,0.610739095,0.14,1,0.01,0.501767157,0.009525247,0.031495742,0.619941784,0.5,0.107767432
2,76653,0.258606969,73278000,68529981.5,35227328.43,12417900,76851696,79565800,90956600,222420992,52480018.5,15287331.21,8383747.061,37225300,12006069.35,5871221.405,14975700,11095730.65,5206554.831,1226650.705,514127,0.610739095,0.14,1,0.01,0.290225131,0.024439548,0.092805364,0.636146163,0.5,0.173173983
3,193659,0.779168539,762457984,519373463.7,99865603.77,99800600,586536000,678387008,67530704,180048992,488376552.3,50503356.36,28938590.24,325807008,93247114.12,16702264.44,122752000,102679893.9,16273384.71,4234090.301,1774140,0.610739095,0.14,1,0.01,0.495553763,0.315661376,0.85,0.65,0.5,0.131430367
4,30865.5,0.545975305,221471008,82650192.6,22817822.43,10624300,75112704,123155000,22430700,67356400,82431807.4,9902073.883,0,54313900,15802755.01,3802970.404,22025000,18891344.99,3372445.453,0,0,0.610739095,0.14,1,0.01,0.7347099,0.322883946,0.85,0.581112357,0.5,0.10385736
5,33890,0.555066368,189620000,72762821.84,17585871.17,10880200,70917696,117308000,22605100,49615300,72302170.16,7631604.471,5272122.727,47443700,13806733.35,2930978.529,21237600,16606866.65,2599169.639,439343.5606,187603.0529,0.74,0.14,1,0.01,0.728964144,0.347889522,0.85,0.586767954,0.5,0.153919973
6,48224.30078,0.561312449,351568992,110245072,20640641.6,20420300,109702000,228123008,31678600,87389296,108311920,8957259.564,70486682.77,79616496,21055584.55,3440106.934,40914300,24793715.45,3050660.866,10313113.99,4321860,0.610739095,0.14,1,0.01,0.708988966,0,0,0.608108909,0.5,0.250028407
# Windows Laptop
## PREREQUISITE
### Source Code
......@@ -36,4 +38,24 @@ conda activate marina_pract
jupyter notebook
```
# Docker Setup
## PREREQUISITE
### Source Code
Download the source code from [GitLab](https://git.wur.nl/wsg35306/marina-practical/).
### Docker
Download Docker or Docker Desktop
## Setup
1) Open powershell (windows) or macOS command prompt
2) Change directory to the same level as the Dockerfile.
3) **Make sure your working directory is on the same level as the Dockerfile.**
4) Run the following command: `docker build -t marinapractical:latest .`
5) Run the following command: `docker create -v ${pwd}:/home/jovyan/marina_practical -it -e DOCKER_STACKS_JUPYTER_CMD=notebook -p 8888:8888 --name marinapractical marinapractical`
6) Open Docker Desktop.
7) Go to containers/apps section.
8) Start marinapractical container.
9) Click on the container to see the logs.
10) Copy the url and paste in a browser.
docker build -t marinapractical:latest .
\ No newline at end of file
docker create -v ${pwd}:/home/jovyan/marina_practical -it -e DOCKER_STACKS_JUPYTER_CMD=notebook -p 8888:8888 --name marinapractical marinapractical
\ No newline at end of file
docker run -v ${pwd}:/home/jovyan/marina_practical -it -e DOCKER_STACKS_JUPYTER_CMD=notebook -p 8888:8888 --name marinapractical marinapractical
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment