Skip to main content

cadilib

cadilib is a high-performance Python and Rust library designed for parsing, processing, and analyzing Canadian Advanced Digital Ionosonde (CADI) binary data (.md1, .md2, .md3, .md4) and SAMEER ionogram ASCII data (.iono).

Originally a part of CADI Ionogram Tools, the CADI parsing library is now separate from the GUI.


Features

  • High-Performance Rust Reader (MDreader_rs): Accelerated binary parser compiled as a native PyO3 extension module for maximum throughput.
  • Pure-Python Fallback Reader (MDreader): Complete pure-Python reader for CADI MDx binary formats without requiring native compilation.
  • SAMEER ASCII Reader (SameerReader): Robust parser for SAMEER .iono ASCII format ionograms.
  • DataFrame Interoperability: First-class conversion to both Pandas and Polars DataFrames with structured time partitioning.
  • Ionogram Signal Processing & Filtering: Built-in noise reduction, Doppler filtering, O/X mode separation, and k-vector estimation.
  • Site Metadata & Timezone Support: Configurable site parameters and local/universal time (UT/LT) coordinate calculations via sites.json.

Installation

From PyPI

pip install cadilib

Or using uv:

uv add cadilib

From Source

git clone https://github.com/Rally0078/cadilib.git
cd cadilib
uv sync

Manually generate stubs (warning: overwrites the handwritten Rust module stub)

uv run stubgen --include-docstrings -p cadilib -o stubs

Quick Start

1. Parsing CADI Binary Files (.mdX)

You can read CADI binary files using either the Rust-accelerated parser or the pure-Python reader:

from pathlib import Path
from cadilib import MDreader, MDreader_rs

file_path = Path("data/sample.md4")

# Fast Rust reader (recommended)
if MDreader_rs is not None:
    cadi_data = MDreader_rs.read_raw_data(file_path)
else:
    # Fallback to pure Python reader
    cadi_data = MDreader.read_raw_data(file_path)

# Access metadata and data structures
print(f"Site: {cadi_data.metadata.station_name}")
print(f"Number of frequencies: {cadi_data.metadata.nfreqs}")
print(f"Height array shape: {cadi_data.dopbins.height.shape}")

2. Exporting to Pandas or Polars DataFrames

Convert raw CADI or SAMEER ionogram data into structured DataFrames:

from cadilib import MDreader, PandasUtils, PolarsUtils
from pathlib import Path

raw_data = MDreader.read_raw_data(Path("data/sample.md4"))

# Convert to Pandas DataFrames
df_pandas_dop, df_pandas_freq = PandasUtils.create_pandas_from_arrays(
    raw_data, radar_type="cadi"
)

# Convert to Polars DataFrames
df_polars_dop, df_polars_freq = PolarsUtils.create_polars_from_arrays(
    raw_data, radar_type="cadi"
)

3. Parsing SAMEER ASCII Files (.iono)

from pathlib import Path
from cadilib.ionogramparser import SameerReader

sameer_data = SameerReader.read_raw_data(Path("data/sample.iono"))
print(f"Frequencies scanned: {len(sameer_data.freq_list)}")

Development & Building

Prerequisites

Build Wheel

uv build --wheel

Run Tests

uv run pytest

Metadata

Release files for cadilib 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for cadilib 0.1.0
File Actions
cadilib-0.1.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for cadilib-0.1.0-cp314-cp314-win_amd64.whl
cadilib-0.1.0-cp314-cp314-manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64 Details for cadilib-0.1.0-cp314-cp314-manylinux_2_28_x86_64.whl
cadilib-0.1.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for cadilib-0.1.0-cp313-cp313-win_amd64.whl
cadilib-0.1.0-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details for cadilib-0.1.0-cp313-cp313-manylinux_2_28_x86_64.whl
cadilib-0.1.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for cadilib-0.1.0-cp312-cp312-win_amd64.whl
cadilib-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details for cadilib-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl

Total release size: 16.6 MB

Release files / cadilib-0.1.0-cp314-cp314-win_amd64.whl

Download URL cadilib-0.1.0-cp314-cp314-win_amd64.whl
Size 941.7 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
1e3544ce673e2671b35dccad590e1826c5f4dbbe08d70166622e11e0c39980e4
BLAKE2b-256 checksum
How to use checksums
beee705ca6202db869af886f0782399bc3e81cb7ff9b3f873b655e39734f1a09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / cadilib-0.1.0-cp314-cp314-manylinux_2_28_x86_64.whl

Download URL cadilib-0.1.0-cp314-cp314-manylinux_2_28_x86_64.whl
Size 4.5 MB
Tags CPython 3.14 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
360fda4009a3e97ddc3967b24fb044e4bee6a61036e4c43da66daa9219cbd6e5
BLAKE2b-256 checksum
How to use checksums
976c9446a1cd691615cac512bd0ccf33cef906d9738772b9cc91a0466f5cb3c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / cadilib-0.1.0-cp313-cp313-win_amd64.whl

Download URL cadilib-0.1.0-cp313-cp313-win_amd64.whl
Size 917.9 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
280f5dfef4d220e410fac30136c6c43efc559df41c7cbbf29b0ba28e57329737
BLAKE2b-256 checksum
How to use checksums
7dfe0759990e2e7c0300afd1bc98200d59f3ca8dd04387b0bfa63703f239520b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / cadilib-0.1.0-cp313-cp313-manylinux_2_28_x86_64.whl

Download URL cadilib-0.1.0-cp313-cp313-manylinux_2_28_x86_64.whl
Size 4.6 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
ba9fa8dbf0121a83c7b11e9b32cb652356a0c73ec9fd0300af1ece154dd5b19c
BLAKE2b-256 checksum
How to use checksums
5e08d31a32fe82106b86aabaee4a54d3c8fdaf26c0154722e5da39ab8163fff9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / cadilib-0.1.0-cp312-cp312-win_amd64.whl

Download URL cadilib-0.1.0-cp312-cp312-win_amd64.whl
Size 928.0 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
79e9bcf3f4e6f10a4a54d72f6e3c1c357104540b6e83ace1dcaaae8507111d2d
BLAKE2b-256 checksum
How to use checksums
d4ebdf5458d8178c275b97c2f09b4c40409076b337e234021f1782bb1a6cfe0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / cadilib-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL cadilib-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl
Size 4.7 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
3ca4f5cfd777ba4104d3ee3f713d08ec2a6aba06c1e1cc3019c71bb88ed9ea97
BLAKE2b-256 checksum
How to use checksums
7d268ddfc1411a979563a38edbae0221f035e355d95c129a66571c0dd71d10f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Security for cadilib 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for cadilib-0.1.0-cp314-cp314-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page