This function will take a set of NWM files and concatenate them along the time access. If NCO is installed, this file will be pivoted and optimized for time series extraction. While this function will work without NCO it is highly recommended to install the NCO binaries (http://nco.sourceforge.net/#Source). If a file list is not provided, defining the type,ensemble, and number (num) of files to download, will query the most current NWM forecasts on NOMADS.
create_nwm_nc(
fileList = NULL,
variable = "streamflow",
dstfile = NULL,
type = NULL,
num = NULL,
ensemble = NULL,
nco = TRUE,
pivot = TRUE,
purge = TRUE,
quiet = FALSE
)
a vector of file paths to merge
the channel file variable to extract
the file path to write to
a NWM configuration
a number of files to download, default = all
an ensemble member number
should NCO be used? Default = TRUE
should the concatenated file be pivoted? Default = TRUE
should the fileList files be deleted? Default = FALSE
should messages be silenced? Default = FALSE
file path
if (FALSE) {
create_nwm_nc(type = "short_range", dstfile = tempfile(ext = ".nc"))
urls <- get_nomads_filelist(type = "medium_range", num = 4, ensemble = 4)
in_files <- download_nomads(urls, dir = tempdir())
create_nwm_nc(fileList = in_files, dstfile = tempfile(fileext = ".nc"))
}