Antenna results in Python
A solved CENOS RF case holds more answers than the Results Viewer shows: the numbers behind every curve, the far field at any frequency, and enough to work out a link budget, a large array or a report. This page shows how to get them with the CENOS Python package, cenos-py, after the solve. For changing the design from Python (sweeps, tuning, tolerances), see Parameter studies in Python.
Before you start
You need cenos-py 0.3.4 or newer and a solved case. Installation, the trace file and the recommended way of working are on the Python scripting page. Every example below starts like this:
import numpy as np
import cenos_py
case = cenos_py.CenosCaseRF()
case.open(r"C:\cases\dualband_ifa") # a case you solved in the GUI
The examples use cases from our application pages: a dual-band printed inverted-F antenna for 800 and 1700 MHz, a UHF RFID label and a 2.45 GHz patch antenna.

Port results
Everything the Results Viewer shows for a port is in case.results, as one value per solved frequency. Wrap them in np.ravel to get plain numpy arrays.
| Function | Returns | Unit |
|---|---|---|
get_frequency() |
solved frequencies | Hz |
get_s_parameter("S11") |
S-parameter magnitude, S11 to S44 | dB |
get_s_parameter_phase("S21") |
S-parameter phase | deg |
get_s_parameter_active(port) |
active reflection of a port, all ports on (arrays) | dB |
get_impedance(port) |
input impedance | Ω |
get_resistance(port), get_reactance(port) |
real and imaginary part | Ω |
get_reflection_coefficient(port), get_VSWR(port) |
match | – |
get_accepted_power(port), get_radiated_power(port) |
power into the port, power radiated | W |
get_dielectric_losses(entity, port) |
loss in a dielectric body, or “Total” | W |
get_lumped_element_losses(element, port) |
loss in a lumped element | W |
get_power_imbalance(port) |
power balance check | – |
Each function has a docstring with its unit, so your editor shows it while you type.
r = case.results
f = np.ravel(r.get_frequency())
s11 = np.ravel(r.get_s_parameter("S11"))
accepted = np.ravel(r.get_accepted_power())
radiated = np.ravel(r.get_radiated_power())
fr4 = np.ravel(r.get_dielectric_losses("Total"))
i = np.argmin(s11)
print(f"dip {f[i] / 1e6:.0f} MHz, {s11[i]:.1f} dB")
print(f"radiated {radiated[i] / accepted[i]:.0%}, in the board {fr4[i] / accepted[i]:.1%}")
matched = f[s11 <= -10] # -10 dB band (one band only)
print(f"-10 dB from {matched.min() / 1e6:.0f} to {matched.max() / 1e6:.0f} MHz")
For the dual-band antenna this gives:
| Band | S11 dip | −10 dB band | Radiated / accepted |
|---|---|---|---|
| Low | 797 MHz, −22.1 dB | 783–811 MHz | 80 % |
| High | 1705 MHz, −32.9 dB | 1655–1754 MHz | 85 % |

Conductor losses are not in case.results yet. You can read every stored result, including “Conductor losses (port 1)”, by name with the report helper below (available_results()).
Theory: from impedance to efficiency
With the port impedance Z and the reference Z0 (50 Ω):
Γ = (Z − Z0) / (Z + Z0) reflection coefficient S11 = 20 · log10 |Γ| in dB VSWR = (1 + |Γ|) / (1 − |Γ|) radiation efficiency η_rad = P_radiated / P_accepted total efficiency η_tot = η_rad · (1 − |Γ|²)
−10 dB means 10 % of the power is reflected; −20 dB means 1 %. The accepted power is what is left after the reflection; the losses in the board, the metal and lumped elements take it from there to the radiated power.
Far field
FarField reads the radiation pattern at one frequency. If the case does not hold a far field at that frequency yet, it is calculated from the solved fields on first use, without a new solve.
from cenos_py.tools.rf import FarField
ff = FarField(case, 1700e6)
print(ff.peak_gain, ff.peak_directivity) # dBi, dB
s11 = np.interp(1700e6, np.ravel(case.results.get_frequency()),
np.ravel(case.results.get_s_parameter("S11"))) # dB at the port
print(ff.peak_gain + 10 * np.log10(1 - 10 ** (s11 / 10))) # realized gain, dBi
angles, gain = ff.cut("ZX") # principal cut, degrees and dBi
ff.plot("XY", quantity="directivity") # polar plot with matplotlib
theta, phi, g = ff.sphere("gain") # the whole sphere, shape (theta, phi)
beam = ff.beam() # main beam and largest side lobe
print(beam.beam_angle, beam.beam_gain, beam.lobe_level)
| Member | What it gives |
|---|---|
peak_gain, peak_directivity |
peak values over the sphere, dBi and dB |
cut(plane, quantity) |
a principal-plane cut: “XY”, “ZX” or “YZ”; quantity “gain” or “directivity” |
plot(plane, quantity, ax) |
the same cut as a polar plot |
sphere(quantity) |
theta, phi in degrees and the values on the full sphere |
beam(quantity, front_only) |
a BeamPattern: beam direction and gain, largest side lobe and its level |
For the dual-band antenna, realized gain: 1.4 dBi at 800 MHz and 3.6 dBi at 1700 MHz. It is well matched, so this is within 0.1 dB of the gain.
Theory: directivity, gain and realized gain
directivity D = 4π · U_max / P_radiated gain G = η_rad · D (per accepted power) realized G_r = G · (1 − |Γ|²) (per power offered to the port)
Directivity says how focused the pattern is. Gain also counts the losses in the antenna; realized gain also counts the mismatch. A lossy FR4 board can make gain several dB lower than directivity.

Link budget and read range
Antenna and RFSystem turn a solved antenna into a radio link: received power, field strength and range. Free space only: no walls, ground or multipath.
Antennas
from cenos_py.tools.rf import Antenna, RFSystem, chip_impedance
tag = Antenna.from_case(case) # gain and impedance from a solved case
reader = Antenna(gain_dbi=6.0, impedance=50) # from a datasheet
module = Antenna.from_touchstone("measured.s1p", gain_dbi=2.0) # measured impedance + a gain
Theory: the link budget
RFSystem uses the Friis equation with a mismatch term at each end:
P_rx = P_tx + M_tx + G_tx + G_rx + M_rx + 20·log10(λ / (4π d)) − L all in dB range: d = λ/(4π) · 10^((P_tx + M_tx + G_tx + G_rx + M_rx − L − S) / 20) load match: τ = 4 · R_ant · R_load / |Z_ant + Z_load|², M = 10·log10 τ
For a passive RFID tag the reader also has to hear the reply. That round trip counts the gains twice, so the backscatter range falls off with the fourth root of the budget (Nikitin and Rao, IEEE AP Magazine, 2006). calculate_range returns the shorter of the two when you give return_sensitivity_dbm. The tag chip is the receiver load, not 50 Ω: use chip_impedance(f, R, C) for a parallel R and C.
Range
The example is the UHF RAIN label from our RFID page. The tag is matched to its chip, so the chip is the receiver load: 1.5 kΩ in parallel with 1.2 pF.
f = 866e6
link = RFSystem(reader, tag, frequency=f, receiver_load=chip_impedance(f, 1500, 1.2e-12))
r = link.calculate_range(transmit_power_dbm=29.2, # 2 W ERP with the 6 dBi reader antenna
receiver_sensitivity_dbm=-20, # chip sensitivity
additional_loss_db=3) # circular reader antenna, linear tag
print(f"{r:.1f} m") # 12.3 m
| Method | What it gives |
|---|---|
calculate_range(...) |
the largest distance where the link works, in m. With return_sensitivity_dbm it also works out the backscatter (reader) link and returns the shorter of the two |
calculate_received_power(distance, ...) |
power into the receiver load, dBm, for one distance or an array |
calculate_electric_field(distance, ...) |
incident field strength, V/m |
link_budget(distance, ...) |
every term and margin at one distance; .table() prints it |
calculate_range_vs_angle(plane, ...) |
range for each angle in one plane, from the solved pattern |
calculate_range_over_band(...) |
range at each frequency of a band; .worst_range, .worst_frequency and which link limits it |
from cenos_py.tools.rf import calculate_range_over_band
band = calculate_range_over_band(reader, tag, np.arange(902e6, 928.1e6, 2e6),
transmit_power_dbm=29.2, receiver_sensitivity_dbm=-20,
receiver_load=lambda f: chip_impedance(f, 1500, 1.2e-12),
additional_loss_db=3)
print(band.worst_range, band.worst_frequency)
print(link.link_budget(5.0, transmit_power_dbm=29.2, receiver_sensitivity_dbm=-20).table())
The label reads about 12 m in the European band and 9.6–10.8 m in the US band, where it is tuned less well.

Large arrays from one unit cell
A 64-element array is too big to solve element by element on a desktop. When all elements are the same, CENOS solves one unit cell with periodic boundaries, so the cell sees its neighbours. Set this up on the Periodic array tab in the GUI, or from Python:
case.update_tab_property("periodicArrayTab", "periodicArray", True)
case.update_tab_property("periodicArrayTab", "continuousBase", True) # one large board
case.update_tab_property("periodicArrayTab", "elementsInFirstDirection", 8)
case.update_tab_property("periodicArrayTab", "secondDirection", True)
case.update_tab_property("periodicArrayTab", "elementsInSecondDirection", 8)
case.calculate()
ArrayBeamExplorer then builds the finite array from the solved cell. Steering and tapers are post-processing: each new beam takes seconds.
from cenos_py.tools.rf import ArrayBeamExplorer, FarField, Taper, make_taper
explorer = ArrayBeamExplorer(case)
explorer.steer(2.378e9, theta_deg=30, phi_deg=0)
beam = explorer.measure() # BeamPattern of the last beam
print(beam.beam_angle, beam.beam_gain, beam.lobe_level)
taylor = make_taper(explorer.elements, Taper.TAYLOR, sidelobe_level_db=-30)
explorer.steer(2.378e9, theta_deg=30, phi_deg=0, amplitudes=taylor)
explorer.plot("ZX", quantity="gain")
array_ff = FarField(case, 2.378e9, array=True) # the finite array result, not the unit cell
| Member | What it does |
|---|---|
steer(f, theta_deg, phi_deg, amplitudes) |
beam toward a direction |
calculate_far_field(f, phase_first_deg, phase_second_deg, amplitudes) |
beam from progressive phase steps |
steer_scan(f, thetas_deg, phi_deg), scan(...) |
many beams at once, with beam and side-lobe data per setting |
measure() |
main beam and largest side lobe of the last beam |
plot(plane, quantity) |
polar cut of the array |
grating_lobe_free_angle(f, pitch_m) |
largest steer angle without a grating lobe |
element_counts=(nx, ny) |
try other array sizes from the same cell |
make_taper(shape, Taper.X) |
amplitudes: UNIFORM, HANN, HAMMING, BLACKMAN, TAYLOR, CHEBYSHEV |
The 8 × 8 array of probe-fed 2.45 GHz patches has 18.3 dBi realized gain straight up (22.7 dB directivity; the FR4 board takes most of the difference). Steered to 30° the beam lands at 29° with 17.6 dBi; a Taylor taper lowers the side lobes for another 1.4 dB. The realized gain is the array gain plus the mismatch of the cell’s active S11 (−19.2 dB, so −0.05 dB). Inside the array the neighbours pull the cell’s best match from 2446 to 2378 MHz, which is why an array element is tuned in its array.

ArrayBeamExplorer needs a solved single-port periodic unit-cell case. It does not work on a case with several separate elements.Theory: steering and grating lobes
phase step between neighbours Δφ = 360° · (d / λ) · sin θ0 no grating lobe while sin θ0 ≤ λ / d − 1 directivity of N elements ≈ element directivity + 10·log10 N
d is the element pitch and θ0 the steer angle. At half-wavelength pitch the beam can be steered to 90° without a grating lobe; at 0.7 λ only to about 25°. A taper lowers the side lobes and costs some directivity, because the outer elements do less work.
PDF reports
CENOS has its own case report. When you want your own sections in your own order, or one report for each of twenty variants, CenosPDFReport builds the PDF from a script:
from cenos_py.pdf_report import CenosPDFReport
report = CenosPDFReport("Dual-band IFA, 800 / 1700 MHz", case=case)
print(report.available_results()) # every stored result, with its unit
report.insert_heading("Summary")
report.insert_paragraph("Both bands are matched below <b>-10 dB</b>.")
report.add_result_plot(["S11"], limit=-10, limit_label="-10 dB")
report.add_result_plot(["Resistance (port 1)", "Reactance (port 1)"], title="Input impedance")
report.add_results_table(["S11", "VSWR (port 1)"]) # min and max, and where
report.insert_figure(my_figure, caption="Gain cuts") # any matplotlib figure or image file
report.save("dualband_ifa.pdf")
| Method | Adds |
|---|---|
insert_heading, insert_paragraph |
text; paragraphs accept <b>, <i>, <br/> |
insert_table(rows) |
a table from a list of rows |
insert_figure(source) |
an image file or a matplotlib figure |
add_plot(x, y, ...) |
your own line plot in the report style |
add_result_plot(names, limit) |
a stored result against frequency |
add_table(names), add_results_table(names) |
solved values per step, or their min and max |
insert_space, insert_page_break |
layout |

Examples
The example library that comes with the installer (see Python scripting) has runnable scripts for these tools. To change the design from Python, continue with Parameter studies in Python.
