create_gaussian_kernel
Creates a 2D Gaussian kernel for simulating the dispersion of light pollution. The kernel is defined by:r is the distance from the center and σ is the standard deviation.
Parameters
The standard deviation of the Gaussian in kilometers
The cutoff radius in kilometers (kernel is set to 0 beyond this distance)
The spatial resolution per pixel in kilometers
Returns
A normalized 2D kernel array with shape
(2*halo+1, 2*halo+1) where halo = ceil(max_radius_km / res_km)Example
create_power_law_kernel
Creates a 2D power-law kernel typical for atmospheric scattering. The kernel combines a power-law decay with exponential attenuation:ris the distance from centerpis the power exponentr₀is the regularization radius (prevents singularity at origin)λis the exponential decay length (extinction length)
Parameters
Power exponent controlling the rate of decay
Regularization radius at the origin in kilometers (prevents division by zero)
Exponential decay factor in kilometers (like an extinction length). Set to 0 to disable exponential decay.
Cutoff radius in kilometers (kernel is set to 0 beyond this distance)
Spatial resolution per pixel in kilometers
Returns
A normalized 2D kernel array with shape
(2*halo+1, 2*halo+1) where halo = ceil(max_radius_km / res_km)