Skip to content

Enumerations

Enumerations used by the event detection system.

EventDirection

EventDirection()

Event detection direction.

Specifies which type of zero-crossing to detect: increasing (negative to positive), decreasing (positive to negative), or any crossing.

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

# Detect decreasing crossings only
direction = bh.EventDirection.DECREASING

# Compare directions
if direction == bh.EventDirection.DECREASING:
    print("Decreasing")

Initialize instance.

ANY class-attribute

ANY: Any = EventDirection.Any

Event detection direction.

Specifies which type of zero-crossing to detect: increasing (negative to positive), decreasing (positive to negative), or any crossing.

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

# Detect decreasing crossings only
direction = bh.EventDirection.DECREASING

# Compare directions
if direction == bh.EventDirection.DECREASING:
    print("Decreasing")

DECREASING class-attribute

DECREASING: Any = EventDirection.Decreasing

Event detection direction.

Specifies which type of zero-crossing to detect: increasing (negative to positive), decreasing (positive to negative), or any crossing.

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

# Detect decreasing crossings only
direction = bh.EventDirection.DECREASING

# Compare directions
if direction == bh.EventDirection.DECREASING:
    print("Decreasing")

INCREASING class-attribute

INCREASING: Any = EventDirection.Increasing

Event detection direction.

Specifies which type of zero-crossing to detect: increasing (negative to positive), decreasing (positive to negative), or any crossing.

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

# Detect decreasing crossings only
direction = bh.EventDirection.DECREASING

# Compare directions
if direction == bh.EventDirection.DECREASING:
    print("Decreasing")

EventAction

EventAction()

Action to take when an event is detected.

Determines whether propagation should stop or continue after an event is detected. Can be set as the default action via .set_terminal() or returned from a callback to override the default.

Example
import brahe as bh

# Terminal event (stops propagation)
event = bh.TimeEvent(target_epoch, "Maneuver").set_terminal()

# Callback can override the action
def callback(epoch, state):
    return (None, bh.EventAction.STOP)  # Override to stop

event = bh.TimeEvent(epoch, "Check").with_callback(callback)

Initialize instance.

CONTINUE class-attribute

CONTINUE: Any = EventAction.Continue

Action to take when an event is detected.

Determines whether propagation should stop or continue after an event is detected. Can be set as the default action via .set_terminal() or returned from a callback to override the default.

Example
import brahe as bh

# Terminal event (stops propagation)
event = bh.TimeEvent(target_epoch, "Maneuver").set_terminal()

# Callback can override the action
def callback(epoch, state):
    return (None, bh.EventAction.STOP)  # Override to stop

event = bh.TimeEvent(epoch, "Check").with_callback(callback)

STOP class-attribute

STOP: Any = EventAction.Stop

Action to take when an event is detected.

Determines whether propagation should stop or continue after an event is detected. Can be set as the default action via .set_terminal() or returned from a callback to override the default.

Example
import brahe as bh

# Terminal event (stops propagation)
event = bh.TimeEvent(target_epoch, "Maneuver").set_terminal()

# Callback can override the action
def callback(epoch, state):
    return (None, bh.EventAction.STOP)  # Override to stop

event = bh.TimeEvent(epoch, "Check").with_callback(callback)

EventType

EventType()

Type of event: instantaneous or period.

Instantaneous events occur at a single point in time (e.g., apoapsis crossing). Period events maintain a condition over an interval (e.g., time within eclipse).

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

# Check event type from a detected event
if detected_event.event_type == bh.EventType.INSTANTANEOUS:
    print(f"Event at {detected_event.window_open}")
else:
    print(f"Period from {detected_event.window_open} to {detected_event.window_close}")

Initialize instance.

INSTANTANEOUS class-attribute

INSTANTANEOUS: Any = EventType.Instantaneous

Type of event: instantaneous or period.

Instantaneous events occur at a single point in time (e.g., apoapsis crossing). Period events maintain a condition over an interval (e.g., time within eclipse).

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

# Check event type from a detected event
if detected_event.event_type == bh.EventType.INSTANTANEOUS:
    print(f"Event at {detected_event.window_open}")
else:
    print(f"Period from {detected_event.window_open} to {detected_event.window_close}")

WINDOW class-attribute

WINDOW: Any = EventType.Window

Type of event: instantaneous or period.

Instantaneous events occur at a single point in time (e.g., apoapsis crossing). Period events maintain a condition over an interval (e.g., time within eclipse).

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

# Check event type from a detected event
if detected_event.event_type == bh.EventType.INSTANTANEOUS:
    print(f"Event at {detected_event.window_open}")
else:
    print(f"Period from {detected_event.window_open} to {detected_event.window_close}")

EdgeType

EdgeType()

Edge type for binary event detection.

Specifies which boolean transition to detect: rising edge (false → true), falling edge (true → false), or any edge.

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

# Detect falling edge (true → false, e.g., eclipse entry)
edge = bh.EdgeType.FALLING_EDGE

def is_sunlit(epoch, state):
    return state[0] > 0  # Simple check

event = bh.BinaryEvent("Eclipse Entry", is_sunlit, edge)

Initialize instance.

ANY_EDGE class-attribute

ANY_EDGE: Any = EdgeType.AnyEdge

Edge type for binary event detection.

Specifies which boolean transition to detect: rising edge (false → true), falling edge (true → false), or any edge.

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

# Detect falling edge (true → false, e.g., eclipse entry)
edge = bh.EdgeType.FALLING_EDGE

def is_sunlit(epoch, state):
    return state[0] > 0  # Simple check

event = bh.BinaryEvent("Eclipse Entry", is_sunlit, edge)

FALLING_EDGE class-attribute

FALLING_EDGE: Any = EdgeType.FallingEdge

Edge type for binary event detection.

Specifies which boolean transition to detect: rising edge (false → true), falling edge (true → false), or any edge.

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

# Detect falling edge (true → false, e.g., eclipse entry)
edge = bh.EdgeType.FALLING_EDGE

def is_sunlit(epoch, state):
    return state[0] > 0  # Simple check

event = bh.BinaryEvent("Eclipse Entry", is_sunlit, edge)

RISING_EDGE class-attribute

RISING_EDGE: Any = EdgeType.RisingEdge

Edge type for binary event detection.

Specifies which boolean transition to detect: rising edge (false → true), falling edge (true → false), or any edge.

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

# Detect falling edge (true → false, e.g., eclipse entry)
edge = bh.EdgeType.FALLING_EDGE

def is_sunlit(epoch, state):
    return state[0] > 0  # Simple check

event = bh.BinaryEvent("Eclipse Entry", is_sunlit, edge)

See Also