Skip to contents

Estimate the underground water temperature as the mean of the air temperature in the 365 days before. This function use igraph::running_mean() to calculate running mean.

Usage

TNET_computeTnappe(path_data, path_export = NULL, shapefile)

Arguments

path_data

Path to the folder containing air temperature "Tair.nc" created by TNET_readSafran()

path_export

Path to the folder to export the file "Tg.nc". If NULL, path_export = path_data.

shapefile

Path to the shapefile with all info on segments. See TNETutils_getSAFRAN_fromShape() for all mandatory columns.

Value

All daily underground water temperature in a file Tg.nc in the folder path_data.

Details

Steps of the calculations are the following:

Step 1 - Calculate daily mean air temperature
Calculate the mean daily air temperature on SAFRAN grid

Step 2 - Calculate air temperature on river segments
Using TNETutils_getSAFRAN_fromShape() function, we get all info af SAFRAN grid on each river segments to calculate daily mean air temperature on each segments.

Step 3 - Calculate for each time t, mean temperature of the t-365 days
The ground temperature (\(T_g(t)\)) at a given time t is calculated as the average of the air temperatures (\(T_{\text{air}}(t - i)\)) over the previous 365 days:

$$T_g(t) = \frac{1}{365} \sum_{i=1}^{365} T_{\text{air}}(t - i)$$

where:

  • \(T_g(t)\) : Ground temperature at time t.

  • \(T_{\text{air}}(t - i)\) : Air temperature i days before time t.

Examples


TNET_computeTnappe(path_data = path/to/data,
                   path_export = path/to/export/folder,
                   shapefile = path/to/shapefile.shp)
#> Error: object 'to' not found
              
              
############################################################
## Using this function with TNET_initializeSim() function ##
############################################################
infoSimu <- TNET_initializeSim(...)
#> Error: '...' used in an incorrect context

TNET_readSafran(...)
#> Error in TNET_readSafran(...): could not find function "TNET_readSafran"

TNET_computeTnappe(path_data = infoSimu$safranPath,
                   path_export = infoSimu$hydroPath,
                   shapefile = infoSimu$TOPAGE_shape)
#> Error: object 'infoSimu' not found