GEDI_AGB_prep.Rd
Prepare L4A GEDI above ground biomass (AGB) data for the state data assimilation (SDA) workflow.
GEDI_AGB_prep(
site_info,
time_points,
outdir = file.path(getwd(), "GEDI_AGB"),
buffer = 0.005,
search_window = "6 month",
bbox = NULL,
batch = FALSE,
prerun = NULL,
num.folder = NULL,
cores = parallel::detectCores(),
credential.folder = "~"
)
List: A list including site_id, longitude, and latitude.
Character: A vector of date contains target dates (in YYYY-MM-DD).
Character: Directory where the final CSV file will be stored.
Numeric: buffer distance (in degrees) for locate GEDI AGB searching box (default is 0.005 [~ 500 m]).
Character: search window (any length of time. e.g., 6 month) for locate available GEDI AGB values.
Numeric: the vector (in xmin, xmax, ymin, and ymax) that covers all the sites in the site_info object (default is NULL).
Boolean: determine if we want to submit jobs to the queue or not (default is FALSE).
Character: series of pre-launch shell command before running the shell job (default is NULL).
Numeric: the number of batch folders to be created when submitting jobs to the queue.
Numeric: numbers of core to be used for the parallel computation. The default is the maximum current CPU number.
Character: the physical path to the folder that contains the credential file (.nasadaacapirc).
A data frame containing AGB and sd for each site and each time step.
During the first use, users will need to create the `.nasadaacapirc` file in the out folder where the first and second lines are the username and password on the NASA Earth Explore server. If you don't have an account, register at https://urs.earthdata.nasa.gov/users/new.
if (FALSE) { # \dontrun{
settings <- PEcAn.settings::read.settings("pecan.xml")
site_info <- settings %>%
purrr::map(~.x[['run']] ) %>%
purrr::map('site')%>%
purrr::map(function(site.list){
#conversion from string to number
site.list$lat <- as.numeric(site.list$lat)
site.list$lon <- as.numeric(site.list$lon)
list(site_id=site.list$id, lat=site.list$lat, lon=site.list$lon, site_name=site.list$name)
}) %>%
dplyr::bind_rows() %>%
as.list()
time_points <- seq(start.date, end.date, by = time.step)
buffer <- 0.005
outdir <- getwd()
GEDI_AGB <- GEDI_AGB_prep(site_info, time_points, outdir, buffer)
} # }