radar.utils.calculate.pattern

Module Contents

Classes

Pattern

Abstract base class defining the required interface for radar beam patterns.

CustomPattern

A customizable data-driven antenna pattern built from empirical lookup data.

Isotropic

An ideal isotropic antenna pattern radiating uniformly with 0 dB gain.

Cosine

A hemispherical cosine-power beam pattern model.

Gaussian

A mathematical Gaussian distribution beam pattern model.

Sinc

An analytical Sinc (cardinal sine) distribution beam pattern model.

API

class radar.utils.calculate.pattern.Pattern[source]

Bases: abc.ABC

Abstract base class defining the required interface for radar beam patterns.

abstractmethod calculate_pattern(df: polars.DataFrame) polars.DataFrame[source]

Calculates the pattern’s gain metrics and appends them to the DataFrame.

Args:

df (pl.DataFrame): The input spatial coordinate dataset.

Returns:

pl.DataFrame: The modified DataFrame including linear and dB gains.

__slots__ = ()
class radar.utils.calculate.pattern.CustomPattern(df: polars.DataFrame)[source]

Bases: radar.utils.calculate.pattern.Pattern

A customizable data-driven antenna pattern built from empirical lookup data.

Attributes:

df (pl.DataFrame): The underlying reference pattern dataset.

Initialization

Initializes the CustomPattern lookup table and calculates boundaries.

Args:
df (pl.DataFrame): Dataframe containing the reference pattern mapping.

Must include azimuth, elevation, and linear gain columns.

Raises:

ValueError: If any required configuration headers are missing.

_validate_presence(df: polars.DataFrame, columns: list[str]) None[source]

Internal helper to ensure columns exist before executing operations.

Args:

df (pl.DataFrame): Target Polars DataFrame to inspect. columns (list[str]): List of expected column names.

Raises:

ValueError: If one or more columns are not present in the dataframe.

calculate_pattern(df: polars.DataFrame) polars.DataFrame[source]

Maps input coordinates against the custom reference pattern.

Performs strict shape, coordinate, and boundary matches before executing an inner join to assign calculated gains to incoming data rows.

Args:

df (pl.DataFrame): The spatial grid coordinates to compute patterns for.

Returns:

pl.DataFrame: Joined dataframe incorporating historical reference gains.

Raises:
ValueError: If required headers are missing, coordinate boundaries

do not match, or coordinates are missing from the lookup reference.

__slots__ = ()
class radar.utils.calculate.pattern.Isotropic[source]

Bases: radar.utils.calculate.pattern.Pattern

An ideal isotropic antenna pattern radiating uniformly with 0 dB gain.

calculate_pattern(df: polars.DataFrame) polars.DataFrame[source]

Appends static isotropic gains (0 dB / 1.0 Linear) to the DataFrame.

Args:

df (pl.DataFrame): Input dataset.

Returns:

pl.DataFrame: Modified DataFrame with uniform gain entries.

__slots__ = ()
class radar.utils.calculate.pattern.Cosine(order: int = 1)[source]

Bases: radar.utils.calculate.pattern.Pattern

A hemispherical cosine-power beam pattern model.

Initialization

Initializes the Cosine model with a mathematical scaling power factor.

Args:
order (int, optional): The exponential factor modifying the cosine window.

Higher values yield narrower main beams. Defaults to 1.

calculate_pattern(df: polars.DataFrame) polars.DataFrame[source]

Calculates directional cosine gains relative to boresight at (0,0).

Args:

df (pl.DataFrame): Input dataset containing AZIMUTH_RAD and ELEVATION_RAD.

Returns:

pl.DataFrame: Dataset containing appended cosine gain metrics.

__slots__ = ()
class radar.utils.calculate.pattern.Gaussian(beam_width: Tuple[radar.utils.typing.Angle, radar.utils.typing.Angle])[source]

Bases: radar.utils.calculate.pattern.Pattern

A mathematical Gaussian distribution beam pattern model.

Initialization

Initializes the Gaussian pattern with designated half-power beamwidths.

Args:
beam_width (Tuple[Angle, Angle]): Target sizing bounds configured as

(Azimuth HPBW, Elevation HPBW).

calculate_pattern(df: polars.DataFrame) polars.DataFrame[source]

Calculates normal Gaussian scaling gains across spatial dimensions.

Args:

df (pl.DataFrame): Input dataset containing AZIMUTH_RAD and ELEVATION_RAD.

Returns:

pl.DataFrame: Dataset containing appended Gaussian gain metrics.

__slots__ = ()
class radar.utils.calculate.pattern.Sinc(beam_width: Tuple[radar.utils.typing.Angle, radar.utils.typing.Angle])[source]

Bases: radar.utils.calculate.pattern.Pattern

An analytical Sinc (cardinal sine) distribution beam pattern model.

Initialization

Initializes the Sinc pattern with designated half-power beamwidths.

Args:
beam_width (Tuple[Angle, Angle]): Target sizing bounds configured as

(Azimuth HPBW, Elevation HPBW).

calculate_pattern(df: polars.DataFrame) polars.DataFrame[source]

Calculates structural Sinc gains representing uniform aperture characteristics.

Args:

df (pl.DataFrame): Input dataset containing AZIMUTH_RAD and ELEVATION_RAD.

Returns:

pl.DataFrame: Dataset containing appended Sinc gain metrics.

__slots__ = ()