pycasx.acas
Main module to calculate advisories.
Submodules
Package Contents
Classes
Class that represents a fully connected ReLU network from a .nnet file. |
|
The advisories of the HCAS model. |
|
The advisories of the VCAS model. |
|
The state variables of the HCAS model. |
|
The state variables of the VCAS model. |
|
A generic aircraft class to save important state information. |
|
An intruder representation relying also on advisory data. |
|
Protocol for an ACAS X model. |
|
The advisory dictionary. |
|
The information about a CAS system. |
|
The information all CAS systems. |
|
The state variables of the HCAS model. |
|
The state variables of the VCAS model. |
|
An extended aircraft representation including the current timestamp. |
|
An extended aircraft representation including the current timestamp. |
|
An extended intruder representation relying also on advisory data. |
Functions
|
Checks whether two aircraft will lose separation. |
|
Extend the intruder with additional information. |
Attributes
- class pycasx.acas.NNet(filename)
Class that represents a fully connected ReLU network from a .nnet file.
- Parameters:
filename (str) – A .nnet file to load
- evaluate_network(inputs)
Evaluate network using given inputs.
- Parameters:
inputs (numpy array of floats) – Network inputs to be evaluated
- Returns:
Network output
- Return type:
(numpy array of floats)
- evaluate_network_multiple(inputs)
Evaluate network using multiple sets of inputs.
- Parameters:
inputs (numpy array of floats) – Array of network inputs to be evaluated.
- Returns:
Network outputs for each set of inputs
- Return type:
(numpy array of floats)
- pycasx.acas.ModelDict: typing_extensions.TypeAlias
- pycasx.acas.Quantity: typing_extensions.TypeAlias
- pycasx.acas.DEFAULT_MODEL_PATH
- pycasx.acas.DEFAULT_HCAS_MODEL_PATH
- pycasx.acas.DEFAULT_VCAS_MODEL_PATH
- pycasx.acas.ureg
- pycasx.acas.check_for_loss_of_separation(ac_1, ac_2, h_lim=500 * ureg.feet, v_lim=100 * ureg.feet)
Checks whether two aircraft will lose separation.
This function determines whether two aircraft will lose separation based on their current positions and speeds. The function assumes that the aircraft are flying in a straight line without changes in speed or direction.
- Parameters:
- Returns:
- A tuple of two booleans. The first boolean
indicates whether the aircraft will lose horizontal separation, the second boolean indicates whether the aircraft will lose vertical separation (True if possible collision is detected).
- Return type:
- Raises:
ValueError – Raised if the horizontal separation is not a length or the vertical separation is not a length.
- class pycasx.acas.HCASAdvisories
Bases:
enum.IntEnumThe advisories of the HCAS model.
- INOP
inoperative
- OFF
off
- ACTIVE
active
- COC
clear of conflict
- WL
weak left
- WR
weak right
- SL
strong left
- SR
strong right
- INOP
- OFF
- ACTIVE
- COC = 0
- WL = 1
- WR = 2
- SL = 3
- SR = 4
- class pycasx.acas.VCASAdvisories
Bases:
enum.IntEnumThe advisories of the VCAS model.
- INOP
inoperative
- OFF
off
- ACTIVE
active
- COC
clear of conflict
- DNC
do not climb
- DND
do not descend
- DES1500
descend >=1500 ft/min
- CL1500
climb >=1500 ft/min
- SDES1500
strengthen descend to >=1500 ft/min
- SCL1500
strengthen climb to >=1500 ft/min
- SDES2500
strengthen descend to >=2500 ft/min
- SCL2500
strengthen climb to >=2500 ft/min
- INOP
- OFF
- ACTIVE
- COC = 0
- DNC = 1
- DND = 2
- DES1500 = 3
- CL1500 = 4
- SDES1500 = 5
- SCL1500 = 6
- SDES2500 = 7
- SCL2500 = 8
- class pycasx.acas.HCASStateVariables
The state variables of the HCAS model.
- rho
range to intruder, measured in feet.
- Type:
Quantity
- theta
bearing angle to intruder, measured in degrees.
- Type:
Quantity
- psi
relative heading angle of intruder, measured in degrees.
- Type:
Quantity
- v_own
ownship speed, measured in feet per second.
- Type:
Quantity
- v_int
intruder speed, measured in feet per second.
- Type:
Quantity
- tau
time to loss of vertical separation, measured in seconds.
- Type:
Quantity
- s_adv
previous advisory.
- Type:
- rho: Quantity
- theta: Quantity
- psi: Quantity
- v_own: Quantity
- v_int: Quantity
- tau: Quantity
- s_adv: HCASAdvisories
- class pycasx.acas.VCASStateVariables
The state variables of the VCAS model.
- h
relative intruder altitude, measured in feet.
- Type:
Quantity
- hdot_own
ownship vertical rate, measured in feet per minute.
- Type:
Quantity
- hdot_int
intruder vertical rate, measured in feet per minute.
- Type:
Quantity
- tau
time to loss of horizontal separation, measured in seconds.
- Type:
Quantity
- s_adv
previous advisory.
- Type:
- h: Quantity
- hdot_own: Quantity
- hdot_int: Quantity
- tau: Quantity
- s_adv: VCASAdvisories
- class pycasx.acas.Aircraft
A generic aircraft class to save important state information.
Although this dataclass relies on Pint for unit handling, default units are given in the docstring for each attribute.
- altitude
The aircraft’s current altitude, measured in feet.
- Type:
Quantity
- vertical_speed
The aircraft’s current vertical speed, measured in feet per second.
- Type:
Quantity
- true_airspeed
The aircraft’s current true airspeed, measured in knots.
- Type:
Quantity
- heading
The aircraft’s current heading, measured in degrees.
- Type:
Quantity
- latitude
The aircraft’s current latitude, measured in degrees.
- Type:
Quantity
- longitude
The aircraft’s current longitude, measured in degrees.
- Type:
Quantity
- altitude: Quantity
- vertical_speed: Quantity
- true_airspeed: Quantity
- heading: Quantity
- latitude: Quantity
- longitude: Quantity
- class pycasx.acas.Intruder
An intruder representation relying also on advisory data.
- hcas_advisory
The HCAS advisory.
- Type:
- vcas_advisory
The VCAS advisory.
- Type:
- hcas_state_variables
The HCAS state with respect to the ownship.
- Type:
- vcas_state_variables
The VCAS state with respect to the ownship.
- Type:
- property triggers_nmac: bool
Whether the intruder triggers a near mid-air collision for the ownship.
A near mid-air collision (NMAC) is defined as a loss of separation between two aircraft that endangers the safety of the aircraft involved. The boundary for a NMAC is defined as 500 ft horizontally and 100 ft vertically.
- Returns:
Whether the intruder triggers a NMAC.
- Return type:
- hcas_advisory: HCASAdvisories
- vcas_advisory: VCASAdvisories
- hcas_state_variables: HCASStateVariables
- vcas_state_variables: VCASStateVariables
- class pycasx.acas.ACASXProtocol
Bases:
ProtocolProtocol for an ACAS X model.
Provides crucial typing info for the mixin classes.
- evaluate(model_name, inputs)
Evaluate a CAS model.
- Parameters:
model_name (str) – Name of the model to evaluate from the model dictionary.
inputs (npt.NDArray[np.float32]) – The inputs to the model.
- Returns:
The outputs of the model.
- Return type:
npt.NDArray[np.float32]
- Raises:
NotImplementedError – Raised if the requested backend is not implemented.
- class pycasx.acas.AdvisoryDict
Bases:
typing_extensions.TypedDictThe advisory dictionary.
- class pycasx.acas.SystemInfo
Bases:
typing_extensions.TypedDictThe information about a CAS system.
- advisory
The advisory information.
- Type:
- advisory: AdvisoryDict
- connector: Literal[adsb]
- class pycasx.acas.RootInfo
Bases:
typing_extensions.TypedDictThe information all CAS systems.
- hcas
The HCAS information.
- Type:
- vcas
The VCAS information.
- Type:
- hcas: SystemInfo
- vcas: SystemInfo
- class pycasx.acas.APIHCASStateVariables
The state variables of the HCAS model.
- s_adv
previous advisory.
- Type:
- s_adv: HCASAdvisories
- class pycasx.acas.APIVCASStateVariables
The state variables of the VCAS model.
- s_adv
previous advisory.
- Type:
- s_adv: VCASAdvisories
- class pycasx.acas.AutoavoidInfo
An extended aircraft representation including the current timestamp.
- mode
The autoavoid mode to use.
- Type:
Optional[Literal[“hcas”, “vcas”]]
- class pycasx.acas.ExtendedAircraft
An extended aircraft representation including the current timestamp.
- class pycasx.acas.ExtendedIntruder
An extended intruder representation relying also on advisory data.
- hcas_advisory
The HCAS advisory.
- Type:
- vcas_advisory
The VCAS advisory.
- Type:
- hcas_state_variables
The HCAS state with respect to the ownship.
- Type:
- vcas_state_variables
The VCAS state with respect to the ownship.
- Type:
- aircraft: ExtendedAircraft
- hcas_advisory: HCASAdvisories
- vcas_advisory: VCASAdvisories
- hcas_state_variables: APIHCASStateVariables
- vcas_state_variables: APIVCASStateVariables