Skip to main content

Satellite-agnostic CCSDS/CADU/VCDU frame handling in Python.

Reads raw downlink files containing CADU (Channel Access Data Unit) blocks, reassembles VCDU payloads, and yields fixed-length instrument frames delimited by a caller-supplied sync pattern. Works with any CCSDS-compliant downlink: VIIRS, MERSI, MODIS, etc.

Installation

pip install pycadu

Quick start

from pycadu import iter_vcdu_frames

MERSI_SYNC = bytes([0xAA, 0x55] * 6)
MERSI_FRAME_SIZE = 0x38E4F4
MERSI_VCID = 3

for frame in iter_vcdu_frames(
    "FY3D_20240101.dat",
    pattern=MERSI_SYNC,
    frame_size=MERSI_FRAME_SIZE,
    vcid=MERSI_VCID,
    stride=1024,          # or 896 / 1072 depending on ground station
):
    process(frame)

API

pycadu

  • iter_vcdu_frames(path, pattern, frame_size, vcid, stride) — top-level convenience.

pycadu.cadu

  • detect_cadu_stride(data) — infer stride (896 / 1024 / 1072) from a sample.

  • extract_cadu_data(block, stride) — strip RS parity / annotation bytes.

  • extract_vcdu_payload(cadu) — strip CCSDS primary header.

  • extract_vcid(block) — read the 6-bit virtual channel identifier.

  • CADU_STRIDE_1072 — 1072-byte stride (1024-byte CADU + 48 annotation bytes).

pycadu.sync

  • find_sync_pattern(data, pattern, start) — search at all 8 bit offsets.

  • _build_shifted(data, shift) — build a bit-shifted copy of data.

pycadu.reader

  • cadu_blocks(path, stride) — stream physical blocks from a file.

  • vcdu_payloads(blocks, stride, target_vcid) — filter by VCID, strip headers.

  • vcdu_frames(payloads, pattern, frame_size) — reassemble variable-length chunks into fixed-length frames, handling 0-7 bit shifts automatically.

  • read_frames_batch(path, stride, vcid, pattern, frame_size) — memory-mapped bulk reader, ~20x faster than the streaming path on large files.

pycadu.constants

CCSDS_SYNC_MARKER, CADU_STRIDE_896, CADU_STRIDE_1024, RS_PARITY_LENGTH, CADU_DATA_LENGTH, CCSDS_HEADER_LENGTH, VCDU_PAYLOAD_LENGTH.

Release files for pycadu 0.1.3

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

Source distribution (sdist)

Source distribution for pycadu 0.1.3
File Size Uploaded
pycadu-0.1.3.tar.gz 46.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pycadu 0.1.3
File Interpreter ABI Platform
pycadu-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 65.1 kB

Release files / pycadu-0.1.3.tar.gz

Download URL pycadu-0.1.3.tar.gz
Size 46.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f1e923bb8b8da5cf3746770b23ce9ac6178331f4d247a5974a89856bcdffe4ac
BLAKE2b-256 checksum
How to use checksums
3e9b088513388f2aedaace16a6e977f8f5a5908d4233f9d0ea3ce1cb49a630c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / pycadu-0.1.3-py3-none-any.whl

Download URL pycadu-0.1.3-py3-none-any.whl
Size 18.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
330d5097486e9e3e75071c99fa0c39aca8e127502be21e41f68003ee29630db3
BLAKE2b-256 checksum
How to use checksums
27aa9bec1af2314cee53b737bce096fd9b42dd9483838c0e5546682533b67326
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

0.1.4

2 release files

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

1 release file

0.1.0

2 release files

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