Skip to content

Commit

Permalink
Modified pda.mcmc to be part of package export and to only be called …
Browse files Browse the repository at this point in the history
…if in settings
  • Loading branch information
mdietze committed May 8, 2015
1 parent 8557497 commit bc6951e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
1 change: 1 addition & 0 deletions modules/assim.batch/NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export(pda.mcmc)
1 change: 1 addition & 0 deletions modules/assim.batch/R/pda.mcmc.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
##'
##' @author Mike Dietze
##' @author Ryan Kelly
##' @export
pda.mcmc <- function(settings, params=NULL, jvar=NULL, var.names=NULL, prior=NULL, chain=NULL,
adapt=NULL, adj.min=NULL, ar.target=NULL){
# Quit if pda not requested in settings
Expand Down
12 changes: 6 additions & 6 deletions modules/assim.batch/man/pda.mcmc.Rd
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/pda.mcmc.R
\name{pda.mcmc}
\alias{pda.mcmc}
\title{Paramater Data Assimilation using MCMC}
\usage{
pda.mcmc(settings)
pda.mcmc(settings, params = NULL, jvar = NULL, var.names = NULL,
prior = NULL, chain = NULL, adapt = NULL, adj.min = NULL,
ar.target = NULL)
}
\arguments{
\item{settings}{= a pecan settings list}
\item{settings}{= a pecan settings list}
}
\value{
nothing. Diagnostic plots, MCMC samples, and posterior distributions
are saved as files and db records.
nothing. Diagnostic plots, MCMC samples, and posterior
distributions are saved as files and db records.
}
\description{
Paramater Data Assimilation using MCMC
Expand Down
12 changes: 7 additions & 5 deletions web/workflow.R
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,13 @@ run.sensitivity.analysis()
status.end()

# Run parameter data assimilation
status.start("PDA")
settings$assim.batch <- pda.mcmc(settings)
saveXML(listToXml(settings, "pecan"), file=file.path(settings$outdir, 'pecan.pda.xml'))
status.end()

if(('assim.batch' %in% names(settings))) {
status.start("PDA")
settings$assim.batch <- pda.mcmc(settings)
saveXML(listToXml(settings, "pecan"), file=file.path(settings$outdir, 'pecan.pda.xml'))
status.end()
}

# all done
status.start("FINISHED")
db.query(paste("UPDATE workflows SET finished_at=NOW() WHERE id=", settings$workflow$id, "AND finished_at IS NULL"), params=settings$database$bety)
Expand Down

0 comments on commit bc6951e

Please sign in to comment.