Architecture API¶
System configuration classes for defining phased array architectures.
Overview¶
from phased_array_systems.architecture import (
Architecture,
ArrayConfig,
RFChainConfig,
CostConfig,
)
Classes¶
ArrayConfig
¶
Bases: BaseModel
Configuration for the antenna array geometry.
| ATTRIBUTE | DESCRIPTION |
|---|---|
geometry |
Array geometry type
TYPE:
|
nx |
Number of elements in x-direction
TYPE:
|
ny |
Number of elements in y-direction
TYPE:
|
dx_lambda |
Element spacing in x-direction (wavelengths)
TYPE:
|
dy_lambda |
Element spacing in y-direction (wavelengths)
TYPE:
|
scan_limit_deg |
Maximum scan angle from boresight (degrees)
TYPE:
|
max_subarray_nx |
Maximum elements per sub-array in x (must be power of 2)
TYPE:
|
max_subarray_ny |
Maximum elements per sub-array in y (must be power of 2)
TYPE:
|
enforce_subarray_constraint |
Whether to enforce power-of-two sub-array constraint
TYPE:
|
validate_power_of_two
classmethod
¶
Validate that max sub-array dimensions are powers of two.
Source code in src/phased_array_systems/architecture/config.py
validate_subarray_constraints
¶
validate_subarray_constraints() -> ArrayConfig
Validate that array dimensions result in power-of-two sub-arrays.
Source code in src/phased_array_systems/architecture/config.py
RFChainConfig
¶
Bases: BaseModel
Configuration for the RF chain.
| ATTRIBUTE | DESCRIPTION |
|---|---|
tx_power_w_per_elem |
Transmit power per element (Watts)
TYPE:
|
pa_efficiency |
Power amplifier efficiency (0-1)
TYPE:
|
noise_figure_db |
Receiver noise figure (dB)
TYPE:
|
n_tx_beams |
Number of simultaneous transmit beams
TYPE:
|
feed_loss_db |
Feed network loss (dB)
TYPE:
|
system_loss_db |
Additional system losses (dB)
TYPE:
|
CostConfig
¶
Bases: BaseModel
Configuration for cost modeling.
| ATTRIBUTE | DESCRIPTION |
|---|---|
cost_per_elem_usd |
Recurring cost per element (USD)
TYPE:
|
nre_usd |
Non-recurring engineering cost (USD)
TYPE:
|
integration_cost_usd |
System integration cost (USD)
TYPE:
|
Architecture
¶
Bases: BaseModel
Complete system architecture configuration.
This is the top-level configuration object that contains all subsystem configurations.
| ATTRIBUTE | DESCRIPTION |
|---|---|
array |
Antenna array configuration
TYPE:
|
rf |
RF chain configuration
TYPE:
|
cost |
Cost model configuration
TYPE:
|
name |
Optional name for this architecture
TYPE:
|
model_dump_flat
¶
Return a flattened dictionary of all configuration values.
Useful for DOE case generation where we need flat parameter names.
Source code in src/phased_array_systems/architecture/config.py
from_flat
classmethod
¶
from_flat(flat_dict: dict) -> Architecture
Create an Architecture from a flattened dictionary.
| PARAMETER | DESCRIPTION |
|---|---|
flat_dict
|
Dictionary with keys like "array.nx", "rf.tx_power_w_per_elem"
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Architecture
|
Architecture instance |
Source code in src/phased_array_systems/architecture/config.py
Helper Functions¶
is_power_of_two
¶
Constants¶
# Valid sub-array dimensions (powers of 2)
VALID_POWERS_OF_TWO = [2, 4, 8, 16, 32, 64, 128, 256, 512]
Usage Examples¶
Basic Architecture¶
from phased_array_systems.architecture import (
Architecture, ArrayConfig, RFChainConfig, CostConfig
)
arch = Architecture(
array=ArrayConfig(nx=8, ny=8, dx_lambda=0.5, dy_lambda=0.5),
rf=RFChainConfig(tx_power_w_per_elem=1.0, pa_efficiency=0.3),
cost=CostConfig(cost_per_elem_usd=100.0),
name="Baseline Design",
)
print(f"Elements: {arch.n_elements}")
print(f"Sub-arrays: {arch.array.n_subarrays}")
Flattening for DOE¶
# Convert to flat dictionary
flat = arch.model_dump_flat()
# {'array.nx': 8, 'array.ny': 8, 'array.dx_lambda': 0.5, ...}
# Reconstruct from flat dictionary
arch2 = Architecture.from_flat(flat)
Validation Examples¶
# This raises ValidationError - nx must be >= 1
ArrayConfig(nx=0, ny=8)
# This raises ValidationError - efficiency must be 0-1
RFChainConfig(tx_power_w_per_elem=1.0, pa_efficiency=1.5)
# This raises ValidationError - not power of 2
ArrayConfig(nx=6, ny=6, enforce_subarray_constraint=True)
# This works - constraint disabled
ArrayConfig(nx=6, ny=6, enforce_subarray_constraint=False)