Radon concentration from INESC TEC station (Porto) - 2019

In [1]:
options(jupyter.plot_mimetypes = c("text/plain", "image/png" )) 
options(repr.plot.width=8, repr.plot.height=4)

suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(zoo))
suppressPackageStartupMessages(library(lubridate))
suppressPackageStartupMessages(library(RCurl))
In [3]:
myfile <- getURL('https://rdm.inesctec.pt/dataset/8e80ec16-8124-4305-9d75-d0816ddc15b2/resource/f57fbabd-c96f-4931-bccc-696774464301/download/radoninesc201901.txt',ssl.verifyhost=FALSE, ssl.verifypeer=FALSE)
dat=read.table(textConnection(myfile),header=FALSE,sep="",stringsAsFactors=FALSE)

# data date/time as POSIXct
dat.times=as.POSIXct(paste(dat$V1,dat$V2),format="%Y-%m-%d %H:%M:%S",tz="UTC")

start.time=dat.times[1]
end.time=dat.times[length(dat.times)]

print(paste("data from", start.time, "to", end.time))

Rn=dat$V3

# check for continuity of record [0 --> continuous record]; result=number of gaps
# 6h measurements --> 21600 sec
ngaps=length(which(c(1,round(diff(unclass(dat.times)/21600)))!=1))
gaps=which(c(1,round(diff(unclass(dat.times)/21600)))!=1)

#fill-in gaps by adding missing times as NA values 
all.times <- seq.POSIXt(from=start.time, to=end.time, by=21600)
df <- data.frame(dat.times=all.times,stringsAsFactors=FALSE)
data2019.01 <- full_join(df,data.frame(dat.times=dat.times, Rn=Rn))
[1] "data from 2019-01-01 to 2019-01-31 18:00:00"
Joining, by = "dat.times"
In [5]:
ts.zoo=zoo(data2019.01$Rn,data2019.01$dat.times)

times <- time(zoo(ts.zoo))
ticks <- seq(times[1], times[length(times)], by = "days")

fmt <- "%d-%m" # format for axis labels
labs <- format(ticks, fmt)

plot(ts.zoo,ylab = "Rn (Bq/m3)",xlab="day",col="darkmagenta", main="January 2019",xaxt="n",type="b",pch=20)
axis(1, at = ticks,labels=labs, tcl = -0.3)
In [8]:
myfile <- getURL('https://rdm.inesctec.pt/dataset/8e80ec16-8124-4305-9d75-d0816ddc15b2/resource/5e12584b-327f-4066-92f6-cc10394b6d90/download/radoninesc201902.txt',ssl.verifyhost=FALSE, ssl.verifypeer=FALSE)
dat=read.table(textConnection(myfile),header=FALSE,sep="",stringsAsFactors=FALSE)

# data date/time as POSIXct
dat.times=as.POSIXct(paste(dat$V1,dat$V2),format="%Y-%m-%d %H:%M:%S",tz="UTC")

start.time=dat.times[1]
end.time=dat.times[length(dat.times)]

print(paste("data from", start.time, "to", end.time))

Rn=dat$V3

# check for continuity of record [0 --> continuous record]; result=number of gaps
# 6h measurements --> 21600 sec
ngaps=length(which(c(1,round(diff(unclass(dat.times)/21600)))!=1))
gaps=which(c(1,round(diff(unclass(dat.times)/21600)))!=1)

#fill-in gaps by adding missing times as NA values 
all.times <- seq.POSIXt(from=start.time, to=end.time, by=21600)
df <- data.frame(dat.times=all.times,stringsAsFactors=FALSE)
data2019.02 <- full_join(df,data.frame(dat.times=dat.times, Rn=Rn))
[1] "data from 2019-02-01 to 2019-02-28 18:00:00"
Joining, by = "dat.times"
In [9]:
ts.zoo=zoo(data2019.02$Rn,data2019.02$dat.times)

times <- time(zoo(ts.zoo))
ticks <- seq(times[1], times[length(times)], by = "days")

fmt <- "%d-%m" # format for axis labels
labs <- format(ticks, fmt)

plot(ts.zoo,ylab = "Rn (Bq/m3)",xlab="day",col="darkmagenta", main="February 2019",xaxt="n",type="b",pch=20)
axis(1, at = ticks,labels=labs, tcl = -0.3)
In [10]:
myfile <- getURL('https://rdm.inesctec.pt/dataset/8e80ec16-8124-4305-9d75-d0816ddc15b2/resource/805df922-b208-4499-8e0c-0d8ead9db628/download/radoninesc201903.txt',ssl.verifyhost=FALSE, ssl.verifypeer=FALSE)
dat=read.table(textConnection(myfile),header=FALSE,sep="",stringsAsFactors=FALSE)

# data date/time as POSIXct
dat.times=as.POSIXct(paste(dat$V1,dat$V2),format="%Y-%m-%d %H:%M:%S",tz="UTC")

start.time=dat.times[1]
end.time=dat.times[length(dat.times)]

print(paste("data from", start.time, "to", end.time))

Rn=dat$V3

# check for continuity of record [0 --> continuous record]; result=number of gaps
# 6h measurements --> 21600 sec
ngaps=length(which(c(1,round(diff(unclass(dat.times)/21600)))!=1))
gaps=which(c(1,round(diff(unclass(dat.times)/21600)))!=1)

#fill-in gaps by adding missing times as NA values 
all.times <- seq.POSIXt(from=start.time, to=end.time, by=21600)
df <- data.frame(dat.times=all.times,stringsAsFactors=FALSE)
data2019.03 <- full_join(df,data.frame(dat.times=dat.times, Rn=Rn))
[1] "data from 2019-03-01 to 2019-03-31 18:00:00"
Joining, by = "dat.times"
In [11]:
ts.zoo=zoo(data2019.03$Rn,data2019.03$dat.times)

times <- time(zoo(ts.zoo))
ticks <- seq(times[1], times[length(times)], by = "days")

fmt <- "%d-%m" # format for axis labels
labs <- format(ticks, fmt)

plot(ts.zoo,ylab = "Rn (Bq/m3)",xlab="day",col="darkmagenta", main="March 2019",xaxt="n",type="b",pch=20)
axis(1, at = ticks,labels=labs, tcl = -0.3)
In [ ]: