Gamma radiation monitoring at the Azores ENA-ARM station (Graciosa Island)

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

library(dplyr)
library(zoo)
library(lubridate)
library(RCurl)
library(plotly)

Data pre-processing

In [60]:
myfile <- getURL('https://rdm.inesctec.pt/dataset/208cde7b-4d9e-45d4-9af6-2cb3028ae437/resource/b210365c-a4c5-4cf4-a466-6d2226b7b84f/download/datagrmena.txt',
                 ssl.verifyhost=FALSE, ssl.verifypeer=FALSE)

dat=read.table(textConnection(myfile),header=FALSE,sep=" ",stringsAsFactors=FALSE)
In [61]:
# 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))

# check for continuity of record
ngaps=length(which(c(1,round(diff(unclass(dat.times)/900)))!=1))
gaps=which(c(1,round(diff(unclass(dat.times)/900)))!=1)

print(paste("number of gaps in data:", ngaps))
[1] "data from 2015-05-07 11:30:00 to 2018-03-31 23:45:00"
[1] "number of gaps in data: 3"
In [62]:
#fill-in gaps by adding missing times as NA values 

all.times <- seq.POSIXt(from=start.time, to=end.time, by=900)
df <- data.frame(dat.times=all.times,stringsAsFactors=FALSE)
data.all.times <- full_join(df,data.frame(dat.times=dat.times, gamma=dat$V3))

gamma.zoo=zoo(data.all.times$gamma,data.all.times$dat.times)
Joining, by = "dat.times"

Data visualisation

In [67]:
xlab <- list(title = "")
ylab <- list(title = "gamma counts (cpm)")
p<-plot_ly(x = data.all.times$dat.times,y = data.all.times$gamma,type="scatter",mode="lines")  %>%
layout(xaxis = xlab, yaxis = ylab)
In [68]:
embed_notebook(p)