Skip to contents

Read all columns of ReachLoop.dat or HRULoop.dat created by J2000 and save them in a NetCDF file (with TNET format)

Usage

TnetJ2K_readfiles(path_J2Kfile, path_Export = NULL, date_start = NULL, date_end = NULL, on_reach = FALSE, path_J2Kpar = NULL)

Arguments

path_J2Kfile

character Path to the folder containing the ReachLoop and HRULoop files

path_Export

character Path to export the NetCDF result file. If NULL, data will be saved in the same folder as path_J2Kfile

date_start

character (see TooffR::text_toDate()) or POSICxt. Starting date to read the file.

date_end

character (see TooffR::text_toDate()) or POSICxt. Ending date to read the file.

on_reach

logical. If TRUE, all results will be aggregated on reaches. if FALSE, the results will be the same as the origins

path_J2Kpar

character IGNORED IF on_reach=FALSE. Path to the hru.par file. if NULL, hru.par file will be read in path_J2Kfile folder.

Value

a NetCDF file

Examples

TnetJ2K_readfiles(path_J2Kfile = path/to/ReachLoop.dat)
#> Error: object 'to' not found

############################################################
## Using this function with TNET_initializeSim() function ##
############################################################
infoSimu <- TNET_initializeSim(...)
#> Error: '...' used in an incorrect context

#To read ReachLoop.dat file
TnetJ2K_readfiles(path_J2Kfile = file.path(infoSimu$path_J2KOutput,'ReachLoop.dat'),
             path_Export= infoSimu$path_Export_tmp,
             date_start = infoSimu$startSimu,
             date_end = infoSimu$endSimu)
#> Error: object 'infoSimu' not found
                   
#To read HRULoop file
TnetJ2K_readfiles(path_J2Kfile = file.path(infoSimu$path_J2KOutput,'HRULoop.dat'),
             path_Export= infoSimu$path_Export_tmp,
             date_start = infoSimu$startSimu,
             date_end = infoSimu$endSimu,
             on_reach = TRUE,
             path_J2Kpar = infoSimu$path_J2Kparameter)
#> Error: object 'infoSimu' not found