Learn R Programming

rGEDI (version 0.6.0)

plot_gedi_orbit_animation: Animate a GEDI ground track around the Earth

Description

Creates an interactive 3D HTML animation or an animated GIF from GEDI footprint coordinates. The presentation follows the ICESat2VegR orbit animation, with a rotating Earth, a NASA ISS illustration carrying GEDI, and a red near-infrared laser and ground track. ISS motion follows the time-ordered geolocation of the most complete beam extracted from the supplied HDF5 object.

Usage

plot_gedi_orbit_animation(
  x,
  lon = NULL,
  lat = NULL,
  time = NULL,
  track = NULL,
  output_file = tempfile("rGEDI-orbit-", fileext = ".html"),
  title = "GEDI orbit animation",
  duration = 18,
  launch = interactive(),
  track_speed = 2,
  earth_rotation_speed = 2,
  beams = NULL,
  every = 1L
)

Value

The normalized path to the HTML file, invisibly.

Arguments

x

A data frame, data.table, sf or SpatVector containing GEDI footprint coordinates; an open gedi.level1b, gedi.level2a, gedi.level2b, or gedi.level4a object; or a list of these objects from consecutive production granules in one orbit.

lon, lat

Names of longitude and latitude columns. When NULL, common GEDI coordinate names are detected automatically.

time

Optional name of a column used to order footprints within each track. GEDI delta_time and shot_number columns are detected by default.

track

Optional name of a beam or track column. Separate tracks are colored independently.

output_file

Path of the .html or .gif file to create. GIF output requires the suggested gifski package.

title

Title shown above the animation.

duration

Duration of one animation cycle in seconds.

launch

Open the animation in the default browser after it is written.

track_speed

Initial HTML track playback speed from 1 to 15.

earth_rotation_speed

Initial Earth rotation speed from 0 to 20.

beams

Optional beam names to read from open GEDI objects.

every

Keep every nth footprint after ordering. Increase this for a complete orbit to reduce animation size and rendering time.

Examples

Run this code
orbit <- data.frame(
  longitude = seq(-60, -45, length.out = 30),
  latitude = seq(-8, 5, length.out = 30),
  delta_time = seq_len(30), beam = "BEAM0101"
)
html <- plot_gedi_orbit_animation(
  orbit, output_file = tempfile(fileext = ".html")
)
file.exists(html)

Run the code above in your browser using DataLab