Commit 9c05d595 authored by Conor Anderson's avatar Conor Anderson

Revert "Use total precip when converting to mm"

This reverts commit 830e72ba.
parent 830e72ba
......@@ -14,4 +14,4 @@ _Conjuntool_ is a free, open source platform for the accessing and processing Ge
## Why "_Conjuntool_"?:
The _Conjuntool_ (roughly: <a href="https://ipa.vpzom.click/api/synthesize/[ko%C5%8B%CB%88xuntu:l]" target="_blank">[koŋˈxuntu:l]</a>) is an open-source "re-imagining" of the UTSC Ensemble tool, a closed, limited-access platform has been used in the UTSC Climate Lab. The restricted nature of the Ensemble tool runs counter to my commitment to use only open-source software and open methodology in my research. I started writing the code that underlies this tool in Tarapoto, Peru. _Conjuntool_ is a portmanteau of "_conjunto_" (the Spanish word for "ensemble") and "tool".
The _Conjuntool_ is an open-source "re-imagining" of the UTSC Ensemble tool, a closed, limited-access platform has been used in the UTSC Climate Lab. The restricted nature of the Ensemble tool runs counter to my commitment to use only open-source software and open methodology in my research. I started writing the code that underlies this tool in Tarapoto, Peru. _Conjuntool_ is a portmanteau of "_conjunto_" (the Spanish word for "ensemble") and "tool".
......@@ -79,16 +79,14 @@ shinyServer(function(input, output, session) {
validate(need(plot_model_in(), "Continue filtering to a single model."))
plot_data <- get_plot_data()
if (input$period_in == "Annual") {
agg <- if (input$var_filter_plot %in% c("tas", "tasmax", "tasmin") ||
!input$convert_units_plot) mean else sum
plot_data <- plot_data %>%
group_by(Time = as.integer(format(plot_data$Time, format = "%Y"))) %>%
summarize(Value = agg(Value, na.rm = TRUE))
summarize(Value = mean(Value, na.rm = TRUE))
}
validate(need(input$types_in, "Select at least one plot type, below."))
isolate({
if (input$convert_units_plot) {
label <- ifelse((input$var_filter_plot %in% c("tas", "tasmax", "tasmin")), "Temperature (°C)", "Total Precipitation (mm)")
label <- ifelse((input$var_filter_plot %in% c("tas", "tasmax", "tasmin")), "Temperature (°C)", "Precipitation (mm)")
} else {
label <- ifelse((input$var_filter_plot %in% c("tas", "tasmax", "tasmin")), "Temperature (K)", "Precipitation Flux (kg·m⁻²·s⁻¹)")
}
......@@ -191,7 +189,7 @@ shinyServer(function(input, output, session) {
tas = "Mean Temperature",
tasmin = "Minimum Temperature",
tasmax = "Maximum Temperature",
pr = "Total Precipitation",
pr = "Precipitation",
prc = "Convective Precipitation",
"Nothing here yet!")
if (isTRUE(input$convert_units)) {
......@@ -278,13 +276,6 @@ shinyServer(function(input, output, session) {
if (reac$anom_period_in == "Seasonal" && !is.null(reac$anom_selected_periods)) {
anom_data <- filter(anom_data, Season %in% reac$anom_selected_periods)
}
if (isolate(input$var_filter) %in% c("pr", "prc") && isolate(isTRUE(input$convert_units))) {
if (reac$anom_period_in == "Seasonal") {
anom_data <- mutate_at(anom_data, vars(contains("-")), funs(. * 3))
} else if (reac$anom_period_in == "Annual") {
anom_data <- mutate_at(anom_data, vars(contains("-")), funs(. * 12))
}
}
anom_data
})
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment