Upload prepared SNAP data to Amazon Web Services S3 buckets.

aws_upload(in_dir, prefix, bkt = "leonawicz", pattern = NULL,
  region_group = NULL, mc.cores = 32)

Arguments

in_dir

character, input directory.

prefix

character, optional prefix.

bkt

S3 bucket name, defaults to the author since this is a SNAP developer package.

pattern

file name pattern passed to list.files for filtering files in in_dir.

region_group

region group used to further filter files in in_dir.

mc.cores

number of CPUs when processing years in parallel. Defaults to 32 assuming Atlas compute node context.

Details

This function uploads SNAP data to S3 buckets for use primarily by SNAP Shiny apps. The files uploaded includes any recursively listed under in_dir. The names will include only the base names. A prefix can be placed before the file base names. Using / in the prefix allows for the simulation of folders in the S3 bucket. Remember that S3 buckets technically have a flat structure.

NOTE: This function will not work unless the AWS keys granting permission to the bucket are loaded into the R session.

Examples

# NOT RUN {
source("aws_key.R") # SEE DETAILS
aws_upload(snapdef()$ar5dir_dist_monthly_split, "clim/dist/ar5_2km/monthly")
aws_upload(snapdef()$ar5dir_dist_seasonal, "clim/dist/ar5_2km/seasonal")
# }