Crates.io | ccsds |
lib.rs | ccsds |
version | |
source | src |
created_at | 2024-01-26 19:56:14.208772 |
updated_at | 2025-02-05 15:42:20.591903 |
description | CCSDS spacecraft data stream decoding |
homepage | |
repository | https://github.com/bmflynn/ccsds-rs |
max_upload_size | |
id | 1115868 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
WARNING: This project is very much in development, and the API is very likely to change in ways that will break things. If you have comments or suggestions regarding the API feel free to file an issue.
The project provides tools for decoding spacecraft downlink telemetry streams conforming
to the CCSDS
recommended specifications (Blue Books)
TM Synchronization and Channel Coding
and Space Packet Protocol
.
Supports:
Much of the functionality is wrapped around [Iterator]s, and as such most of the public API returns an [Iterator] of some sort.
The following example shows how to decode an unsynchronized byte stream of CADUs for
the Suomi-NPP spacecraft. This example code should work for any spacecraft data stream
that conforms to CCSDS TM Synchronization and Channel Coding
and Space Packet Protocol
documents, where the input data is a stream containing pseudo-randomized CADUs with
Reed-Solomon FEC (including parity bytes).
use std::fs::File;
use std::io::BufReader;
use ccsds::framing::*;
// Framing configuration
let block_len = 1020; // CADU length - ASM length
let interleave: u8 = 4;
let izone_len = 0;
let trailer_len = 0;
// 1. Synchronize stream and extract blocks
let file = BufReader::new(File::open("snpp.dat").unwrap());
let cadus = Synchronizer::new(file, block_len)
.into_iter()
.filter_map(Result::ok);
// 2. Decode (PN & RS) those blocks into Frames, ignoring frames with errors
let frames = decode_frames(
cadus,
Some(Box::new(DefaultReedSolomon::new(interleave))),
Some(Box::new(DefaultDerandomizer)),
).filter_map(Result::ok);
// 3. Extract packets from Frames
let packets = decode_framed_packets(frames, izone_len, trailer_len, None);
It is also possible to have more control over the decode process for cases that do not conform to the standard CCSDS specifications.
For example, this will decode a stream of frames that are not pseudo-randomized and does not use Reed-Solomon FEC.
use std::fs::File;
use std::io::BufReader;
use ccsds::framing::*;
let block_len = 892; // Frame length
let interleave: u8 = 4;
let izone_len = 0;
let trailer_len = 0;
// 1. Synchronize stream and extract blocks
let file = BufReader::new(File::open("frames.dat").unwrap());
let cadus = Synchronizer::new(file, block_len)
.into_iter()
.filter_map(Result::ok);
// 2. Decode blocks into Frames
let frames = decode_frames(cadus, None, None).filter_map(|z| z.ok());
// 3. Extract packets from Frames
let packets = decode_framed_packets(frames, izone_len, trailer_len, None);
CCSDS
Space Packet Protocol
TM Synchronization and Channel Coding
TM Synchronization and Channel Coding - Summary of Concept and Rationale
Licensed under either of
at your option.