Using API might need login.
# Dependencies from supplemental_code/3_Figures/PS3_figures.Rmd
install.packages("phenocamr")
devtools::install_github('bnasr/phenocamapi')
From pheno-synthesis-software-suite/supplemental_code/3_Figures/PS3_figures.Rmd
library(phenocamapi) #pull phenocam metadata
library(phenocamr) #pull pre-processed phenocam data
library(dplyr)
Pulling a list of PhenoCam sites:
phenos=get_phenos()
colnames(phenos)
rois=get_rois()
Filter for sites used in this paper and remove non-vegetated ROIs:
site_names=c('ibp', 'jernort', 'NEON.D14.JORN.DP1.00042')
jer=phenos%>%
filter(is.element(phenos$site,site_names))
jer_full_list= rois%>%
filter(is.element(rois$site,site_names))%>%
filter(!roitype=='NV')%>% #remove 'No Vegetation' NV ROIs
filter(!sequence_number==1001) #remove defunct ROI
Use the phenocamr
package to download timeseries data:
data_dir='/home/stefanv/git/springtime/ps3/ps3-phenocam-tryout'
n=nrow(jer_full_list)
for(i in seq(1, n, by = 1)){
phenocamr::download_phenocam(
frequency = 3,
veg_type = jer_full_list$primary_veg_type[i],
roi_id = 1000,
site = jer_full_list$site[i],
phenophase = FALSE,
out_dir = data_dir
)
}