Constraints¶
Constraint functions for satellite access prediction.
A constraint function has the signature::
constraint_fn(sat_ecef: Array[3], station_ecef: Array[3], rot_enz: Array[3,3]) -> float
- Positive means the constraint is satisfied.
- Negative means the constraint is violated.
- Zero is the boundary (where bisection finds roots).
Factory functions capture parameters inside closures, making them JIT-compatible and composable.
compute_off_nadir(sat_ecef, station_ecef)
¶
Off-nadir angle: angle between satellite nadir and line-of-sight to station.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sat_ecef
|
Array
|
Satellite ECEF position |
required |
station_ecef
|
Array
|
Station ECEF position |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Off-nadir angle in radians. |
constraint_all(*constraints)
¶
Compose constraints with AND logic.
The combined value is jnp.min(values) — satisfied only when
all sub-constraints are satisfied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*constraints
|
Callable
|
Two or more constraint functions. |
()
|
Returns:
| Type | Description |
|---|---|
Callable[[Array, Array, Array], Array]
|
A composed constraint function. |
constraint_any(*constraints)
¶
Compose constraints with OR logic.
The combined value is jnp.max(values) — satisfied when
any sub-constraint is satisfied.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*constraints
|
Callable
|
Two or more constraint functions. |
()
|
Returns:
| Type | Description |
|---|---|
Callable[[Array, Array, Array], Array]
|
A composed constraint function. |
constraint_not(constraint)
¶
elevation_constraint(min_el, max_el=None)
¶
Create a constraint that requires elevation within a band.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
min_el
|
float
|
Minimum elevation angle in radians. |
required |
max_el
|
float | None
|
Optional maximum elevation angle in radians.
If |
None
|
Returns:
| Type | Description |
|---|---|
Callable[[Array, Array, Array], Array]
|
A constraint function matching the constraint protocol. |
elevation_mask_constraint(mask_az, mask_el)
¶
Create a constraint with azimuth-dependent elevation threshold.
The mask defines minimum elevation as a function of azimuth.
Azimuth values wrap around at 2*pi.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mask_az
|
Array
|
1-D array of azimuth breakpoints in radians,
sorted ascending in |
required |
mask_el
|
Array
|
1-D array of corresponding minimum elevation thresholds in radians. |
required |
Returns:
| Type | Description |
|---|---|
Callable[[Array, Array, Array], Array]
|
A constraint function matching the constraint protocol. |
off_nadir_constraint(max_off_nadir, min_off_nadir=0.0)
¶
Create a constraint on the satellite off-nadir angle.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max_off_nadir
|
float
|
Maximum off-nadir angle in radians. |
required |
min_off_nadir
|
float
|
Minimum off-nadir angle in radians (default 0). |
0.0
|
Returns:
| Type | Description |
|---|---|
Callable[[Array, Array, Array], Array]
|
A constraint function matching the constraint protocol. |