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.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pycadu-0.1.4.tar.gz | 46.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pycadu-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 65.2 kB
Release files / pycadu-0.1.4.tar.gz
| Download URL | pycadu-0.1.4.tar.gz |
|---|---|
| Size | 46.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
939f7829793775af62216d498f22d0c5c2b322a4a8ab1f2e76c22d1435b5a764
|
|
BLAKE2b-256 checksum How to use checksums |
eb6e4932a183edf294411207e9e000ff40d1f4603b440255d4c5668dc5eeab2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|
Release files / pycadu-0.1.4-py3-none-any.whl
| Download URL | pycadu-0.1.4-py3-none-any.whl |
|---|---|
| Size | 18.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
efc9636cbd006185871a87916ad932db53bb6eb6db561daf6d1128ca67dda7d8
|
|
BLAKE2b-256 checksum How to use checksums |
34a6311b2fc8faa3af78f50ca727f66b43ff3f71262ee03d18bd773f443b7474
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|