R/contract_phenocam.r
contract_phenocam.Rd
Reverts the `expand_phenocam()` function in order to save space and generate files as outlined in the cited data paper. This routine is used as a post-production measure.
contract_phenocam(
data,
internal = TRUE,
no_padding = FALSE,
out_dir = tempdir()
)
a phenocam data file with a 1 or 3 day time step
return a data structure if given a file on disk
(TRUE
/ FALSE
= default)
allow for padding to REMAIN or not
(TRUE
/ FALSE
= default)
output directory where to store data (default = tempdir())
A contracted PhenoCam 3-day time series to its original 3-day time step (if provided at a 1-day interval), also removes padding introduced by processing for 1-day data.
if (FALSE) {
# download demo data
download_phenocam(site = "harvard$",
veg_type = "DB",
roi_id = "1000",
frequency = "3")
# Overwrites the original file, increasing
# it's file size.
expand_phenocam(file.path(tempdir(),"harvard_DB_1000_3day.csv"))
# Contracts the file to it's original size, skipping
# two days.
contract_phenocam(file.path(tempdir(),"harvard_DB_1000_3day.csv"))
}