12 releases

0.1.0-beta.19 Nov 26, 2024
0.1.0-beta.10 Jul 1, 2024
0.1.0-beta.7 Jun 14, 2024
0.1.0-beta.4 Apr 2, 2024
0.1.0-alpha.5 Jan 29, 2024

#135 in Science

Download history 3/week @ 2024-08-29 9/week @ 2024-09-19 5/week @ 2024-09-26 9/week @ 2024-10-10 2/week @ 2024-10-17 4/week @ 2024-10-31 5/week @ 2024-11-07 110/week @ 2024-11-21 56/week @ 2024-11-28 83/week @ 2024-12-05

249 downloads per month
Used in rdr

Custom license

2MB
2.5K SLoC

ccsds

CCSDS Spacecraft Data Stream Decoding

[!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:

  • Framing
    • Stream synchronization
    • Pseudo-noise removal
    • Reed-Solomon FEC
  • Spacepacket decoding
    • Telemetry packets, i.e., packets with type 0
    • Sequencing
    • Packet groups
  • Limited support for secondary header timecodes
    • CCSDS Day Segmented timecodes
    • NASA EOS timecodes for Aqua and Terra spacecrafts
    • Provided but not directly used

Examples

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);

References:

License

GNU General Public License v3.0

Dependencies

~6–19MB
~224K SLoC