flatten_data {Xcertainty}R Documentation

Reformat photogrammetric data for model-based analysis

Description

For internal use only. Not intended to be called directly by users.

Usage

flatten_data(
  data = NULL,
  priors,
  pixel_counts = data$pixel_counts,
  training_objects = data$training_objects,
  image_info = data$image_info,
  prediction_objects = data$prediction_objects
)

Arguments

data

A list object, or similar that includes components that describe observations to analyze. Components are automatically extracted into this function's other arguments. See the remaining documentation for details about required components.

priors

list with elements altitude, lengths, bias, and sigma that parameterize the prior distributions for the Bayesian model. The bias components may specify separate priors for each UAS/altimeter type combination, or for all barometers at once based on the information provided for joining.

pixel_counts

data.frame with columns Subject, Measurement, Image, and PixelCount that describe the length measurements taken from images

training_objects

data.frame with columns Subject, Measurement, and Length that describe the known lengths of the objects used to calibrate the photogrammetric model

image_info

data.frame with columns Image, Barometer, Laser, FocalLength, ImageWidth, and SensorWidth that describe the images used in the photogrammetric study

prediction_objects

data.frame with elements Subject, Measurement, and Timepoint that describe the unknown lengths of objects that should be estimated

Details

Assemble data.frame objects into a format that can be analyzed using numerical methods. This function is analagous to stats::model.matrix, which generates design matrices for models that are specified via formulas.

Examples

# load example wide-format data
data("calibration")
data("whales")

# parse calibration study
calibration_data = parse_observations(
  x = calibration, 
  subject_col = 'CO.ID',
  meas_col = 'Lpix', 
  tlen_col = 'CO.L', 
  image_col = 'image', 
  barometer_col = 'Baro_Alt',
  laser_col = 'Laser_Alt', 
  flen_col = 'Focal_Length', 
  iwidth_col = 'Iw', 
  swidth_col = 'Sw',
  uas_col = 'uas'
)

# parse field study
whale_data = parse_observations(
  x = whales, 
  subject_col = 'whale_ID',
  meas_col = 'TL.pix', 
  image_col = 'Image', 
  barometer_col = 'AltitudeBarometer',
  laser_col = 'AltitudeLaser', 
  flen_col = 'FocalLength', 
  iwidth_col = 'ImageWidth', 
  swidth_col = 'SensorWidth', 
  uas_col = 'UAS',
  timepoint_col = 'year'
)

# combine parsed calibration and observation (whale) data
combined_data = combine_observations(calibration_data, whale_data)

[Package Xcertainty version 1.0.1 Index]