Defining Element

This notebook demonstrates to a user how one may define an element beam pattern as a function of azimuth and elevation gain.

Natively Supported element patterns include: Cosine, Custom, Gaussian, Isotropic and Sinc

Imports

[1]:
%load_ext autoreload
%autoreload 2

from radar.components import Element
from radar.components.response import FrequencyResponse
from radar.utils.calculate import pattern
from radar.utils.typing import (
    AmplitudeDomain,
    Angle,
    AmplitudeUnit,
    PhaseUnit,
    DirectionDomain,
    FigureType,
    DataHeader,
)

import polars as pl

Element: Gaussian Beam Pattern

Here we show how a user may define an element Gaussian beam pattern as a function

Define the Element

[2]:
from radar.utils.typing.enums import FrequencyUnit
from radar.utils.typing.units import Frequency

# Define the operation frequencu or frequencies for the element
freq = Frequency(1, FrequencyUnit.GIGAHERTZ)

# Define what element pattern one wishes to use
beam_width = 25
beam_width_tuple = (
    Angle(beam_width, PhaseUnit.DEGREE),
    Angle(beam_width, PhaseUnit.DEGREE),
)
element_pattern = pattern.Gaussian(beam_width_tuple)

# Define the bounds on which the beam pattern exists
az_bound = 90
el_bound = 90
az_bound_tuple = (Angle(-az_bound, PhaseUnit.DEGREE), Angle(az_bound, PhaseUnit.DEGREE))
el_bound_tuple = (Angle(-el_bound, PhaseUnit.DEGREE), Angle(el_bound, PhaseUnit.DEGREE))

# Now create the element using the pattern, beam bounds and operation frequency
antenna_element = Element(element_pattern, az_bound_tuple, el_bound_tuple, freq)

View the Element (Azimuth and Elevation Space)

Surface

[3]:
antenna_element.plot.beam(
    DirectionDomain.UV,
    PhaseUnit.DEGREE,
    AmplitudeDomain.Gain,
    AmplitudeUnit.DECIBEL,
    FigureType.SURFACE,
    freq,
)

Image

[4]:
antenna_element.plot.beam(
    DirectionDomain.UV,
    PhaseUnit.DEGREE,
    AmplitudeDomain.Gain,
    AmplitudeUnit.DECIBEL,
    FigureType.IMAGE,
    freq,
)

Slices

[5]:
antenna_element.plot.beam(
    DirectionDomain.UV,
    PhaseUnit.DEGREE,
    AmplitudeDomain.Gain,
    AmplitudeUnit.DECIBEL,
    FigureType.SLICE,
    freq,
)

Element: Sinc Beam Pattern

Here we show how a user may define an element Gaussian beam pattern as a function

[6]:
beam_width = 15
beam_width_tuple = (
    Angle(beam_width, PhaseUnit.DEGREE),
    Angle(beam_width, PhaseUnit.DEGREE),
)
element_pattern = pattern.Sinc(beam_width_tuple)

az_bound = 90
el_bound = 90
az_bound_tuple = (Angle(-az_bound, PhaseUnit.DEGREE), Angle(az_bound, PhaseUnit.DEGREE))
el_bound_tuple = (Angle(-el_bound, PhaseUnit.DEGREE), Angle(el_bound, PhaseUnit.DEGREE))

antenna_element = Element(element_pattern, az_bound_tuple, el_bound_tuple, freq, 1)

View the Element (UV Space)

Surface

[7]:
antenna_element.plot.beam(
    DirectionDomain.ANGLE,
    PhaseUnit.DEGREE,
    AmplitudeDomain.Gain,
    AmplitudeUnit.DECIBEL,
    FigureType.SURFACE,
    freq,
)

Image

[8]:
antenna_element.plot.beam(
    DirectionDomain.ANGLE,
    PhaseUnit.DEGREE,
    AmplitudeDomain.Gain,
    AmplitudeUnit.DECIBEL,
    FigureType.IMAGE,
    freq,
)

Slices

[9]:
antenna_element.plot.beam(
    DirectionDomain.ANGLE,
    PhaseUnit.DEGREE,
    AmplitudeDomain.Gain,
    AmplitudeUnit.DECIBEL,
    FigureType.SLICE,
    freq,
)

Defining an Element With a Frequency Response

Defining Operational Frequency Range

Where we specify the frequency of operation and the corresponding attantuation relative to 0dB

[10]:
f1 = Frequency(1, FrequencyUnit.GIGAHERTZ)
f2 = Frequency(2, FrequencyUnit.GIGAHERTZ)
df = pl.DataFrame(
    {DataHeader.FREQ_GAIN_DB: [0, -50], DataHeader.FREQ_FREQS: [f1.Hz, f2.Hz]}
)

fr = FrequencyResponse(df=df)

Defining Element

[11]:
beam_width = 15
az_bound = 90
el_bound = 90

beam_width_tuple = (
    Angle(beam_width, PhaseUnit.DEGREE),
    Angle(beam_width, PhaseUnit.DEGREE),
)
element_pattern = pattern.Sinc(beam_width_tuple)
az_bound_tuple = (Angle(-az_bound, PhaseUnit.DEGREE), Angle(az_bound, PhaseUnit.DEGREE))
el_bound_tuple = (Angle(-el_bound, PhaseUnit.DEGREE), Angle(el_bound, PhaseUnit.DEGREE))

antenna_element = Element(element_pattern, az_bound_tuple, el_bound_tuple, fr, 1)

Frequency Responses

Notice the maximum values of both responses and how the differ

[12]:
antenna_element.plot.beam(
    DirectionDomain.ANGLE,
    PhaseUnit.DEGREE,
    AmplitudeDomain.Gain,
    AmplitudeUnit.DECIBEL,
    FigureType.SURFACE,
    f1,
)

antenna_element.plot.beam(
    DirectionDomain.ANGLE,
    PhaseUnit.DEGREE,
    AmplitudeDomain.Gain,
    AmplitudeUnit.DECIBEL,
    FigureType.SURFACE,
    f2,
)
[ ]: