Skip to main content

Satellite-agnostic CCSDS/CADU/VCDU frame handling

Project description

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.

Project details


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.0.tar.gz (27.5 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.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pycadu-0.1.0.tar.gz
  • Upload date:
  • Size: 27.5 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.0.tar.gz
Algorithm Hash digest
SHA256 ce9c5eecf3809689373abbba704e3d707ac4c3df3282f4cbcacd336016d0fa2f
MD5 35835f7b02704d2754c6e6872379fca8
BLAKE2b-256 125143e0e84f2a3a6cae821a1ec343d83b7e8c528d57eb794aba06c7ed3048c7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycadu-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.3 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9f566df916dcca1fde8c7f9c5961a9fb562b2b1dab83572bc124b8e105e9cbc6
MD5 8fecb8dce86c2e729f582b6e64ee429c
BLAKE2b-256 538ded3757bbd5f8c2030e2a708aef563839f7d9fcff5f968f7892119bc1349b

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