Skip to content

Ericsson/eas-3d-pattern

Repository files navigation

eas-3d-pattern

PyPI version PyPI - Python Version PyPI - License CI Ruff

A Python library for visualizing and computing beam efficiency on 3D antenna radiation patterns conforming to the NGMN BASTA JSON schema.


What is this?

Given a 3D radiation pattern in JSON format which follows the NGMN BASTA (Base Station Antenna Standards) specification, with this library you can:

  • Parse the BASTA-compliant JSON, handles multiple coordinate systems and sampling formats automatically
  • Calculate beam efficiency across configurable sectors (EAS methodology)
  • Visualize patterns as 2D heatmaps and 3D polar plots

Installation

pip install eas-3d-pattern
Development installation
git clone https://github.com/Ericsson/eas-3d-pattern.git
cd eas-3d-pattern
poetry install

Run tests:

poetry run pytest

Lint and format:

poetry run ruff check .
poetry run ruff format .

Quick Start

from eas_3d_pattern import AntennaPattern, SAMPLE_JSON

# Load a 3D radiation pattern from JSON
pattern = AntennaPattern(SAMPLE_JSON[0])

# Inspect antenna parameters
print(f"{pattern.antenna_model} @ {pattern.frequency_hz / 1e6:.0f} MHz — {pattern.gain_dbi:.1f} dBi")
# → ANTMODEL1 @ 2100 MHz — 18.3 dBi

# Calculate beam efficiency (EAS default sectors)
efficiency = pattern.calculate_beam_efficiency()
print(f"Cell sector: {efficiency['Cell'] * 100:.1f}%")
# → Cell sector: 72.4%

# Visualize the normalized power pattern
pattern.plot()

Antenna pattern heatmap

Features

Feature Description
Multi-format parsing Accepts uniform and non-uniform sampling, all NGMN coordinate systems (SPCS_Polar, SPCS_CW, SPCS_CCW, SPCS_Geo)
Schema validation Optional validation against the official NGMN BASTA JSON Schema
Beam efficiency Compute power distribution across predefined EAS sectors or custom rectangular regions
Custom sectors Define your own analysis regions with arbitrary θ/φ boundaries
Directivity & losses Calculate directivity and estimate ohmic losses from declared gain
Visualization Interactive heatmaps and 3D polar plots
Batch reporting Process a directory of JSON files into a structured Excel report with optional PNG exports

Examples

See the example notebooks for detailed walkthroughs.

Resources

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

About

EAS-3D-Pattern library to visualize and calucluate beam efficency on 3D Pattern data

Topics

Resources

License

Contributing

Security policy

Stars

5 stars

Watchers

2 watching

Forks

Contributors