lsurf.materials.ExponentialAtmosphere
- class lsurf.materials.ExponentialAtmosphere(name='Exponential Atmosphere', n_sea_level=1.000293, scale_height=8500.0, earth_radius=6371000.0, earth_center=(0.0, 0.0, 0.0), absorption_coef=0.0, absorption_scale_height=None, kernel=None, propagator=None)[source]
Exponential atmosphere with radially-dependent refractive index.
Models an atmosphere where air density decreases exponentially with altitude, causing the refractive index to approach 1 at high altitudes.
The model is spherically symmetric about Earth’s center, which is assumed to be at the origin (0, 0, 0) by default, or can be specified.
This class inherits from SimpleInhomogeneousModel, implementing the n_at_altitude() method for the exponential profile. GPU support is provided automatically via lookup table interpolation.
- Parameters:
name (str, optional) – Descriptive name for this material. Default is “Exponential Atmosphere”.
n_sea_level (float, optional) – Refractive index at sea level (Earth’s surface). Default is 1.000293.
scale_height (float, optional) – Atmospheric scale height H in meters. Default is 8500.0 m.
earth_radius (float, optional) – Radius of Earth in meters. Default is 6,371,000 m.
earth_center (tuple of float, optional) – Position of Earth’s center in meters. Default is (0, 0, 0).
absorption_coef (float, optional) – Absorption coefficient at sea level in m⁻¹. Default is 0.0.
absorption_scale_height (float, optional) – Scale height for absorption (can differ from density). Default is same as scale_height.
Examples
>>> atmosphere = ExponentialAtmosphere() >>> # Get refractive index at 10 km altitude >>> n = atmosphere.get_refractive_index(0, 0, EARTH_RADIUS + 10000, 532e-9) >>> print(f"n at 10 km: {n:.6f}") # ~1.000089
>>> # Get gradient at sea level directly above Earth's center >>> grad = atmosphere.get_refractive_index_gradient(0, 0, EARTH_RADIUS, 532e-9) >>> print(f"dn/dz at sea level: {grad[2]:.2e}") # ~ -3.4e-8 m^-1
- __init__(name='Exponential Atmosphere', n_sea_level=1.000293, scale_height=8500.0, earth_radius=6371000.0, earth_center=(0.0, 0.0, 0.0), absorption_coef=0.0, absorption_scale_height=None, kernel=None, propagator=None)[source]
Initialize material field.
- Parameters:
name (str, optional) – Descriptive name for this material. Default is “Material”.
kernel (PropagationKernelID, optional) – Override the default propagation kernel. Must be in supported_kernels(). If None, uses the class default.
propagator (PropagatorID, optional) – Override the default propagator. Must be in supported_propagators(). If None, uses the class default.
- Raises:
ValueError – If kernel or propagator is not supported by this material type.
Methods
__init__([name, n_sea_level, scale_height, ...])Initialize material field.
alpha_at_altitude(altitude[, wavelength])Return absorption coefficient at given altitude.
compute_curvature_radius(x, y, z[, wavelength])Compute the radius of curvature for a ray at given position.
compute_phase_velocity(x, y, z, wavelength)Compute phase velocity v_p = c/n at position.
default_kernel()Return the default propagation kernel for this material type.
default_propagator()Return the default propagator for this material type.
dn_dh_at_altitude(altitude[, wavelength])Return analytical dn/dh at given altitude.
get_absorption_coefficient(x, y, z, wavelength)Get absorption coefficient at position (x, y, z).
get_anisotropy_factor(x, y, z, wavelength)Get scattering anisotropy factor g (Henyey-Greenstein parameter).
get_density_ratio(x, y, z)Get atmospheric density ratio relative to sea level.
get_extinction_coefficient(x, y, z, wavelength)Get total extinction coefficient (absorption + scattering).
get_gpu_arrays()Return device arrays for GPU kernel.
get_gpu_kernels()Return GPU kernels for propagation.
get_gpu_parameters()Return scalar parameters for GPU kernel.
get_refractive_index(x, y, z, wavelength)Get refractive index at position (auto-generated from n_at_altitude).
get_refractive_index_gradient(x, y, z, ...)Get gradient of n at position (auto-generated).
get_refractive_index_gradient_magnitude(x, ...)Get magnitude of refractive index gradient |∇n|.
get_scattering_coefficient(x, y, z, wavelength)Return scattering coefficient (default: 0).
is_homogeneous()Check if material has uniform properties (no spatial variation).
n_at_altitude(altitude[, wavelength])Return refractive index at given altitude.
supported_kernels()Return list of propagation kernels supported by this material type.
supported_propagators()Return list of propagators supported by this material type.
Attributes
gpu_material_idReturn GPU material ID for kernel dispatch.
kernel_idReturn the kernel ID configured for this material instance.
propagator_idReturn the propagator ID configured for this material instance.
- __init__(name='Exponential Atmosphere', n_sea_level=1.000293, scale_height=8500.0, earth_radius=6371000.0, earth_center=(0.0, 0.0, 0.0), absorption_coef=0.0, absorption_scale_height=None, kernel=None, propagator=None)[source]
Initialize material field.
- Parameters:
name (str, optional) – Descriptive name for this material. Default is “Material”.
kernel (PropagationKernelID, optional) – Override the default propagation kernel. Must be in supported_kernels(). If None, uses the class default.
propagator (PropagatorID, optional) – Override the default propagator. Must be in supported_propagators(). If None, uses the class default.
- Raises:
ValueError – If kernel or propagator is not supported by this material type.
- n_at_altitude(altitude, wavelength=None)[source]
Return refractive index at given altitude.
- Implements the exponential profile:
n(h) = 1 + delta_n * exp(-h / H)
- dn_dh_at_altitude(altitude, wavelength=None)[source]
Return analytical dn/dh at given altitude.
- Derivative of exponential profile:
dn/dh = -(delta_n / H) * exp(-h / H)
- alpha_at_altitude(altitude, wavelength=None)[source]
Return absorption coefficient at given altitude.
- Implements exponential absorption profile:
α(h) = α₀ * exp(-h / H_α)
- get_absorption_coefficient(x, y, z, wavelength)[source]
Get absorption coefficient at position (x, y, z).
Absorption follows an exponential profile with altitude.
- Parameters:
- Returns:
alpha – Absorption coefficient in m⁻¹.
- Return type:
float or ndarray
- get_density_ratio(x, y, z)[source]
Get atmospheric density ratio relative to sea level.
- Parameters:
- Returns:
rho_ratio – Density relative to sea level (dimensionless). rho_ratio = rho(r) / rho_0 = exp(-altitude / H)
- Return type:
float or ndarray
- compute_curvature_radius(x, y, z, wavelength=5.32e-07)[source]
Compute the radius of curvature for a ray at given position.
The radius of curvature is R_c = n / |∇n|.
- Parameters:
- Returns:
R_c – Radius of curvature in meters. Very large values indicate nearly straight propagation.
- Return type:
float or ndarray