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

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

Total release size: 16.5 MB

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

Download URL cadilib-0.1.4-cp314-cp314-win_amd64.whl
Size 939.3 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
929e1e862aac3e104cf3a7d586f38520fcddd642648b692cd85a51775e14ce8e
BLAKE2b-256 checksum
How to use checksums
12c8e9e1c14984ee8fe8c548cdb680818754859dd658e795cf29c4e15306b38f
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 26, 2026.

Transparency log

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

Download URL cadilib-0.1.4-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
804501beeff9fd32f63c1ff666bf69db847b6cd4f6cbe32da2a4768843288a47
BLAKE2b-256 checksum
How to use checksums
305086faebabfaa17ad9bc451daaa423c59457fff344c1b0b1d350b10b75ff2c
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 26, 2026.

Transparency log

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

Download URL cadilib-0.1.4-cp313-cp313-win_amd64.whl
Size 915.4 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
480cd0390ab19382f64cf447443e3044cd37fc3eee171f1ae5cc19007cbba7fd
BLAKE2b-256 checksum
How to use checksums
649f71f3a9609c2e5a002bac2ae10a28153c88a983c0869b92d299da66f477ac
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 26, 2026.

Transparency log

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

Download URL cadilib-0.1.4-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
66ddf8e833393aa507763d15904c1e541a5d035fd02617a9fbbc91730986c0f9
BLAKE2b-256 checksum
How to use checksums
f85696d113573ab238a66f5221b8e72977dc3c71d95dec1251a2673a63e5dc2a
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 26, 2026.

Transparency log

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

Download URL cadilib-0.1.4-cp312-cp312-win_amd64.whl
Size 923.9 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
e44dbcd4d3e24531981f30357a8f6d22de8092d2deabc14c9cbef6f240411a12
BLAKE2b-256 checksum
How to use checksums
ec5e77884bfad1942ad106c48002cd3701d6bc2b8ec4a51095d4bd1605fbc978
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 26, 2026.

Transparency log

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

Download URL cadilib-0.1.4-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
ba2c0eac8b1663ffa1f8abbe3756b0ddfd35b920bef897f8763c729a1897f452
BLAKE2b-256 checksum
How to use checksums
ca8664c3ba787efbfde55feef1fa6b48ed77e36280827f15e4eeac026105c332
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 26, 2026.

Transparency log

Security for cadilib 0.1.4

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.4-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 26, 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