Skip to main content

Python port of DVOACAP HF propagation prediction engine with 86.6% validation accuracy and 2.3x performance boost

Project description

DVOACAP-Python ๐Ÿ“ก

Python port of DVOACAP (Digital Voice of America Coverage Analysis Program) - An HF radio propagation prediction engine

License: MIT Python Version Version Status Validation Performance CI

๐ŸŽฏ About

DVOACAP-Python is a modern Python port of the DVOACAP HF propagation prediction engine, originally written in Delphi/Pascal by Alex Shovkoplyas (VE3NEA). This project aims to provide an accessible, well-documented, and maintainable Python implementation of the VOACAP ionospheric propagation model.

Original DVOACAP by: Alex Shovkoplyas, VE3NEA Python Port: Production Ready (v1.0.1, November 2025) - 2.3x faster than v1.0.0

โšก Quick Start

Installation

Choose the installation option that fits your needs:

Option 1: Core Library Only (lightweight, for developers)

# Clone the repository
git clone https://github.com/skyelaird/dvoacap-python.git
cd dvoacap-python

# Install just the propagation engine
pip install -e .

Option 2: With Dashboard (includes Flask server and web UI)

# Clone the repository
git clone https://github.com/skyelaird/dvoacap-python.git
cd dvoacap-python

# Install library + dashboard dependencies
pip install -e ".[dashboard]"

Option 3: Development Setup (includes testing tools)

# Clone the repository
git clone https://github.com/skyelaird/dvoacap-python.git
cd dvoacap-python

# Install everything
pip install -e ".[all]"

What's Included

Installation Core Library Dashboard Dev Tools
pip install -e . โœ… โŒ โŒ
pip install -e ".[dashboard]" โœ… โœ… โŒ
pip install -e ".[dev]" โœ… โŒ โœ…
pip install -e ".[all]" โœ… โœ… โœ…

Basic Usage

from dvoacap import FourierMaps, ControlPoint, IonoPoint, compute_iono_params
import math

# Load CCIR/URSI ionospheric maps
maps = FourierMaps()
maps.set_conditions(month=6, ssn=100, utc_fraction=0.5)  # June, SSN=100, noon UTC

# Create control point at Philadelphia
pnt = ControlPoint(
    location=IonoPoint.from_degrees(40.0, -75.0),
    east_lon=-75.0 * math.pi/180,
    distance_rad=0.0,
    local_time=0.5,  # Noon local
    zen_angle=0.3,   # Solar zenith angle
    zen_max=1.5,
    mag_lat=50.0 * math.pi/180,
    mag_dip=60.0 * math.pi/180,
    gyro_freq=1.2
)

# Compute ionospheric parameters
compute_iono_params(pnt, maps)

print(f"E layer:  foE  = {pnt.e.fo:.2f} MHz at {pnt.e.hm:.0f} km")
print(f"F1 layer: foF1 = {pnt.f1.fo:.2f} MHz at {pnt.f1.hm:.0f} km")
print(f"F2 layer: foF2 = {pnt.f2.fo:.2f} MHz at {pnt.f2.hm:.0f} km")

See examples/ for more detailed usage examples.

๐Ÿ“Š Interactive Dashboard

DVOACAP-Python includes a web-based dashboard for visualizing propagation predictions, DXCC tracking, and real-time band conditions.

Features

  • ๐ŸŒ Interactive Propagation Map - Visual display of MUF predictions across DX entities
  • ๐Ÿ“ˆ Band Condition Meters - Real-time signal quality indicators for 160m-10m
  • ๐Ÿ† DXCC Progress Tracking - Monitor worked/confirmed entities by band and mode
  • โšก On-Demand Predictions - One-click refresh with Flask server backend
  • ๐Ÿ“ก Live Space Weather Data - Real-time Kp/A-index, solar flux, and sunspot numbers from NOAA SWPC with international fallback sources
  • ๐ŸŽจ Responsive Design - Works on desktop and mobile devices

Quick Start with Dashboard

Option A: Flask Server (Recommended)

cd Dashboard
pip install -r requirements.txt
python3 server.py

# Visit http://localhost:8000
# Click "โšก Refresh Predictions" button to generate new predictions

The Flask server provides:

  • API endpoints for prediction generation (/api/generate)
  • Real-time progress monitoring (/api/status)
  • Background processing (non-blocking)
  • Automatic dashboard reload when complete

Option B: Static Files

cd Dashboard
python3 generate_predictions.py
open dashboard.html

Configuration

Edit Dashboard/dvoacap_wrapper.py to customize:

  • Your callsign and QTH coordinates
  • Station power and antenna characteristics
  • Target bands and DX entities
  • Update frequency

Dashboard Documentation

See Dashboard/README.md for complete setup instructions, configuration options, and API documentation.

Future Plans

See Dashboard/ISSUE_MULTI_USER_WEB_APP.md for the roadmap to expand the dashboard into a multi-user community service with:

  • User authentication and accounts
  • Per-user station configurations
  • Database backend for historical tracking
  • Public API endpoints
  • Mobile app integration
  • Community propagation reporting

๐Ÿ“Š Project Status

Status: v1.0.1 Production Release - 86.6% validation accuracy across 11 diverse test paths, 2.3x performance improvement

โœ… Completed Modules

  • Phase 1: Path Geometry โœ“

    • Great circle calculations
    • Geodetic/geocentric conversions
    • Path midpoint calculations
    • Bearing calculations
    • Source: PathGeom.pas
  • Phase 2: Solar & Geomagnetic โœ“

    • Solar zenith angle calculations
    • Local time conversions
    • Magnetic field model (IGRF)
    • Gyrofrequency calculations
    • Source: Sun.pas, MagFld.pas
  • Phase 3: Ionospheric Profiles โœ“

    • CCIR/URSI coefficient models
    • E/F/F1/Es layer critical frequencies
    • Layer height modeling
    • Electron density profiles
    • Ionogram generation
    • True and virtual height calculations
    • Source: IonoProf.pas, LayrParm.pas, FrMaps.pas
  • Phase 4: Raytracing โœ“

    • MUF (Maximum Usable Frequency) calculations
    • FOT and HPF calculations
    • Ray path calculations (reflectrix)
    • Skip distance computation
    • Multi-hop path finding
    • Over-the-MUF mode handling
    • Source: Reflx.pas, MufCalc.pas
  • Phase 5: Signal Predictions โœ“

    • โœ“ Noise modeling (atmospheric, galactic, man-made)
    • โœ“ Antenna gain calculations
    • โœ“ Prediction engine framework
    • โœ“ Full end-to-end integration
    • โœ“ 86.6% validation pass rate across 11 diverse test cases
    • โœ“ Real-world validation with PSKReporter/WSPR integration
    • Source: VoaCapEng.pas, AntGain.pas, NoiseMdl.pas

โšก Performance (v1.0.1)

  • 2.3x faster than v1.0.0 - Comprehensive algorithmic optimizations
    • Single prediction: 0.008s โ†’ 0.004s (2x faster)
    • Multi-frequency (9 predictions): 0.111s โ†’ 0.048s (2.3x faster)
    • 24-hour scan: 0.282s โ†’ 0.118s (2.4x faster)
    • Area coverage (100 predictions): 0.82s โ†’ 0.35s (2.3x faster)
    • Function call reduction: 68-71% fewer calls

Optimizations:

  • Binary search for height-to-density interpolation (O(n) โ†’ O(log n))
  • NumPy vectorization in Gaussian integration (eliminated 40-iteration loop)
  • Vectorized oblique frequency computation (eliminated 1,200 nested iterations)
  • Optimized Fourier series with NumPy dot products

๐Ÿ“… Planned

  • PyPI public release - Package ready (v1.0.1), pending publication decision
  • Comprehensive type hints - Add type annotations throughout codebase
  • Sphinx API documentation - Complete API reference with examples
  • Community engagement - Forum presence, user support, integration examples

๐Ÿ“š Documentation

User Guides

Technical Documentation

Building Sphinx Documentation

The project includes comprehensive Sphinx documentation with API references. To build it:

Prerequisites:

pip install sphinx sphinx-rtd-theme

Build on Linux/macOS:

cd docs
make html

Build on Windows:

Option 1 - Using the batch file (PowerShell or CMD):

cd docs
.\make.bat html

Option 2 - Using the PowerShell script:

cd docs
.\make.ps1 html

Option 3 - Using sphinx-build directly:

cd docs
sphinx-build -M html source build

The built documentation will be in docs/build/html/index.html.

See docs/README.md for more details.

๐Ÿงช Testing

# Run all tests
pytest tests/

# Run specific test file
pytest tests/test_path_geometry.py -v

# Run with coverage
pytest --cov=dvoacap tests/

๐Ÿ“ฆ Package Structure

dvoacap-python/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ dvoacap/                    # Main Python package
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ”œโ”€โ”€ path_geometry.py        # Phase 1
โ”‚   โ”‚   โ”œโ”€โ”€ solar.py                # Phase 2
โ”‚   โ”‚   โ”œโ”€โ”€ geomagnetic.py          # Phase 2
โ”‚   โ”‚   โ”œโ”€โ”€ fourier_maps.py         # Phase 3
โ”‚   โ”‚   โ”œโ”€โ”€ ionospheric_profile.py  # Phase 3
โ”‚   โ”‚   โ”œโ”€โ”€ layer_parameters.py     # Phase 3
โ”‚   โ”‚   โ”œโ”€โ”€ muf_calculator.py       # Phase 4
โ”‚   โ”‚   โ””โ”€โ”€ reflectrix.py           # Phase 4
โ”‚   โ””โ”€โ”€ original/                   # Reference Pascal source
โ”‚       โ””โ”€โ”€ *.pas
โ”œโ”€โ”€ Dashboard/                      # Web-based visualization dashboard
โ”‚   โ”œโ”€โ”€ server.py                   # Flask API server
โ”‚   โ”œโ”€โ”€ dashboard.html              # Interactive dashboard UI
โ”‚   โ”œโ”€โ”€ generate_predictions.py     # Prediction generation script
โ”‚   โ”œโ”€โ”€ dvoacap_wrapper.py          # DVOACAP integration wrapper
โ”‚   โ”œโ”€โ”€ requirements.txt            # Server dependencies
โ”‚   โ”œโ”€โ”€ README.md                   # Dashboard documentation
โ”‚   โ””โ”€โ”€ ISSUE_MULTI_USER_WEB_APP.md # Multi-user service roadmap
โ”œโ”€โ”€ tests/                          # Test suite
โ”‚   โ”œโ”€โ”€ test_path_geometry.py
โ”‚   โ”œโ”€โ”€ test_voacap_parser.py
โ”‚   โ””โ”€โ”€ test_ionospheric.py
โ”œโ”€โ”€ examples/                       # Usage examples
โ”‚   โ”œโ”€โ”€ integration_example.py
โ”‚   โ”œโ”€โ”€ phase2_integration_example.py
โ”‚   โ”œโ”€โ”€ phase3_ionospheric_example.py
โ”‚   โ””โ”€โ”€ phase4_raytracing_example.py
โ”œโ”€โ”€ docs/                           # Documentation
โ”‚   โ”œโ”€โ”€ USAGE.md
โ”‚   โ”œโ”€โ”€ INTEGRATION.md
โ”‚   โ””โ”€โ”€ *.pdf
โ”œโ”€โ”€ DVoaData/                       # CCIR/URSI coefficient data
โ””โ”€โ”€ SampleIO/                       # Sample input/output files

๐ŸŽ“ Technical Background

What is VOACAP?

VOACAP (Voice of America Coverage Analysis Program) is a professional-grade HF propagation prediction tool based on decades of ionospheric research. It predicts:

  • Maximum Usable Frequency (MUF) - Highest frequency that will refract back to Earth
  • Signal Strength - Expected field strength at receiver
  • Reliability - Probability of successful communication
  • Path Geometry - Ray paths through the ionosphere

Why Python?

The original VOACAP is written in Fortran (1970s) and DVOACAP modernized it in Delphi/Pascal. This Python port aims to:

  • โœ… Make the code accessible to modern developers
  • โœ… Provide clear documentation and examples
  • โœ… Enable integration with Python scientific stack (NumPy, SciPy, Matplotlib)
  • โœ… Facilitate research and experimentation
  • โœ… Maintain numerical accuracy of the original

๐Ÿ”ฌ Validation

Component-Level Validation โœ…

Individual modules validated against original VOACAP/DVOACAP:

  • Path Geometry: < 0.01% distance error, < 0.01ยฐ bearing error
  • Solar Calculations: < 0.01ยฐ zenith angle error
  • Geomagnetic Model: < 0.1ยฐ magnetic latitude error
  • Ionospheric Profiles: CCIR/URSI maps verified against reference data

End-to-End Accuracy Validation ๐Ÿ”ฌ

Reference VOACAP Comparison:

# Compare predictions against original VOACAP output
python3 test_voacap_reference.py

Validates full propagation predictions (SNR, reliability, MUF) against reference files from the original VOACAP engine. This ensures the integrated system produces accurate results, not just plausible-looking numbers.

Functional Testing:

# Verify engine produces valid output without crashing
python3 validate_predictions.py

Tests that predictions execute successfully and produce values in reasonable ranges across representative propagation paths.

See VALIDATION_STRATEGY.md for detailed validation methodology, test coverage status, and guidelines for interpreting results.

๐Ÿค Contributing

Contributions are welcome! This is a large project with many modules still to port.

Areas needing help:

  • Porting remaining Pascal modules
  • Adding more comprehensive tests
  • Improving documentation
  • Performance optimization
  • Validation against reference data

See CONTRIBUTING.md for guidelines.

๐Ÿ“– References

Original Projects

Scientific Background

  • ITU-R P.533: HF propagation prediction method
  • CCIR Report 340: Ionospheric characteristics
  • IPS Radio and Space Services documentation

๐Ÿ“„ License

MIT License - See LICENSE for details

Original DVOACAP License: Mozilla Public License Version 1.1

๐Ÿ™ Acknowledgments

  • Alex Shovkoplyas (VE3NEA) - Original DVOACAP implementation
  • Voice of America / ITS - Original VOACAP development
  • Amateur radio and propagation modeling community

๐Ÿ“ง Contact


Note: This is an active development project. The API may change as we progress through implementation phases. Star โญ the repository to follow progress!

Amateur Radio Operators: This tool is designed for HF propagation prediction to help you make better contacts! ๐Ÿ“ป 73!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dvoacap-1.0.1.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dvoacap-1.0.1-py3-none-any.whl (543.5 kB view details)

Uploaded Python 3

File details

Details for the file dvoacap-1.0.1.tar.gz.

File metadata

  • Download URL: dvoacap-1.0.1.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dvoacap-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d088a0c5cdd73a007c46ac1d8fdc9da00032d39a2dbb57517664f4dd387555f7
MD5 32fcb89bcbe2a99fb95704c5950cbf2f
BLAKE2b-256 c676bb47c956e8b55e734806767b0cad2d3e6e7a04da372da7906d5a7f84546e

See more details on using hashes here.

Provenance

The following attestation bundles were made for dvoacap-1.0.1.tar.gz:

Publisher: publish.yml on skyelaird/dvoacap-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dvoacap-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: dvoacap-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 543.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dvoacap-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d3f35bf623ef3501b9fa878d223160168cb6017617c9aac61c0c9959320ca1bf
MD5 22eb39640e833fa41d69ec2073af8ec8
BLAKE2b-256 6eb1aed923054c790296775f638a002a25193b69b2ea5e3ba2fdfa942606d3e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for dvoacap-1.0.1-py3-none-any.whl:

Publisher: publish.yml on skyelaird/dvoacap-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page