Skip to content

Instantly share code, notes, and snippets.

@benfasoli
Created May 29, 2018 17:25
Show Gist options
  • Save benfasoli/b9bfd185e770f88844ba51fb25009f09 to your computer and use it in GitHub Desktop.
Save benfasoli/b9bfd185e770f88844ba51fb25009f09 to your computer and use it in GitHub Desktop.
Test STILT's met file identification function
# Ben Fasoli
# Testing for met file identification
rm(list = ls())
# Source find_met_files()
# https://github.com/uataq/stilt/blob/master/r/src/find_met_files.r
source('https://raw.githubusercontent.com/uataq/stilt/master/r/src/find_met_files.r')
# Create pseudo-met files
system('touch ex_d01.arl ex_d02.arl ex_d03.arl')
# Create arguments to find_met_files
t_start <- Sys.time()
met_file_format <- '*.arl'
n_hours <- -24
met_loc <- '.'
files <- find_met_files(t_start, met_file_format, n_hours, met_loc)
str(files)
# chr [1:3] "./ex_d01.arl" "./ex_d02.arl" "./ex_d03.arl"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment