12  Twilight label

Tip

Delete this block when you have read!

If you don’t have light data, delete this file!

  • These scripts should be adapted based on your project, but the same script should run for all your tags. You can always check the original version online.
  • Make sure you’ve read the GeoPressureManual, in particular the twilight labeling instructions, before running this script
  • Nothing is saved at the end of the script and it is meant to be like that. Only twilight label file and config.yml should be edited. Use geopressure.R for the final run.
id <- "18LX"

knitr::opts_knit$set(root.dir = here::here())
library(GeoPressureR)
library(ggplot2)

12.1 Create tag

Make sure you have already created the label file with the “1-label.qmd” script.

tag <- tag_create(
  id,
  crop_start = config::get("tag_create", id)$crop_start,
  crop_end = config::get("tag_create", id)$crop_end,
  quiet = TRUE
) |>
  tag_label(quiet = TRUE) |>
  tag_set_map(
    extent = config::get("tag_set_map", id)$extent,
    scale = config::get("tag_set_map", id)$scale,
    known = config::get("tag_set_map", id)$known
  )

12.2 Create Twilight

Generate the twilight automatically. Check that twl_offset allows for night/day being centered on the figure, otherwise edit accordingly

tag <- twilight_create(
  tag,
  twl_offset = config::get("twilight_create", id)$twl_offset
)
plot(tag, type = "twilight")

12.3 Annotate twilight in GeoLightViz

12.4 Compute likelihood map

tag <- geolight_map(
  tag,
  twl_calib_adjust = config::get("geolight_map", id)$twl_calib_adjust,
  twl_llp = config::get("geolight_map", id)$twl_llp,
  fitted_location_duration = config::get(
    "geolight_map",
    id
  )$fitted_location_duration
)
ℹ Calibrate zenith angle
✔ Calibrate zenith angle [20ms]
ℹ Compute twilight likelihood maps
✔ Compute twilight likelihood maps [4.1s]
ℹ Aggregate twilight likelihood maps per stationary periods
✔ Aggregate twilight likelihood maps per stationary periods [5ms]

twl_calib_adjust, fitted_location_duration and twl_llp can generally be left to default, but can be modified in config.yml if needed.

12.5 Check

12.5.1 Check calibration

12.5.2 Check light map

plot(tag, type = "map_light")

12.5.3 Check with pressure and trajectory