# Predicting_Photogrammetric_Uncertainty ### A Bayesian approach for predicting photogrammetric uncertainty in morphometric measurements derived from UAS **Materials** *Data*: - "APE-Dataset.csv" - training/calibration data for different UAS platforms. - Images = image used for measuring calibration object - Aircraft = the UAS aircraft used to collect imagery of calibration object to measure - Flight = the flight number/name - Position = indicates if calibration object is in center of corner of image frame - Focal.length = focal length of camera - Pix.Dim = pixel dimensions (mm/px), which is the sensor width (mm) / image width (px) of the camera - Baro_raw = the raw relative altitude recorded by the barometer - Launch.Ht = the launch height of the drone, to be added to the BarAlt to get the absolute barometric altitude above the surface of the water - Baro + Ht = the baro_raw + Launch.Ht to get the absolute barometer altitude - Laser_Alt = the altitude recorded by the laser altimeter. Blanks spaces/NAs indicate no/false reading - Alitude = altitude used in measurement, either Laser_Alt or Baro + Ht - Alimeter = which altimeter was used for altitude in measurement; either barometer or laser - Measurer = which analyst measured the calibration object (3 analysts total, measured each image once) - RRR.pix = the length in pixels of the known sized object (calibration object) - "humpback_data.csv" - testing data. Humpback lengths from the Western Antarctic Peninsula. - Animal_ID = unique ID for individual whale - Reproductive_Class = determined from biopsy sample or from drone images (mom and calf pairs) - Species = the species of whale - Image = the image ID used for measuring the whale - Aircraft = which UAS platform collected the imagery - Focal_Length = focal length (mm) of the camera used - LaserAlt = the altitude recorded by the laser altimeter. Blanks spaces/NAs indicate no/false reading - BaroAlt = the raw relative altitude recorded by the barometer - Pixel_Dimension = (mm/px) the Sensor width (mm) / Image width (px) of the camera - Launch_Ht = the launch height of the drone, to be added to the BarAlt to get the absolute barometric altitude above the surface of the water - Altitude = altitude used in measurement, either LaserAlt or BaroAlt + Launch_Ht - Altimeter = which altimeter was used for altitude in measurement; either barometer or laser - 'TL' = total length of the whale in meters *Uncertainty Models*: - Model 1: barometer only - "Model_1-baro.Rmd" - uses altitude from barometer and laser in training data, but only barometer in testing data. - Generates a diagnostic reports of posterior predictions - Saves outputs as rdata and csv files to be used with the saved outputs from Model 2 to compare uncertainty results from both models using "Uncertainty_Plots.Rmd". - Model 2: barometer and laser - "Model_2-baro&lsr.Rmd" - uses altitude from both barometer and laser in training and testing data. - Generates a diagnostic reports of posterior predictions - Saves outputs as rdata and csv files to be used with the saved outputs from Model 1 to compare uncertainty results from both models using "Uncertainty_Plots.Rmd". Both models located in the 'reports' folder. *Plots*: - "Uncertainty_Plots.Rmd" - Create figures in manuscript/supplementary material for comparing the outputs from Model 1 & 2. - First run 'Model_1-baro.Rmd' and 'Model_2-baro&lsr.Rmd'. The saved outputs from both of these Models are used as the inputs to compare results and create figures. - Figures saved to the "uncertainty_figures" folder in the "output_figures" folder. - "uncorrected_error_plots.Rmd" - Creates figures in manuscript/supplementary material of unocorrected error (measurement error before running uncertainty model) and length estimates from the training/calibration datal. Includes the uncorrected measurement error for each UAS. Both .Rmd files located in the 'reports' folder. **Steps**: 1. Run 'Model_1-baro.Rmd' - Can knit document to run model and automatically generate posterior diagnostic report. - Model outputs are automatically saved as rdata and csv files in the "model_outputs" folder. - These outputs will be used later along with the saved outputs from 'Model_2-baro&lsr.Rmd' to create figures using 'Uncertainty_Plots.Rmd'. 2. Run 'Model_2-baro&lsr.Rmd' - Can knit document to run model and automatically generate posterior diagnostic report. - Model outputs are automatically saved as rdata and csv files in the "model_outputs" folder. - These outputs will be used next along with the saved outputs from 'Model_1-baro.Rmd' to create figures using 'Uncertainty_Plots.Rmd'. 3. Run 'Uncertainty_Plots.Rmd' - Uses the saved outputs from Models 1 & 2 to create figures in the manuscript/supplementary material comparing the outputs from Models 1 and 2. - Figures automatically saved to the "uncertatinty_figures" folder in the "output_figures" folder. 4. Run 'uncorrected_error_plots.Rmd' - Creates figures in the manuscript/supplementary material of the uncorrected error (before running uncertainty model) from the training/calibration data. Contact KC Bierlich kcb43@duke.edu for more details.