Description Usage Format Details Examples
Results of running get_stats
for photo FLIR8565.jpg. The image file is
included in the package installation and can be located by:
system.file("extdata/FLIR8565.jpg", package = "ThermStats")
.
1 |
A list consisting of:
df = A dataframe with one row for each pixel, and variables denoting:
the pixel value (val); the original spatial location of the pixel (x and y);
its patch classification (G_bin) into a hot (1), cold (-1) or no patch (0)
according to the Z value (see spdep::
localG
);
the unique ID of the patch in which the pixel fell;
and the matrix ID (if applicable).
patches = A SpatialPolygonsDataFrame of hot and cold patches. Hot patches have a value of 1, and cold patches a value of -1.
pstats = A dataframe with patch statistics for hot patches and cold
patches, respectively. See patch_stats
for details of all the
statistics returned.
This data is primarily included to speed up build time of the package
vignette (see browseVignettes("ThermStats")
). If interested, you can
reproduce flir_stats
following the example below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | head(flir_stats$df)
flir_stats$pstats
plot_patches(df = flir_stats$df,
patches = flir_stats$patches,
save_plot = FALSE,
print_plot = TRUE)
# Recreate flir_stats ------------------------------------------------------
# Define raw data
raw_dat <- flir_raw$raw_dat$`8565`
# Define camera calibration constants dataframe
camera_params <- flir_raw$camera_params
# Define metadata
metadata <- flir_metadata
# Create vector denoting the position of photo within metadata
photo_index <- match(8565, metadata$photo_no)
# Convert
flir_converted <-
Thermimage::raw2temp(
raw = raw_dat,
# Emissivity = mean of range in Scheffers et al. 2017
E = mean(c(0.982,0.99)),
# Object distance = hypotenuse of right triangle where
# vertical side is 1.3 m (breast height) & angle down is 45°
OD = (sqrt(2))*1.3,
# Apparent reflected temperature & atmospheric temperature =
# atmospheric temperature measured in the field
RTemp = metadata$atm_temp[photo_index],
ATemp = metadata$atm_temp[photo_index],
# Relative humidity = relative humidity measured in the field
RH = metadata$rel_humidity[photo_index],
# Calibration constants from 'batch_extract'
PR1 = camera_params[,"PlanckR1"],
PB = camera_params[,"PlanckB"],
PF = camera_params[,"PlanckF"],
PO = camera_params[,"PlanckO"],
PR2 = camera_params[,"PlanckR2"])
# Get stats
flir_stats <-
get_stats(
# The temperature dataset
img = flir_converted,
# The ID of the dataset
id = "8565",
# Whether or not to calculate thermal connectivity
calc_connectivity = FALSE,
# Whether or not to identify hot and cold spots
patches = TRUE,
# The image projection (only relevant for geographic data)
img_proj = NULL,
# The image extent (only relevant for geographic data)
img_extent = NULL,
# The data to return
return_vals = c("df", # Temperature data as dataframe
"patches", # Patch outlines
"pstats"), # Patch statistics dataframe
# The summary statistics of interest
sum_stats = c("median", "SHDI", "perc_5", "perc_95"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.