113 incorrect units in pdi calculation and figures#114
113 incorrect units in pdi calculation and figures#114thomasarsouze wants to merge 5 commits intomainfrom
Conversation
|
For PDI calculation, indeed, it looks like PDI values were too high (in our paper with average annual values computed by Christophe we obtained PDI values up to 1000: https://besjournals.onlinelibrary.wiley.com/doi/10.1111/1365-2745.13039?utm_medium=article&utm_source=researchgate.net). Yes it should be J.m-2 and not J.m For the duration of exposure, I don't know which wind speed was used in the example provided but yes it looks like 250 hours (>10 days) is overly too long. I checked in the code (below) and yes it is min (tempRes = 15, 30, or 60 min). So we need to change the unit and also specify in the documentation that the output is in min. computeExposure <- function(wind, tempRes, threshold) { return(exposure) |
# Surface sea-level air density in kg.m-3
rho <- 1
# Surface drag coefficient
cd <- 0.002
# Raising to power 3
pdi <- wind**3
# Applying both rho and surface drag coefficient
pdi <- pdi * rho * cd
# Integrating over the whole track and converting minutes to seconds
pdi <- sum(pdi, na.rm = TRUE) * tempRes * 60
|
|
@thomaspibanez : can you confirm the points mentioned above so that we can merge the fix ? |
|
@thomasarsouze : I've discussed with C. Menkes, we would prefer exposure time in hours, so we have to divide by 60 in the calculation Regarding the PDI Christophe is ok with the formula currently implemented in StromR and tempRes is in min so we have to multiply by 60 to have it in seconds. That said I agree that there is an issue with PDI. If we take the example we show in the article for spatialBehaviour for PAM in Vanuatu we have exposure time of about 200 min for wind if 58 m.s if we apply the formula we have 20060(58**3)*0.002 = 4, 682, 688 which is much higher than the 250.000 (and this a conservative estimate) |
|
I was looking at the code to find the issue with the PDI. I saw that some part of the code are duplicated is it normal? #' Compute PDI raster Integrating over the whole trackprod <- sum(stack, na.rm = TRUE) * tempRes Applying focal function to smooth resultsprod <- terra::focal(prod, w = matrix(1, nbg, nbg), mean, na.rm = TRUE, pad = TRUE) return(c(finalStack, prod)) #' Compute PDI raster for (l in seq_along(threshold)) { return(finalStack) |
@thomaspibanez : can you double-check that :