Package 'aviodebris'

Title: Estimate impact of space debris reentries on aviation
Description: Functions to help prepare the data and plots for the DASC 2025 paper "Preparing for Potential Closure of European Airspaces due to Re-entering Space Objects".
Authors: Enrico Spinielli [aut, cre] (ORCID: <https://orcid.org/0000-0001-8584-9131>), EUROCONTROL [cph, fnd]
Maintainer: Enrico Spinielli <[email protected]>
License: MIT + file LICENSE
Version: 0.3.0
Built: 2026-12-06 09:12:49 UTC
Source: https://github.com/euctrl-pru/aviodebris

Help Index


Aircraft type info

Description

Aircraft type info

Usage

aircraft_types

Format

A data frame with 322 rows and 15 columns:

  • icao: the ICAO aircraft type code.

  • name: the aircraft type name.

  • manufacturer: the manufacturer.

  • type: the type, i.e. L2J for Landplane 2 Jet engines craft

  • wtc: Wake Turbulence Category

  • ...: the rest


Approximate bounding box for NM area

Description

Approximate bounding box for NM area

Usage

bbox_nm()

Value

bounding box for NM area


Return the bounding box of the H3 hexagons covering a user bounding box.

Description

Return the bounding box of the H3 hexagons covering a user bounding box.

Usage

bbox_of_hexes_for_bbox_at_res(bbox, resolution)

Arguments

bbox

the user bounding box

resolution

the resolution of the H3 hexagons covering bbox

Value

the bounding box containing the H3 hexagons covering bbox


Find the position and velocity vectors in geocentric equatorial (ijk) system given the classical orbit elements

Description

The additional orbital elements provide calculations for perfectly circular and equatorial orbits.

Usage

coe2rv(
  p,
  ecc,
  incl,
  raan,
  argp,
  nu = 0,
  arglat = 0,
  truelon = 0,
  lonper = 0,
  mu = GRAVITATIONAL_CONSTANT_EARTH
)

Arguments

p

semilatus rectum, p, [km]

ecc

eccentricity, e, [unitless]

incl

inclination, i, [0,π][0, \pi] [rad]

raan

right ascension of ascending node, i.e. the longitude of the ascending node, ⁠\eqn{\Omega}⁠

argp

argument of perigee, ⁠\eqn{\omega}⁠, [0,2π][0, 2\pi] [rad]

nu

true anomaly, ⁠\eqn{\nu}⁠, [0,2π][0, 2\pi] [rad]

arglat

argument of latitude (for circular inclined orbit), [0,2π][0, 2\pi] [rad]

truelon

true longitude (for circular equatorial orbit), [0,2π][0, 2\pi] [rad]

lonper

longitude of periapsis (for elliptical equatorial orbit), [0,2π][0, 2\pi] [rad]

mu

gravitational parameter, default to Earth's, [km^3/s^2]

Value

a list with r [km] and v [km/s]. For a single orbit these are named vectors (i, j, k and vi, vj, vk); when any element has length n > 1 they are n x 3 matrices with those column names. All elements are recycled to a common length (1 or n).

Examples

## Not run: 
p <- 11067.790 # km
ecc <- 0.83285
incl <- 87.87 * pi / 180 # rad
raan <- 227.89 * pi / 180 # rad
argp <- 53.38 * pi / 180
nu <- 92.335 * pi / 180

coe2rv(p, ecc, incl, raan, argp, nu)

## End(Not run)

Calculate hourly collision and casualty risk expectation

Description

Calculate hourly collision and casualty risk expectation

Usage

collision_and_casualty_risk_expectation_hourly(day, resolution = 3L)

Arguments

day

date to calculate for

resolution

H3 hex resolution

Value

(invisibly) a data frame with hourly collision_expectation and casualty_risk per cell. Called for its side effect of writing ⁠data/collision_and_casualty_<YYYY-MM-DD>_res_<resolution>_hourly.parquet⁠.


Determine the type of orbit based on eccentricity and inclination

Description

Determine the type of orbit based on eccentricity and inclination

Usage

determine_orbit_type(ecc, incl, tol = SMALL)

Arguments

ecc

the eccentricity of the orbit

incl

the inclination of the orbit [rad]

tol

SMALL value for tolerance

Value

a type of orbit such as - "circular_equatorial" - "circular_inclined" - "eph_equatorial" (elliptical, parabolic, hyperbolic equatorial) - "eph_inclined" (elliptical, parabolic, hyperbolic inclined)


convert a geocentric equatorial position vector into latitude and longitude

Description

This function finds both geodetic and geocentric latitude.

Usage

ecef2ll(r)

Arguments

r

ECEF (I, J, K) position vector [km]

Value

a list of the following named values * latgc: geocentric latitude of satellite, [−π/2,π/2][-\pi/2, \pi/2] [rad] * latgd: geodetic latitude of satellite, [−π/2,π/2][-\pi/2, \pi/2] [rad] * lon: longitude of satellite, [−π,π][-\pi, \pi] [rad] * hellp: height above the ellipsoid, [km]

Examples

## Not run: 
r <- c(
  i = 6524.834,
  j = 6862.875,
  k = 6448.296
)
res <- ecef2ll(r)

## End(Not run)

convert a geocentric equatorial position vector into latitude and longitude

Description

This function finds both geodetic and geocentric latitude. Algorithm by Borkowski, K. M. 1989. "Accurate Algorithms to Transform Geocentric to Geodetic Coordinates." Bulletin Geodesique Vol. 63: 50-56.

Usage

ecef2llb(r)

Arguments

r

ECEF (I, J, K) position vector [km]

Value

a list of the following named values * latgc: geocentric latitude of satellite, [−π/2,π/2][-\pi/2, \pi/2] [rad] * latgd: geodetic latitude of satellite, [−π/2,π/2][-\pi/2, \pi/2] [rad] * lon: longitude of satellite, [−π,π][-\pi, \pi] [rad] * hellp: height above the ellipsoid, [km]

Examples

## Not run: 
r <- c(
  i = 6524.834,
  j = 6862.875,
  k = 6448.296
) # km

res <- ecef2llb(r)

## End(Not run)

Effective Exposed Area

Description

Effective Exposed Area

Usage

effective_exposed_area

Format

A data frame with columns:

  • icao: the ICAO aircraft type code.

  • eea: the effective exposed area.

  • pax: the max number of passengers.


assign H3 cell index at specified resolution to all trajectory point

Description

Keep only portions in the BBOX of the study

Usage

hexagonize_traffic(
  day,
  resolution = 3L,
  interval = 30L,
  bbox = c(xmin = -40.01297, ymin = 16.99059, xmax = 46.76206, ymax = 82.00901)
)

Arguments

day

the date for the trajectories, it refers to the relevant parquet file in ⁠data/trajectories_<YYYY-MM-DD>_resampled_<interval>s.parquet⁠

resolution

the H3 resolution

interval

resampling interval

bbox

a bounding box with names xmin, xmax, ymin and ymax

Value

(invisibly) the trajectory points within bbox with added cell and h3_resolution columns. Called for its side effect of writing ⁠data/trajectories_<YYYY-MM-DD>_resampled_<interval>s_bbox_res_<resolution>.parquet⁠.


H3 hexagons covering a bounding box.

Description

H3 hexagons covering a bounding box.

Usage

hexes_for_bbox_at_res(bbox, resolution)

Arguments

bbox

bounding box to be covered by H3 hexagons

resolution

H3 hexagons' resolution

Value

simple features of H3 hexagons polygons and relevant addresses


convert from orbital elements to Cartesian coordinates

Description

convert from orbital elements to Cartesian coordinates

Usage

kepler_to_cartesian(nu, a, e, i, Omega, w, M = 5.9722e+24, m = 0)

Arguments

nu

the true anomaly, i.e. the angular displacement measured from periapsis to the position vector along the direction of motion [radians]

a

the semi-major axis of the orbit [m]

e

the eccentricity of the orbit

i

the inclination of the orbit [radians]

Omega

the Right ascension of the ascending node [radians]

w

the argument of perigee \[radians\]

M

the mass of the first body (more massive one), i.e. Earth, [kg]

m

the mass of the orbiting body (less massive), i.e. satellite, [kg]. In the case of m << M, m can be passed as 0

Value

a vector with I, J, K, Vi, Vj, Vk of the values of position and velocity in a geocentric-equatorial reference system

Examples

## Not run: 
rE  <- 6378e3 # Earth equatorial radius
alt <- 550e3 # altitude of satellite, i.e. 500 km for LEO
ecc <- 0 # circular orbit, i.e. when uncontrolled reentry of debris
m   <- 0 # mass of debris/satellite << mass Earth, so it can be 0
o   <- 0
w   <- 0
i <- 10
kepler_to_cartesian(
  nu = 0.5,
  a = rE + alt,
  e = ecc,
  i = i,
  Omega = o,
  w = w,
  m = m)

## End(Not run)

latitude weight for a space object circularly orbiting at 'inclination'

Description

latitude weight for a space object circularly orbiting at 'inclination'

Usage

latitude_weights(delta_lat, altitude, inclination_deg, n = 10001L)

Arguments

delta_lat

delta altitude [decimal degrees]

altitude

altitude of the orbiting space object [m]

inclination_deg

inclination [decimal degrees], in [0, 180] (values above 90 are retrograde)

n

number of samples of the orbit

Value

a tibble of latitudes and values for the density

Examples

## Not run: 
rE  <- 6378e3 # Earth equatorial radius
alt <- 550e3 # altitude of satellite, i.e. 500 km for LEO
latitude_weights(0.5, rE + alt, 50)

## End(Not run)

Solves for the eccentric anomaly and mean anomaly given the true anomaly

Description

This function solves Kepler's equation when the true anomaly is known. The mean and eccentric, parabolic, or hyperbolic anomaly is also found. The default parabolic limit at 168 deg is arbitrary. The hyperbolic anomaly is also limited. The hyperbolic sine is used because it's not double-valued.

Usage

newtonnu(ecc, nu, parabolic_lim_deg = 168)

Arguments

ecc

eccentricity of the orbit (vectorised with nu)

nu

true anomaly [rad]

parabolic_lim_deg

paraboloic limit [deg], default is 168

Details

References: Vallado: 2022, p. 78, Algorithm 5

Value

list(e0, m) * e0 = eccentric anomaly [rad] * 'm“ = mean anomaly [rad]


Plot H3 hex map

Description

Plot H3 hex map

Usage

plot_hexes_map(resolution)

Arguments

resolution

cells resolution

Value

a plot

Examples

## Not run: 
plot_hexes_map(2L)

## End(Not run)

Debris reentry data

Description

A subset of data from the following catalogues

  • satcat Standard Satellite Catalog (S) Objects from the US Satellite Catalog

  • auxcat Auxiliary Satellite Catalog (A) Objects omitted from the US catalog

  • tmpcat Temporary Catalog (T) Objects expected to receive an S catalog number soon consisting of only reentries occurred in the 25 years from 2000-01-01 (included) till 2025-01-01 (excluded) satcat, auxcat and tmpcat from J. C. McDowell, “General Catalog of Artificial Space Objects.” 2020.

Usage

reentries_gcat

Format

A data frame with 1968 rows and 6 columns:

  • jcat: A space object tag; a single prefix letter followed by a sequence number with 5 digits. Possible prefixes are:

    • A for auxcat (Auxiliary catalog)

    • S for stdcat (Standard catalog)

    • T for tmpcat (Temporary catalog)

  • piece: The piece designation for the object

  • type: This field tells you something about what kind of object:

    • R1–R5: Stage number for launch vehicle stage.

    • C..[A|M]: a component, i.e. a functional part of the spacecraft or rocket that is deliberately or accidentally ejected.

  • inclination: the orbit inclination in degrees, in the [0, 180] interval (values above 90 are retrograde orbits).

  • reentry_date: the date of reentry in "vague date" format.

  • dry_mass: the (poosibly estimated) dry mass.

Source

https://planet4589.org/space/gcat


resample a day of trajectories at interval

Description

resample a day of trajectories at interval

Usage

resample_traffic(day, interval = 30L)

Arguments

day

the date for the trajectories, it refers to the relevant parquet file in 'data-raw/trjs/trjs_<YYYY-MM-DD>.parquet'

interval

number of seconds between samples [30]

Value

(invisibly) a data frame of resampled points. Called for its side effect of writing 'data/trajectories_<YYYY-MM-DD>_resampled_<interval>s.parquet'


Rotate a vector about the 1st axis

Description

Rotate a vector about the 1st axis

Usage

rot1(vec, theta)

Arguments

vec

a 3D vector, or an n x 3 matrix with one vector per row

theta

the angle of rotation [rad], length 1 or n

Value

an n x 3 matrix of rotated vectors (one row per input vector)

Examples

## Not run: 
c(0, 1, 0) |> rot1(pi/2)

## End(Not run)

Rotate a vector about the 3rd axis

Description

Rotate a vector about the 3rd axis

Usage

rot3(vec, theta)

Arguments

vec

a 3D vector, or an n x 3 matrix with one vector per row

theta

the angle of rotation [rad], length 1 or n

Value

an n x 3 matrix of rotated vectors (one row per input vector)

Examples

## Not run: 
c(0, 1, 0) |> rot3(-pi/2)

## End(Not run)

Converts position and velocity vectors into classical orbital elements.

Description

From Vallado, Algorithm 9

Usage

rv2coe(r, v, mu = GRAVITATIONAL_CONSTANT_EARTH)

Arguments

r

Position vector [km]: a 3-vector, or an n x 3 matrix (one per row)

v

Velocity vector [km/s]: same shape as r

mu

gravitational parameter, default to Earth's, [km^3/s^2]

Value

a list of named length-n vectors (n = number of state vectors), (p, a, ecc, incl, raan, argp, nu, m, arglat, truelon, lonper, orbit_type), where * p = semilatus rectum [km] * a = semimajor axis [km] * ecc = eccentricity * incl = inclination [rad (0—2π)] * raan = right ascension of the ascending node [rad (0—2π)] * argp = argument of perigee [rad (0—2π)] * nu = true anomaly [rad (0—2π)] * m = mean anomaly [rad (0—2π)] * arglat = argument of latitude [rad (0—2π)] * truelon = true longitude [rad (0—2π)] * lonper = longitude of periapsis [rad (0—2π)] * orbit_type = type of orbit such as - "circular_equatorial" - "circular_inclined" - "eph_equatorial" (elliptical, parabolic, hyperbolic equatorial) - "eph_inclined" (elliptical, parabolic, hyperbolic inclined)

Examples

## Not run: 
# Vallado, 2022, Ex. 2-5
# Position and velocity in km and km/s
r = c(6524.834, 6862.875, 6448.296)
v = c(4.901327, 5.533756, -1.976341)
rv2coe(r = r, v = v)

## End(Not run)

Scraper for doc8643.com's Aircraft info

Description

Scraper for doc8643.com's Aircraft info

Usage

scrape_aircraft_type_info_doc8643(ac_type, session)

Arguments

ac_type

ICAO aircraft type

session

polite session

Value

a dataframe of aircraft info

Examples

## Not run: 
host <- "https://doc8643.com/"
session <- polite::bow(host, force = TRUE)
scraper <- purrr::partial(scrape_aircraft_type_info_doc8643, session = session)

ac_types |>
  map(.f = scraper) |>
  bind_rows() |>
  # fix some data
  mutate(
    type = case_when(
      icao == "C700" ~ "L2J",
      icao == "C68A" ~ "L2J",
      .default = .data$type
    )
  ) |>
  separate_wider_delim(
    manufacturer,
    " ",
    names = c("manufacturer", "other"),
    too_many = "drop"
  ) |>
  # fix some data
  mutate(
    manufacturer = case_when(
      manufacturer == "AIR" ~ str_c(manufacturer, other, sep = " "),
      manufacturer == "AVIONES" ~ str_c(manufacturer, other, sep = " "),
      manufacturer == "GULFSTREAM" ~ str_c(manufacturer, other, sep = " "),
      other == "HELICOPTERS" & manufacturer == "AIRBUS" ~
        str_c(manufacturer, other, sep = " "),
      other == "GRUMMAN" & manufacturer == "NORTHROP" ~
        str_c(manufacturer, other, sep = " "),
      other == "MARTIN" & manufacturer == "LOCKHEED" ~
        str_c(manufacturer, other, sep = " "),
      .default = manufacturer
    )
  ) |>
  select(-other)

## End(Not run)

Scraper for EUROCONTROL's Aircraft Performance DB

Description

Scraper for EUROCONTROL's Aircraft Performance DB

Usage

scrape_aircraft_type_info_perfdb(ac_type, session)

Arguments

ac_type

ICAO aircraft type

session

polite session

Value

a dataframe of aircraft info

Examples

## Not run: 
host <- "https://learningzone.eurocontrol.int/ilp/customs/ATCPFDB/details.aspx"
session <- polite::bow(host, force = TRUE)
scraper <- purrr::partial(scrape_aircraft_type_info_perfdb,
                          session = session)

ac_types |>
  map(.f = scraper) |>
  bind_rows()

## End(Not run)

Scraper for EUROCONTROL's Skybrary aircraft info

Description

Scraper for EUROCONTROL's Skybrary aircraft info

Usage

scrape_aircraft_type_info_skybrary(ac_type, session)

Arguments

ac_type

ICAO aircraft type

session

polite session

Value

a dataframe of aircraft info

Examples

## Not run: 
host <- "https://skybrary.aero/"
session <- polite::bow(host, force = TRUE)
scraper <- purrr::partial(scrape_aircraft_type_info_skybrary, session = session)

 ac_types |>
  map(.f = scraper) |>
  bind_rows()

## End(Not run)

Calculated the hourly traffic density per aircraft type

Description

Calculated the hourly traffic density per aircraft type

Usage

traffic_density_hourly(day, resolution = 3L, interval = 30L)

Arguments

day

the date to calculate the traffic density for; it refers to the file ⁠trajectories_<YYYY-MM-DD>_resampled_<interval>s_bbox_res_<resolution>.parquet⁠ in ⁠data/⁠

resolution

the resolution of the H3 hexagonal cells

interval

resampling interval

Value

(invisibly) a data frame of hourly occupancy and density_m2 per cell and aircraft type. Called for its side effect of writing ⁠data/traffic_density_<YYYY-MM-DD>_res_<resolution>_hourly.parquet⁠


Debris hourly density function per H3 hex cell at resolution 3

Description

Hourly weighting functions for reentered debris in 25 years from 2000-01-01 till 2025-01-01 (excluded), for H3 cells at resolution 3.

Usage

weightings_h3_resolution_3_hourly

Format

A data frame with 360 * 720 rows and 1 column:

  • h3_resolution_3: the H3 cell id

  • w: the value of the hourly weighting function.


Debris weighting function for half degree grid

Description

Hourly weighting functions for reentered debris in 25 years from 2000-01-01 till 2025-01-01 (excluded), at half degree resolution worldwide.

Usage

weightings_half_degree_hourly

Format

A data frame with 360 * 720 rows and 3 columns:

  • lon: the longitude.

  • lat: the latitude.

  • val: the value of the hourly weighting function.


Debris weighting function per latitude

Description

weighting functions for reentered debris in 25 years from 2000-01-01 till 2025-01-01 (excluded), at half degree resolution.

Usage

weightings_half_degree_latitude

Format

A data frame with 360 rows (latitude from -90 to 90 at half degree) and 2 columns:

  • lat: the latitude.

  • val: the value of the weighting function.