Reference/API

ccsdspy Package

IO Interface for Reading CCSDS Data in Python.

Functions

split_by_apid(mixed_file[, valid_apids])

Split a stream of mixed APIDs into separate streams by APID.

Classes

FixedLength(fields)

Define a fixed length packet to decode binary data.

PacketArray(*args[, array_shape, array_order])

An array contained in a packet, similar to PacketField but with multiple elements of the same size (e.g. image).

PacketField(name, data_type, bit_length[, ...])

A field contained in a packet.

VariableLength(fields)

Define a variable length packet to decode binary data.

Class Inheritance Diagram

Inheritance diagram of ccsdspy.packet_types.FixedLength, ccsdspy.packet_fields.PacketArray, ccsdspy.packet_fields.PacketField, ccsdspy.packet_types.VariableLength

ccsdspy.converters Module

This class hold the implementation of the converter system, which applies post-process to decoded packet fields. This post-processing includes applying linear/polynomial calibration curves, dictionary replacement, and time parsing.

Classes

EnumConverterMissingKey

During conversion a value was encountered which did not have a corresponding key in the replacement dictionary.

Converter()

Base class for all converter objects.

PolyConverter(coeffs)

Post-processing conversion which applies calibration using a series of coefficients ordered from highest power to intercept.

LinearConverter(slope, intercept)

Post-processing conversion which applies a linear (y=mx+b) transformation.

EnumConverter(replace_dict)

Post-processing conversion for applying dictionary replacement of integers to strings.

DatetimeConverter(since, units)

Post-processing conversion for converting timestamp fields to datetime instances, computed using offset(s) from a reference time.

StringifyBytesConverter([format])

Post-processing conversion which converts byte arrays or multi-byte numbers to strings in numeric representations such as binary, hexadecimal, or octal.

Class Inheritance Diagram

Inheritance diagram of ccsdspy.converters.EnumConverterMissingKey, ccsdspy.converters.Converter, ccsdspy.converters.PolyConverter, ccsdspy.converters.LinearConverter, ccsdspy.converters.EnumConverter, ccsdspy.converters.DatetimeConverter, ccsdspy.converters.StringifyBytesConverter

ccsdspy.utils Module

Utils for the CCSDSPy package.

Functions

count_packets(file[, return_missing_bytes])

Count the number of packets in a file and check if there are any missing bytes in the last packet.

get_packet_apid(primary_header_bytes)

Parse the APID of a packet from the bytes associated with a packet's primary header.

get_packet_total_bytes(primary_header_bytes)

Parse the number of bytes in a packet from the bytes associated with a packet's primary header.

iter_packet_bytes(file[, include_primary_header])

Iterate through packets as raw bytes objects, in the order they appear in a file.

read_primary_headers(file)

Read primary header fields and return contents as a dictionary of arrays.

split_by_apid(mixed_file[, valid_apids])

Split a stream of mixed APIDs into separate streams by APID.

split_packet_bytes(file[, ...])

Retrieve a list of bytes objects corresponding to each packet in a file.