capturegraph.scheduling.distance.solar
#
Solar Distance - Angular Separation 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.).
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. |
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: |