Skip to content

Commit

Permalink
Merge pull request #207 from lawinslow/master
Browse files Browse the repository at this point in the history
Fixed plotting issue and added whole.lake temp helper function
  • Loading branch information
Luke Winslow committed May 2, 2016
2 parents 075ac42 + 1348c9f commit 1dc0085
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: glmtools
Type: Package
Title: glmtools
Version: 0.14.0
Version: 0.14.1
Date: 2016-03-28
Authors@R: c( person("Jordan", "Read", role = c("aut","cre"),
email = "[email protected]"),
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export(sim_vars)
export(summarize_sim)
export(validate_sim)
export(water.temperature)
export(whole.lake.temperature)
export(write_nml)
import(GLMr)
import(rLakeAnalyzer)
Expand Down
2 changes: 1 addition & 1 deletion R/plot_var_compare.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ plot_var_compare = function(nc_file, field_file, var_name, fig_path = FALSE, res
y = data$Depth
z = data[,paste0('Observed_', var_name)]
x_out = sort(unique(x))
y_out = sort(unique(mod_depths))
y_out = sort(unique(c(y, mod_depths)))

#remove any NA values before the 2D interp
x = x[!is.na(z)]
Expand Down
16 changes: 16 additions & 0 deletions R/whole.lake.temperature.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#'@title Get volumetrically averaged whole lake temperature
#'@details A metric function used like an rLakeAnalyzer function to be
#'called by \code{\link{sim_metrics}}
#'@param wtr a water temperature vector
#'
#'@import rLakeAnalyzer
#'
#'@seealso \code{\link{sim_metrics}}, \code{\link{compare_to_field}}, \code{\link{validate_sim}}
#'@export
whole.lake.temperature <- function(wtr, depths, bthA, bthD){


avg_temp = layer.temperature(0,max(depths), wtr=wtr, depths=depths, bthA=bthA, bthD=bthD)

return(avg_temp)
}
19 changes: 19 additions & 0 deletions man/whole.lake.temperature.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1dc0085

Please sign in to comment.