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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycadu-0.1.2.tar.gz (28.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycadu-0.1.2-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file pycadu-0.1.2.tar.gz.

File metadata

  • Download URL: pycadu-0.1.2.tar.gz
  • Upload date:
  • Size: 28.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for pycadu-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e086bd2ddc85031de6e7f8c08bc212e14218dcf0338c86bbd2f98d9069024d58
MD5 515b4bb46c1b9a876876f024cdcf278a
BLAKE2b-256 885dee810268702c3cb70abe7d809a5a28b3071e9c8dfe65d849cd2d15303df6

See more details on using hashes here.

File details

Details for the file pycadu-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pycadu-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for pycadu-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b3fd9846121c892003079e97db7a52c81dab6596200dabf9f19577cdce9a8c19
MD5 ead18c7ed0dfa4b2769e8952b30c9eba
BLAKE2b-256 e4e63869c37e083c98811b6c219e51b22fc47d58cf75dc0c0cd173448d0c206f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page