solar
solar
#
Angular separation between two solar positions on the celestial sphere.
Measures the angular distance between two solar positions using the Haversine formula. Used to ensure captures are distributed across different sun angles (morning, noon, evening, golden hour, etc.).
SolarDistanceFunction
#
Bases: BatchedDistanceFunction[SolarPosition]
Haversine angular distance between solar positions, normalized by sigma.
Source code in capturegraph-lib/capturegraph/scheduling/distance/solar.py
__call__(a, b)
#
Haversine angular distance between two solar positions, normalized.
__init__(sigma_deg=1.0)
#
extract(items)
#
Extract altitude/azimuth (in radians) as a two-column feature array.
Source code in capturegraph-lib/capturegraph/scheduling/distance/solar.py
pairwise(features_a, features_b)
#
Compute pairwise Haversine distances from extracted solar features.
Source code in capturegraph-lib/capturegraph/scheduling/distance/solar.py
solar(sigma_deg=1.0)
#
Create a distance function based on solar angular separation.
Uses the Haversine formula to compute angular distance between solar positions on the celestial sphere.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigma_deg
|
float
|
Normalization factor in degrees. The returned distance is
|
1.0
|
Returns:
| Type | Description |
|---|---|
SolarDistanceFunction
|
A distance function with batch support: |
Source code in capturegraph-lib/capturegraph/scheduling/distance/solar.py
solar_distance_deg(angle_a, angle_b)
#
Compute angular distance using the Haversine formula.
The Haversine formula is numerically stable for small angles, unlike the spherical cosine formula which loses precision near 0°.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
angle_a
|
SolarPosition
|
First solar position (with altitude, azimuth in degrees). |
required |
angle_b
|
SolarPosition
|
Second solar position (with altitude, azimuth in degrees). |
required |
Returns:
| Type | Description |
|---|---|
float
|
Angular distance in degrees. |