Skip to content

Constraints

Constraints define criteria that must be satisfied for satellite access.

Built-in Constraints

ElevationConstraint

ElevationConstraint

ElevationConstraint(min_elevation_deg: float | None = None, max_elevation_deg: float | None = None)

Elevation angle constraint for satellite visibility.

Constrains access based on the elevation angle of the satellite above the local horizon at the ground location.

Parameters:

Name Type Description Default
min_elevation_deg float | None

Minimum elevation angle in degrees, or None for no minimum

None
max_elevation_deg float | None

Maximum elevation angle in degrees, or None for no maximum

None

Raises:

Type Description
ValueError

If both min and max are None (unbounded constraint is meaningless)

Example
import brahe as bh

# Typical ground station constraint: 5° minimum elevation
constraint = bh.ElevationConstraint(min_elevation_deg=5.0, max_elevation_deg=None)

# Both bounds specified
constraint = bh.ElevationConstraint(min_elevation_deg=5.0, max_elevation_deg=85.0)

# Only maximum (e.g., avoid zenith)
constraint = bh.ElevationConstraint(min_elevation_deg=None, max_elevation_deg=85.0)

Initialize instance.

evaluate method descriptor

evaluate(epoch: Epoch, sat_state_ecef: Union[ndarray, List], location_ecef: Union[ndarray, List]) -> bool

Evaluate whether the constraint is satisfied.

Parameters:

Name Type Description Default
epoch Epoch

Time of evaluation

required
sat_state_ecef ndarray or list

Satellite state in ECEF [x, y, z, vx, vy, vz] (meters, m/s)

required
location_ecef ndarray or list

Ground location in ECEF [x, y, z] (meters)

required

Returns:

Name Type Description
bool bool

True if constraint is satisfied, False otherwise

name method descriptor

name() -> Any

Get the constraint name

ElevationMaskConstraint

ElevationMaskConstraint

ElevationMaskConstraint(mask: list[tuple[float, float]])

Azimuth-dependent elevation mask constraint.

Constrains access based on azimuth-dependent elevation masks. Useful for ground stations with terrain obstructions or antenna limitations.

The mask is defined as a list of (azimuth, elevation) pairs in degrees. Linear interpolation is used between points, and the mask wraps at 0°/360°.

Parameters:

Name Type Description Default
mask list[tuple[float, float]]

List of (azimuth_deg, min_elevation_deg) pairs

required
Example
import brahe as bh

# Ground station with terrain obstruction to the north
mask = [
    (0.0, 15.0),     # North: 15° minimum
    (90.0, 5.0),     # East: 5° minimum
    (180.0, 5.0),    # South: 5° minimum
    (270.0, 5.0),    # West: 5° minimum
]
constraint = bh.ElevationMaskConstraint(mask)

Initialize instance.

evaluate method descriptor

evaluate(epoch: Epoch, sat_state_ecef: Union[ndarray, List], location_ecef: Union[ndarray, List]) -> bool

Evaluate whether the constraint is satisfied.

Parameters:

Name Type Description Default
epoch Epoch

Time of evaluation

required
sat_state_ecef ndarray or list

Satellite state in ECEF [x, y, z, vx, vy, vz] (meters, m/s)

required
location_ecef ndarray or list

Ground location in ECEF [x, y, z] (meters)

required

Returns:

Name Type Description
bool bool

True if constraint is satisfied, False otherwise

name method descriptor

name() -> Any

Get the constraint name

OffNadirConstraint

OffNadirConstraint

OffNadirConstraint(min_off_nadir_deg: float | None = None, max_off_nadir_deg: float | None = None)

Off-nadir angle constraint for satellite imaging.

Constrains access based on the off-nadir angle (angle between the satellite's nadir vector and the line-of-sight to the location).

Parameters:

Name Type Description Default
min_off_nadir_deg float | None

Minimum off-nadir angle in degrees, or None for no minimum

None
max_off_nadir_deg float | None

Maximum off-nadir angle in degrees, or None for no maximum

None

Raises:

Type Description
ValueError

If both min and max are None, or if any angle is negative

Example
1
2
3
4
5
6
7
import brahe as bh

# Imaging satellite with 45° maximum slew angle
constraint = bh.OffNadirConstraint(min_off_nadir_deg=None, max_off_nadir_deg=45.0)

# Minimum 10° to avoid nadir (e.g., for oblique imaging)
constraint = bh.OffNadirConstraint(min_off_nadir_deg=10.0, max_off_nadir_deg=45.0)

Initialize instance.

evaluate method descriptor

evaluate(epoch: Epoch, sat_state_ecef: Union[ndarray, List], location_ecef: Union[ndarray, List]) -> bool

Evaluate whether the constraint is satisfied.

Parameters:

Name Type Description Default
epoch Epoch

Time of evaluation

required
sat_state_ecef ndarray or list

Satellite state in ECEF [x, y, z, vx, vy, vz] (meters, m/s)

required
location_ecef ndarray or list

Ground location in ECEF [x, y, z] (meters)

required

Returns:

Name Type Description
bool bool

True if constraint is satisfied, False otherwise

name method descriptor

name() -> Any

Get the constraint name

LookDirectionConstraint

LookDirectionConstraint

LookDirectionConstraint(allowed: LookDirection)

Look direction constraint (left/right relative to velocity).

Constrains access based on the look direction of the satellite relative to its velocity vector.

Parameters:

Name Type Description Default
allowed LookDirection

Required look direction (LEFT, RIGHT, or EITHER)

required
Example
1
2
3
4
5
6
7
import brahe as bh

# Satellite can only look right
constraint = bh.LookDirectionConstraint(allowed=bh.LookDirection.RIGHT)

# Either direction is acceptable
constraint = bh.LookDirectionConstraint(allowed=bh.LookDirection.EITHER)

Initialize instance.

evaluate method descriptor

evaluate(epoch: Epoch, sat_state_ecef: Union[ndarray, List], location_ecef: Union[ndarray, List]) -> bool

Evaluate whether the constraint is satisfied.

Parameters:

Name Type Description Default
epoch Epoch

Time of evaluation

required
sat_state_ecef ndarray or list

Satellite state in ECEF [x, y, z, vx, vy, vz] (meters, m/s)

required
location_ecef ndarray or list

Ground location in ECEF [x, y, z] (meters)

required

Returns:

Name Type Description
bool bool

True if constraint is satisfied, False otherwise

name method descriptor

name() -> Any

Get the constraint name

LocalTimeConstraint

LocalTimeConstraint

LocalTimeConstraint(time_windows: list[tuple[int, int]])

Local solar time constraint.

Constrains access based on the local solar time at the ground location. Useful for sun-synchronous orbits or daytime-only imaging.

Time windows are specified in military time format (HHMM). Wrap-around windows (e.g., 2200-0200) are supported.

Parameters:

Name Type Description Default
time_windows list[tuple[int, int]]

List of (start_military, end_military) tuples (0-2400)

required

Raises:

Type Description
ValueError

If any military time is invalid (>2400 or minutes >=60)

Example
import brahe as bh

# Only daytime (6 AM to 6 PM local time)
constraint = bh.LocalTimeConstraint(time_windows=[(600, 1800)])

# Two windows: morning (6-9 AM) and evening (4-7 PM)
constraint = bh.LocalTimeConstraint(time_windows=[(600, 900), (1600, 1900)])

# Overnight window (10 PM to 2 AM) - handles wrap-around
constraint = bh.LocalTimeConstraint(time_windows=[(2200, 200)])

Initialize instance.

evaluate method descriptor

evaluate(epoch: Epoch, sat_state_ecef: Union[ndarray, List], location_ecef: Union[ndarray, List]) -> bool

Evaluate whether the constraint is satisfied.

Parameters:

Name Type Description Default
epoch Epoch

Time of evaluation

required
sat_state_ecef ndarray or list

Satellite state in ECEF [x, y, z, vx, vy, vz] (meters, m/s)

required
location_ecef ndarray or list

Ground location in ECEF [x, y, z] (meters)

required

Returns:

Name Type Description
bool bool

True if constraint is satisfied, False otherwise

from_hours builtin

from_hours(time_windows: list[tuple[float, float]]) -> LocalTimeConstraint

Create from decimal hour windows instead of military time.

Parameters:

Name Type Description Default
time_windows list[tuple[float, float]]

List of (start_hour, end_hour) tuples [0, 24)

required

Returns:

Name Type Description
LocalTimeConstraint LocalTimeConstraint

The constraint instance

Example
1
2
3
4
5
6
7
import brahe as bh

# Only daytime (6 AM to 6 PM local time)
constraint = bh.LocalTimeConstraint.from_hours([(6.0, 18.0)])

# Overnight window (10 PM to 2 AM)
constraint = bh.LocalTimeConstraint.from_hours([(22.0, 2.0)])

name method descriptor

name() -> Any

Get the constraint name

AscDscConstraint

AscDscConstraint

AscDscConstraint(allowed: AscDsc)

Ascending/descending pass constraint.

Constrains access based on whether the satellite is on an ascending or descending pass (moving north or south).

Parameters:

Name Type Description Default
allowed AscDsc

Required pass type (ASCENDING, DESCENDING, or EITHER)

required
Example
1
2
3
4
5
6
7
import brahe as bh

# Only ascending passes
constraint = bh.AscDscConstraint(allowed=bh.AscDsc.ASCENDING)

# Either type is acceptable
constraint = bh.AscDscConstraint(allowed=bh.AscDsc.EITHER)

Initialize instance.

evaluate method descriptor

evaluate(epoch: Epoch, sat_state_ecef: Union[ndarray, List], location_ecef: Union[ndarray, List]) -> bool

Evaluate whether the constraint is satisfied.

Parameters:

Name Type Description Default
epoch Epoch

Time of evaluation

required
sat_state_ecef ndarray or list

Satellite state in ECEF [x, y, z, vx, vy, vz] (meters, m/s)

required
location_ecef ndarray or list

Ground location in ECEF [x, y, z] (meters)

required

Returns:

Name Type Description
bool bool

True if constraint is satisfied, False otherwise

name method descriptor

name() -> Any

Get the constraint name

Logical Composition

ConstraintAll

ConstraintAll

ConstraintAll(constraints: List)

Composite constraint combining multiple constraints with AND logic.

All constraints must be satisfied for the composite to evaluate to true.

Parameters:

Name Type Description Default
constraints list

List of constraint objects to combine with AND logic

required
Example
1
2
3
4
5
6
import brahe as bh

# Ground station with multiple requirements
elev = bh.ElevationConstraint(min_elevation_deg=5.0, max_elevation_deg=None)
time = bh.LocalTimeConstraint(time_windows=[(600, 1800)])
combined = bh.ConstraintAll(constraints=[elev, time])

Initialize instance.

evaluate method descriptor

evaluate(epoch: Epoch, sat_state_ecef: Union[ndarray, List], location_ecef: Union[ndarray, List]) -> bool

Evaluate whether the constraint is satisfied.

Parameters:

Name Type Description Default
epoch Epoch

Time of evaluation

required
sat_state_ecef ndarray or list

Satellite state in ECEF [x, y, z, vx, vy, vz] (meters, m/s)

required
location_ecef ndarray or list

Ground location in ECEF [x, y, z] (meters)

required

Returns:

Name Type Description
bool bool

True if ALL constraints are satisfied, False otherwise

name method descriptor

name() -> Any

Get the constraint name

ConstraintAny

ConstraintAny

ConstraintAny(constraints: List)

Composite constraint combining multiple constraints with OR logic.

At least one constraint must be satisfied for the composite to evaluate to true.

Parameters:

Name Type Description Default
constraints list

List of constraint objects to combine with OR logic

required
Example
1
2
3
4
5
6
import brahe as bh

# Accept either high elevation or specific time window
elev = bh.ElevationConstraint(min_elevation_deg=60.0, max_elevation_deg=None)
time = bh.LocalTimeConstraint(time_windows=[(1200, 1400)])
combined = bh.ConstraintAny(constraints=[elev, time])

Initialize instance.

evaluate method descriptor

evaluate(epoch: Epoch, sat_state_ecef: Union[ndarray, List], location_ecef: Union[ndarray, List]) -> bool

Evaluate whether the constraint is satisfied.

Parameters:

Name Type Description Default
epoch Epoch

Time of evaluation

required
sat_state_ecef ndarray or list

Satellite state in ECEF [x, y, z, vx, vy, vz] (meters, m/s)

required
location_ecef ndarray or list

Ground location in ECEF [x, y, z] (meters)

required

Returns:

Name Type Description
bool bool

True if AT LEAST ONE constraint is satisfied, False otherwise

name method descriptor

name() -> Any

Get the constraint name

ConstraintNot

ConstraintNot

ConstraintNot(constraint: object)

Composite constraint negating another constraint with NOT logic.

The negated constraint must NOT be satisfied for this to evaluate to true.

Parameters:

Name Type Description Default
constraint object

Constraint object to negate

required
Example
1
2
3
4
5
import brahe as bh

# Avoid low elevation angles (i.e., require high elevation)
low_elev = bh.ElevationConstraint(min_elevation_deg=None, max_elevation_deg=10.0)
high_elev = bh.ConstraintNot(constraint=low_elev)

Initialize instance.

evaluate method descriptor

evaluate(epoch: Epoch, sat_state_ecef: Union[ndarray, List], location_ecef: Union[ndarray, List]) -> bool

Evaluate whether the constraint is satisfied.

Parameters:

Name Type Description Default
epoch Epoch

Time of evaluation

required
sat_state_ecef ndarray or list

Satellite state in ECEF [x, y, z, vx, vy, vz] (meters, m/s)

required
location_ecef ndarray or list

Ground location in ECEF [x, y, z] (meters)

required

Returns:

Name Type Description
bool bool

True if the negated constraint is NOT satisfied, False otherwise

name method descriptor

name() -> Any

Get the constraint name