batch_convert: batch_convert

Description Usage Arguments Details Value Examples

View source: R/batch_convert.R

Description

Batch convert list of raw FLIR matrices to a list of temperature matrices (°C).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
batch_convert(
  raw_dat,
  E = 1,
  OD = 1,
  RTemp = 20,
  ATemp = RTemp,
  IRWTemp = RTemp,
  IRT = 1,
  RH = 50,
  PR1 = 21106.77,
  PB = 1501,
  PF = 1,
  PO = -7340,
  PR2 = 0.012545258,
  write_results = TRUE,
  out_dir = NULL,
  file_name = NULL
)

Arguments

raw_dat

A list of raw FLIR matrices returned from batch_extract.

E

Emissivity. Defaults to 1. See Thermimage::raw2temp.

OD

Object distance (metres). See Thermimage::raw2temp.

RTemp

Apparent reflected temperature (°C). Defaults to 20. See Thermimage::raw2temp.

ATemp

Atmospheric temperature (°C). Defaults to reflected temperature. See Thermimage::raw2temp.

IRWTemp

Infrared Window Temperature (°C). Defaults to reflected temp. See Thermimage::raw2temp.

IRT

Infrared Window transmission. Defaults to 1.0. See Thermimage::raw2temp.

RH

Relative humidity (%). Defaults to 50. See Thermimage::raw2temp.

PR1

PlanckR1. A calibration constant for FLIR cameras. See Thermimage::raw2temp.

PB

PlanckB. A calibration constant for FLIR cameras. See Thermimage::raw2temp.

PF

PlanckF. A calibration constant for FLIR cameras. See Thermimage::raw2temp.

PO

PlanckO. A calibration constant for FLIR cameras. See Thermimage::raw2temp.

PR2

PlanckR2. A calibration constant for FLIR cameras. See Thermimage::raw2temp.

write_results

Should results be written to file? Defaults to TRUE.

out_dir

Path to directory where converted temperature data will be written. Defaults to NULL, writing to current directory.

file_name

File name (without extension). Defaults to NULL, with the name 'flir_converted_' plus the current date. File format is .Rds

Details

Batch implementation of Thermimage::raw2temp.

Value

A list with one element per input thermal image. Each element is a numeric matrix of the converted temperature data, in °C.

Examples

 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
# Setup ----------------------------------------------------------

# Load raw data
raw_dat <- flir_raw$raw_dat
camera_params <- flir_raw$camera_params
metadata <- flir_metadata

# Create vector denoting the position of each element of raw_dat 
# (each photo) within the metadata dataframe
photo_index <- match(names(raw_dat), metadata$photo_no)

# Define environmental parameters --------------------------------

# Emissivity is mean of range given in Scheffers et al. 2017
# (onlinelibrary.wiley.com/doi/10.1111/btp.12355/full)
E <- mean(c(0.982,0.99))

# Object distance is calculated as the hypotenuse of a right 
# triangle where the vertical side is 1.3 m (breast height) and 
# the angle down is 45 degrees
OD <- (sqrt(2))*1.3

# Apparent reflected temperature, atmospheric temperature and 
# infrared window temperature set as the atmospheric temperature 
# easured in the field.
RTemp <- metadata$atm_temp[photo_index]
ATemp <- metadata$atm_temp[photo_index]
IRWTemp <- metadata$atm_temp[photo_index]

# Infrared Window transmission is kept at default.
IRT <- 1

# Relative humidity is set as the relative humidity measured 
# in the field.
RH <- metadata$rel_humidity[photo_index]

# Define camera parameters ---------------------------------------

# These parameters are calibration constants, and therefore 
# constant for each camera
PR1 <- camera_params[,"PlanckR1"]
PB <- camera_params[,"PlanckB"]
PF <- camera_params[,"PlanckF"]
PO <- camera_params[,"PlanckO"]
PR2 <- camera_params[,"PlanckR2"]

# Batch convert! -------------------------------------------------
results <-
    batch_convert(raw_dat,
                  E, OD, RTemp, ATemp, IRWTemp, IRT, RH,
                  PR1, PB, PF, PO, PR2,
                  write_results = FALSE)

rasenior/PatchStatsFLIR documentation built on Oct. 28, 2020, 11:53 p.m.