From dd18270b14734420e41b9f7eda2eccd97d8977a4 Mon Sep 17 00:00:00 2001 From: Louis-Philippe Caron Date: Fri, 5 Oct 2018 18:25:48 +0200 Subject: [PATCH] Update diurnaltemp.md --- vignettes/dtr/diurnaltemp.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/vignettes/dtr/diurnaltemp.md b/vignettes/dtr/diurnaltemp.md index 050ebaa..325163b 100644 --- a/vignettes/dtr/diurnaltemp.md +++ b/vignettes/dtr/diurnaltemp.md @@ -6,7 +6,7 @@ output: Diurnal Temperature Variation (DTR) Indicator ============================================= -The diurnal temperature variation indicator is a proxy for energy demand. The diurnal temperature indicator is the number of days in a season where the daily temperature variation (tasmax - tasmin) exceeds the vulnerability threshold. Here, the vulnerability threshold is based on the mean daily temperature variation for a reference period plus 5 degrees. +The diurnal temperature variation indicator is a proxy for energy demand. The diurnal temperature indicator is the number of days in a season when the daily temperature variation (tasmax - tasmin) exceeds the vulnerability threshold. Here, the vulnerability threshold is based on the mean daily temperature variation for a reference period plus 5 degrees. ### 1- Load dependencies @@ -19,7 +19,7 @@ This example requires the following system libraries: - cdo -The **ClimProjDiags R package** should be loaded by running the following lines in R, once it's integrated into CRAN mirror. +The **ClimProjDiags R package** should be loaded by running the following lines in R, once it is integrated into CRAN mirror. ```r library(ClimProjDiags) @@ -45,7 +45,7 @@ lat <- seq(25, 60, 5) lon <- seq(-35, 20 ,5) ``` -The synthetic sample of maximum and minimum temperature for the historical periode can be obtained by running the following lines.The maximum temperature data is built by adding random perturbation to a sinusoidal function. The latitudinal behavior of the temperature is considered by subtracting randomly a value proportional to the latitud. The minimum temperature is built by subtracting a random value (with anual cycle included) to the synthetic maximum temperature. Furthermore, attributes of time and dimensions are added to both samples. +The synthetic sample of maximum and minimum temperature for the historical period can be obtained by running the following lines. The maximum temperature data is built by adding random perturbation to a sinusoidal function. The latitudinal behavior of the temperature is computed by randomly subtracting a value proportional to the latitude. The minimum temperature is built by subtracting a random value (with anual cycle included) to the synthetic maximum temperature. Furthermore, attributes of time and dimensions are added to both samples. ``` tmax_historical <- NULL @@ -91,7 +91,7 @@ attr(tmin_historical, 'Variables')$dat1$time <- time ``` -A similar procedure is considered to build the synthetic data for the future projections. However, a trend is added. +A similar procedure is done to build the synthetic data for the future projections. However, a trend is added. ``` tmax_projection <- NULL @@ -160,7 +160,7 @@ List of 2 ### 4- Computing the diurnal temperature variation indicator -The diurnal temperature variation indicator is computed with the function `DTRIndicator` indicating the maximum and minimum temperature for the future projectionn and the reference temperature variation: +The diurnal temperature variation indicator is computed with the function `DTRIndicator` indicating the maximum and minimum temperature for the future projection and the reference temperature variation: ```r dtr_indicator <- DTRIndicator(tmax = tmax_projection, tmin = tmin_projection, @@ -168,7 +168,7 @@ dtr_indicator <- DTRIndicator(tmax = tmax_projection, tmin = tmin_projection, by.seasons = TRUE, ncores = NULL) ``` -The function returns a list of three elements, being the label `indicator` the desired output: +The function returns a list of three elements, the label `indicator` being the desired output: ```r > str(dtr_indicator) @@ -177,13 +177,13 @@ List of 3 $ year : chr [1:96] "2006" "2007" "2008" "2009" ... $ season : chr [1:4] "DJF" "JJA" "MAM" "SON" ``` -*Note: the total number of years in `dtr_indicator$year` (96) is greater than the period examined (in this case 95 years of future projection). It's due to the last december of the time series, which belongs to the next winter (in this example 2101 winter).* +*Note: the total number of years in `dtr_indicator$year` (96) is greater than the period examined (in this case 95 years of future projection). This is because the last december of the time series belongs to the subsequent winter (in this example 2101 winter).* ### 5- Visualizing the diurnal temperature variation indicator -A four panel plot can be generated to visualize the seasonal indicator running the following lines: +A four panel plot can be generated to visualize the seasonal indicator by running the following lines: ```r @@ -207,7 +207,7 @@ PlotLayout(PlotEquiMap, c(1, 2), lon = lon, lat = lat, var = dtr_rcp, ![Diuranl Temperature Range Indicator](SpatialDTR.png) -Furthermore, the future diurnal temperature variation can be compared with the observed during the reference period. So, the diurnal temperature variation indicator is computed for the reference period by running the next lines: +Furthermore, the future diurnal temperature variation can be compared with the one observed during the reference period. So, the diurnal temperature variation indicator is computed for the reference period by running: ```r dtr_indicator_reference <- DTRIndicator(tmax = tmax_historical, @@ -216,7 +216,7 @@ dtr_indicator_reference <- DTRIndicator(tmax = tmax_historical, ncores = NULL) ``` -By ordinary subtraction, the comparison between the reference and the future projection diurnal temperature variation indicator can be computed. To visualize the result, `PlotLayout` function will be applied again. The resulting plot, will be saved in the working directory. +The comparison between the reference and the future projection diurnal temperature variation indicator can be computed With a simple subtraction. To visualize the result, `PlotLayout` function will be applied again. The resulting plot will be saved in the working directory. ```r dtr_diff <- array(dim=c(length(lat), length(lon), 4)) -- GitLab