R/GEDI_meta.R

Defines functions GEDI_meta

#' GEDI meta data Extractor
#'
#' This function allows you to extract meta data from the GEDI file name
#' @param fielnm filename of GEDI Json (output of GEDIsubsetter)
#' @keywords meta
#' @export
#' @examples
#' GEDI_meta()
#'
GEDI_meta <- function(filenm){ #datetime etc. from filename
  splt <- strsplit(filenm, "_")[[1]]
  orbit_datetime <- splt[3]
  year <- as.numeric(substring(orbit_datetime, 1,4))
  jul_dat <- as.numeric(substring(orbit_datetime, 5,7))
  meta <- month.day.year(jul = jul_dat, origin = c(1,1,year))
  level <- paste0(splt[1], "_", splt[2])
  meta$level <- level
  return(meta)
}
envima/GEDItools documentation built on July 25, 2020, 5:13 p.m.