Skip to contents

Calculate stellar flux value

Usage

calculate_stellar_flux(st_lum, pl_orbsmax, log_lum = TRUE, unit = "relative")

Arguments

st_lum

Numeric. Stellar luminosity (log10(L/Lsun) or linear).

pl_orbsmax

Numeric. Orbital distance in AU.

log_lum

Logical. If TRUE, assumes st_lum is in log10(L / Lsun). Defaults to TRUE.

unit

Character. Either "relative" (default) or "wm2" to convert to W/m².

Value

Numeric. Stellar flux (relative or in W/m²).

Details

This function calculates the stellar flux based on provided values. It assumes luminosity is either logarithmic (log10 of L/Lsun) or linear, and optionally converts flux to absolute units (W/m²) if requested.

Stellar flux is the amount of energy from a star that reaches a given area per unit time.

Examples

# Solar-type star, Earth-like orbit
calculate_stellar_flux(st_lum = 0, pl_orbsmax = 1)
#> [1] 1
# Linear luminosity input (not log), 5x Sun at 2 AU
calculate_stellar_flux(st_lum = 5, pl_orbsmax = 2, log_lum = FALSE)
#> [1] 1.25
# Output in absolute units (W/m²), Earth-like conditions
calculate_stellar_flux(st_lum = 0, pl_orbsmax = 1, unit = "wm2")
#> [1] 1361