calc_thermocline | R Documentation |
This function calculates thermocline strength from FVCOM temperature predictions.
calc_thermocline(l)
l |
A list composed of a single environmental array (comprising temperature predictions for hours x layers x nodes) for a particular day. |
Thermocline strength is approximated as the difference in temperature between the shallowest and the deepest Sigma layers. This is computationally faster than calculating other metrics (e.g. the standard deviation in temperature across layers). Positive numbers indicate the temperature at the surface is higher than at the bottom. This function cannot be applied properly to the data supplied with this package, which is a small subset of the temperature predictions including only the top two layers.
The function returns a 2-dimensional array of the thermocline strength for each hour and each node in the original array.
Edward Lavender
This function can be implemented within compute_field_from_fvcom
.
#### Step 1: Read example temperature file into a list path <- system.file("WeStCOMS_files/temp", package = "fvcom.tbx", mustWork = TRUE) file <- list.files(path, full.names = TRUE)[1] l <- list(R.matlab::readMat(file)$data) str(l) #### Step 2: Compute thermocline strength # (Note this is only for demonstration purposes: # ... example package temperature predictions only include layers 1 and 2!) thermocline_strength <- calc_thermocline(l) hist(thermocline_strength)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.