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

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

Total release size: 16.5 MB

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

Download URL cadilib-0.1.2-cp314-cp314-win_amd64.whl
Size 940.0 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
4e87dd80df3ae757048395202e2196248bffa34ccc8380af1bd53bed2722f9e0
BLAKE2b-256 checksum
How to use checksums
3bc91159b300fb369e14ca9d873a00fe7251156c3bea94bc810d677192cd9cec
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.2-cp314-cp314-manylinux_2_28_x86_64.whl

Download URL cadilib-0.1.2-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
ede23134d6714dadac4214f22107644358e7e9664b7fac4fc21e44ba1922c920
BLAKE2b-256 checksum
How to use checksums
24a7d79326ddbce64b33e408939764bc5ac454e749405aeacb7df418cb78274c
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.2-cp313-cp313-win_amd64.whl

Download URL cadilib-0.1.2-cp313-cp313-win_amd64.whl
Size 916.2 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
51ed8718cdbfbe1385da8b2734b152842f0c0962c3d676a7661149ffb6c714ea
BLAKE2b-256 checksum
How to use checksums
aeb0eaa123fc2c1240be2174d31df0a5c533a50604e1588d39336b7f4212df4f
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.2-cp313-cp313-manylinux_2_28_x86_64.whl

Download URL cadilib-0.1.2-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
e7a9be44a05fb47ddf8544d92c1492a98188f29b25aa6196f5c62f095543c565
BLAKE2b-256 checksum
How to use checksums
b86881805542b4a39852e158135a5573f349c971717fffd13990e0f8f72a48a5
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.2-cp312-cp312-win_amd64.whl

Download URL cadilib-0.1.2-cp312-cp312-win_amd64.whl
Size 924.6 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
86a995c17fa86a6a410bfa580770c7db7bd3acf8f2579f5134316e0b25f7e266
BLAKE2b-256 checksum
How to use checksums
a4f05171ad446b690fc784d902b8176354623f8ce930881325d4a956136a3ec7
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.2-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL cadilib-0.1.2-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
087a683e2f1f607dd2e2fbf5d4e5a542fe8104a36872c82bb40af59a811d94e3
BLAKE2b-256 checksum
How to use checksums
451780d8596f1ef2902f6b68a923184d768918ebd2e6192aa17e32947cabc6f8
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.2

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