Reading meteorological data from SAFRAN NetCDF files
Source:R/TnetSAFRAN.R
tnet_safran_readfiles.RdThis function will read all necessary hourly meteological data from SAFRAN netCDF files in a directory.
The variables readed from the SAFRAN netCDF files are the following:
Tair : Air temperature, transformed from °K to °C
Qair : Air humidity
Wind : Wind velocity
LWdown : Long wave radiation
SWdown : Shortwave radiation (direct + indirect)
Files must be coming from the INRAE pnas server (internal) or from the AERIS catalog (open source).
AERIS Safran data can be downloaded using tnet_safran_download().
Arguments
- folder_data
Path to the folder containing all NetCDF SAFRAN files
- folder_export
Path to the folder where export files will be written
- shapefile
Shapefile where all SAFRAN grid IDs are writen for T-NET. Can be .shp of .gpkg file.
- date_start
character (see
TooffR::text_toDate()) or POSICxt or numeric. Starting date (or starting year) to read the file.- date_end
character (see
TooffR::text_toDate()) or POSICxt or numeric. Ending date (or ending year) to read the file.- source
Source of the safran NETCDF. Can be "aeris" or "INRAEpnas".
Value
NetCDF files containing all needed meteorological data for T-NET, one file is created for each exported variables
Examples
## Run directly the function providing all info
tnet_safran_readfiles(folder_data = "path/to/SAFRANfolder",
folder_export = "path/to/ExportFolder",
shapefile = "path/to/shapefile.shp",
start = "2002-08-01 00:00:00",
end = "2017-07-31 23:00:00",
source = "aeris")
#> Error in tnet_safran_readfiles(folder_data = "path/to/SAFRANfolder", folder_export = "path/to/ExportFolder", shapefile = "path/to/shapefile.shp", start = "2002-08-01 00:00:00", end = "2017-07-31 23:00:00", source = "aeris"): unused arguments (start = "2002-08-01 00:00:00", end = "2017-07-31 23:00:00")