Outdoor air temperature in Finland: Difference between revisions
Jump to navigation
Jump to search
(Data uploaded using Opasnet Base Import) |
(ovariable code) |
||
Line 7: | Line 7: | ||
== Answer == | == Answer == | ||
<rcode graphics=1 embed=1> | |||
library(OpasnetUtils) | |||
library(ggplot2) | |||
objects.latest("Op_en2959", code_name = "temperature") | |||
ggplot(subset(temperdays@data, Time %in% c("2013", "2030", "2050")), aes(x = Temperature, y = Result, color = Time, group = Time))+geom_line() | |||
</rcode> | |||
== Rationale == | == Rationale == | ||
Line 17: | Line 26: | ||
=== Calculations === | === Calculations === | ||
<rcode embed= | <rcode name="temperature" label="Initiate temperature (developers only)" embed=1> | ||
## This is code is Op_en2959/temperatures [[Outdoor air temperature in Finland]] | ## This is code is Op_en2959/temperatures [[Outdoor air temperature in Finland]] | ||
library(OpasnetUtils) | library(OpasnetUtils) | ||
ta <- opbase.data("Op_en2959", subset = "Vantaa") # [[Outdoor air temperature in Finland]] | ta <- opbase.data("Op_en2959", subset = "Vantaa") # [[Outdoor air temperature in Finland]] | ||
levels(ta$Year)[as.numeric(as.character(levels(ta$Year))) < 2015] <- "2012" | |||
ta$Date <- as.POSIXct(paste(ta$Year, ta$Month, ta$Day, sep = "-")) | |||
days <- aggregate(ta[c( | |||
"Temperature" # We only need temperature, but it is easy to take any other variable as well. | |||
# "Relative_humidity", | |||
# "Wind_direction", | |||
# "Wind_speed", | |||
# "Direct_normal_solar_radiation", | |||
# "Diffuse_horisontal_radiation", | |||
# "Result" # Global_horizontal_radiation | |||
)], ta[c("Date", "Year")], FUN = mean) | |||
colnames(days)[colnames(days) == "Temperature"] <- "Result" | |||
days$Temperature <- cut(days$Result, breaks = seq(-30, 33, 3)) | |||
temperatures <- Ovariable("temperature", data = aggregate(days["Result"], days[c("Temperature", "Year")], FUN = mean)) | |||
temperdays <- Ovariable("temperdays", data = aggregate(days["Result"], days[c("Temperature", "Year")], FUN = length)) | |||
years = data.frame(Time = 1985:2070, Year = c(rep("2012", 36), rep("2030", 20), rep("2050", 30))) | |||
temperatures@data <- merge(temperatures@data, years) | |||
temperatures@data$Year <- NULL | |||
temperdays@data <- merge(temperdays@data, years) | |||
temperdays <- | temperdays@data$Year <- NULL | ||
objects.store(temperatures, temperdays) | objects.store(temperatures, temperdays) | ||
Line 50: | Line 67: | ||
*[[CLAIH assessment]] | *[[CLAIH assessment]] | ||
{{Helsinki energy decision}} | {{Helsinki energy decision 2015}} | ||
==References== | ==References== |
Revision as of 14:19, 11 October 2015
Moderator:Jouni (see all) |
|
Upload data
|
Question
What are the outdoor air temperatures in Finland previously, now and in the future in different climate areas?
Answer
Rationale
Data from Statistics Finland:
- Current temperature, wind, and solar radiation
- Future temperature, wind, and solar radiation
- The data contains the following parameters: Timestep Year Month Day Time Temperature(°C) Relative_humidity(%) Wind_direction(degrees) Wind_speed(m/s) Direct_normal_solar_radiation(W/m2) Diffuse_horisontal_radiation(W/m2) Global_horisontal_radiation(W/m2)
Calculations
See also
References