Crates.io | ccsds |
lib.rs | ccsds |
version | 0.1.0-beta.19 |
source | src |
created_at | 2024-01-26 19:56:14.208772 |
updated_at | 2024-11-26 18:59:40.602269 |
description | CCSDS spacecraft data stream decoding |
homepage | |
repository | https://github.com/bmflynn/ccsds-rs |
max_upload_size | |
id | 1115868 |
size | 2,938,074 |
[!WARNING] This project is very much in development, and the API is very likely to change in ways that will 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:
The following example shows how to decode an unsynchrozied 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.
use std::fs::File;
use std::io::BufReader;
use ccsds::{ASM, FrameDecoderBuilder, Synchronizer, decode_framed_packets, collect_packet_groups, PacketGroup};
// 1. Synchronize stream and extract blocks (CADUs w/o ASM)
let file = BufReader::new(File::open("snpp.dat")
.expect("failed to open data file"));
let blocks = Synchronizer::new(file, &ASM.to_vec(), 1020)
.into_iter()
.filter_map(Result::ok);
// 2. Decode those blocks into Frames
let frames = FrameDecoderBuilder::default()
.reed_solomon_interleave(4)
.build(blocks);
// 3. Extract packets from Frames
// Suomi-NPP has 0 length izone and trailer
let packets = decode_framed_packets(157, frames, 0, 0);
spacecraftsdb: JSON Spacecraft metadata database
spacecrafts-rs: Rust create for spacecraftsdb
ccsdspy: Python bindings for ccsds-rs
GNU General Public License v3.0