met2CF.csv

met2CF.csv(in.path, in.prefix, outfolder, start_date, end_date, format,
  lat = NULL, lon = NULL, nc_verbose = FALSE, overwrite = FALSE,
  ...)

Arguments

format

data frame or list with elements as described below format is output from db/R/query.format.vars, and should have: REQUIRED: format$lat = latitude of site (unless passed by lat) format$lon = longitude of site (unless passed by lon) format$header = number of lines of header format$vars is a data.frame with lists of information for each variable to read, at least airT is required format$vars$input_name = Name in CSV file format$vars$input_units = Units in CSV file format$vars$bety_name = Name in BETY - see https://pecan.gitbooks.io/pecan-documentation/content/developers_guide/Adding-an-Input-Converter.html for allowable ones OPTIONAL: format$na.strings = list of missing values to convert to NA, such as -9999 format$skip = lines to skip excluding header format$vars$column_number = Column number in CSV file (optional, will use header name first) Columns with NA for bety variable name are dropped. Units for datetime field are the lubridate function that will be used to parse the date (e.g. ymd_hms or mdy_hm).

nc_verbose

logical: run ncvar_add in verbose mode?

Examples

# NOT RUN {
bety <- list(user='bety', password='bety', host='localhost',
  dbname='bety', driver='PostgreSQL',write=TRUE)
con <- PEcAn.DB::db.open(bety)
bety$con <- con
start_date <- lubridate::ymd_hm('200401010000')
end_date <- lubridate::ymd_hm('200412312330')
file<-PEcAn.data.atmosphere::download.Fluxnet2015('US-WCr','~/',start_date,end_date)
in.path <- '~/'
in.prefix <- file$dbfile.name
outfolder <- '~/'
format.id <- 5000000001
format <- PEcAn.DB::query.format.vars(format.id=format.id,bety = bety)
format$lon <- -92.0
format$lat <- 45.0
format$time_zone <- "America/Chicago"
results <- PEcAn.data.atmosphere::met2CF.csv(
  in.path, in.prefix, outfolder,
  start_date, end_date, format,
  overwrite=TRUE)
# }