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

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

Total release size: 16.5 MB

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

Download URL cadilib-0.1.3-cp314-cp314-win_amd64.whl
Size 939.9 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
acff97e1c2a555033cd1d94c727e9b964ca20144cb6762705234c0bad8c72e43
BLAKE2b-256 checksum
How to use checksums
e9bf34161c3a3c8ff47ad82959424387bda7e48f5f3f7b8efc2b71453b1164f2
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 Nov 23, 2026.

Transparency log

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

Download URL cadilib-0.1.3-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
e1c5f38b0c6f54d53293d7697a48f085378f1af858d805b0e779d0118fc6487c
BLAKE2b-256 checksum
How to use checksums
25ea75bc5f197220b55b3630cc8dc97d00bef8e0184d02f595fb04fd2a35d06e
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 Nov 23, 2026.

Transparency log

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

Download URL cadilib-0.1.3-cp313-cp313-win_amd64.whl
Size 916.0 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
8a3e794f18499ef6b2c663b763c976e21c0aefee3bfb835fd22b33616341a0b8
BLAKE2b-256 checksum
How to use checksums
ef13a5fd89f1308a2549447b76c3522c5aced70aa702eccd768c0ffece4a9e93
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 Nov 23, 2026.

Transparency log

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

Download URL cadilib-0.1.3-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
3549bb87f2302190a329e205c78acf6c5ea924da71ca4707ed74f6c4248f9819
BLAKE2b-256 checksum
How to use checksums
597994f6e8aa99269bcc9ac7e1db24571457a6a751604a99366b46b1675c5d9c
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 Nov 23, 2026.

Transparency log

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

Download URL cadilib-0.1.3-cp312-cp312-win_amd64.whl
Size 924.4 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
4f622f02549bd75e5e5fc77bcada2e301ed8b2c2a558902ca6dae7ab760798f1
BLAKE2b-256 checksum
How to use checksums
7a7987aaaa91baa9d654d6dd9c25e1257c55894745c14cf0b894de32cdb96ded
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 Nov 23, 2026.

Transparency log

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

Download URL cadilib-0.1.3-cp312-cp312-manylinux_2_28_x86_64.whl
Size 4.6 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
b204a326bde3813f36544294bfe64cc1a5ae9921814c4f0146ef9e4bb6eec6da
BLAKE2b-256 checksum
How to use checksums
54534d6a7ee32218adca9db5fb509f4cc0635a3529ed24eb95b072da162fe502
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 Nov 23, 2026.

Transparency log

Security for cadilib 0.1.3

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.3-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 Nov 23, 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