Here's a jupyter notebook demonstrating how to read in and plot an "roistats" file (formerly known as an "all image" file) using R. In this case I'm using the all image file from the alligatorriver site. The all image files are in CSV format and can be read directly from the PhenoCam Network web site using a URL. To use this notebook you'll need to install the packages, ggplot2
and lubridate
from CRAN.
In [4]:
library(ggplot2)
library(lubridate)
baseurl = 'https://phenocam.sr.unh.edu/data/archive'
sitename = 'alligatorriver'
roiname1 = 'DB_1000'
csvfile = sprintf("%s_%s_roistats.csv",sitename,roiname1)
csvurl = sprintf("%s/%s/ROI/%s",baseurl,sitename,csvfile)
df = read.csv(url(csvurl),comment.char="#",header=TRUE)
df$date = as.Date(df$date)
df$year = year(df$date)
ystart = min(df$year)
yend = max(df$year)
head(df)
In [5]:
## combine date and local_std_time
df$datetime = with(df, as.POSIXct(paste(date,local_std_time), format="%Y-%m-%d %H:%M:%S"))
In [6]:
options(repr.plot.width = 8)
options(repr.plot.height = 2.5)
p = ggplot(df,aes(x=datetime,y=gcc)) + geom_point(size=0.01, shape=16, alpha=.7)
p
In [ ]: