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) in India.

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.

Todo

  • MacOS builds in PyPI

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.5

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.5
File Actions
cadilib-0.1.5-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for cadilib-0.1.5-cp314-cp314-win_amd64.whl
cadilib-0.1.5-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.5-cp314-cp314-manylinux_2_28_x86_64.whl
cadilib-0.1.5-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for cadilib-0.1.5-cp313-cp313-win_amd64.whl
cadilib-0.1.5-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.5-cp313-cp313-manylinux_2_28_x86_64.whl
cadilib-0.1.5-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for cadilib-0.1.5-cp312-cp312-win_amd64.whl
cadilib-0.1.5-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.5-cp312-cp312-manylinux_2_28_x86_64.whl

Total release size: 16.8 MB

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

Download URL cadilib-0.1.5-cp314-cp314-win_amd64.whl
Size 953.7 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
9ca5efe9463ba541169ac593f90bb72a6ced126bac6aa1d24a42459a58701072
BLAKE2b-256 checksum
How to use checksums
e707d1db3ed4b33b472b5130725a20195bece338a818f2817ba0ad43e65a94b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Dec 3, 2026.

Transparency log

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

Download URL cadilib-0.1.5-cp314-cp314-manylinux_2_28_x86_64.whl
Size 4.6 MB
Tags CPython 3.14 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
d7254c2ec208743520e5423c3bfc8591f402169f5f37e99bf81e00cb70d098ce
BLAKE2b-256 checksum
How to use checksums
cd166a6a89f53838207294c56eb1d0da24fcc68e25d78e0a3c45f589cb14e5c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Dec 3, 2026.

Transparency log

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

Download URL cadilib-0.1.5-cp313-cp313-win_amd64.whl
Size 930.3 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
96cc1c78b1a0ead022653f2d430eb6e98d72624cef1644f962d343a1d9827dbd
BLAKE2b-256 checksum
How to use checksums
e2198e13b719fed55b86d59b51d6b76094d7843003a5bd630db492cff4c1f25d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Dec 3, 2026.

Transparency log

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

Download URL cadilib-0.1.5-cp313-cp313-manylinux_2_28_x86_64.whl
Size 4.7 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
f48fb53f0561a3ac2c8543a64580d534f9aa6f0eaf05f14fbff7fc0876e6ce0a
BLAKE2b-256 checksum
How to use checksums
708438e858a92c76443d2bcd0c0b8f060218be3bc982a70879a0fb4645fc1b60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Dec 3, 2026.

Transparency log

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

Download URL cadilib-0.1.5-cp312-cp312-win_amd64.whl
Size 938.9 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
1cdb06a0f1062ff3aef1fa3acdcc828cb6fe808fd2f2e84b60de120cf701200c
BLAKE2b-256 checksum
How to use checksums
fa934c6bf6ddf63887202674deb6969b3ccb97215a22076a2a5994695f3cc2a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Dec 3, 2026.

Transparency log

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

Download URL cadilib-0.1.5-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
d6436f2e965400de388a207d7ebc3227015b022541b03a8920c048859a841ba8
BLAKE2b-256 checksum
How to use checksums
3671889307e57ec67cea8d682c75d6a151657b5626d3a7876ecc499587be9d94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Dec 3, 2026.

Transparency log

Security for cadilib 0.1.5

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.5-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 Dec 3, 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