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

digraph inheritance1e103196a5 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "FixedLength" [URL="api/ccsdspy.FixedLength.html#ccsdspy.FixedLength",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Define a fixed length packet to decode binary data."]; "_BasePacket" -> "FixedLength" [arrowsize=0.5,style="setlinewidth(0.5)"]; "PacketArray" [URL="api/ccsdspy.PacketArray.html#ccsdspy.PacketArray",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="An array contained in a packet, similar to :py:class:`~ccsdspy.PacketField` but with multiple"]; "PacketField" -> "PacketArray" [arrowsize=0.5,style="setlinewidth(0.5)"]; "PacketField" [URL="api/ccsdspy.PacketField.html#ccsdspy.PacketField",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A field contained in a packet."]; "VariableLength" [URL="api/ccsdspy.VariableLength.html#ccsdspy.VariableLength",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Define a variable length packet to decode binary data."]; "_BasePacket" -> "VariableLength" [arrowsize=0.5,style="setlinewidth(0.5)"]; "_BasePacket" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Base class of FixedLength and VariableLength. Not to be instantiated"]; }

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

digraph inheritancea239824f34 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "Converter" [URL="api/ccsdspy.converters.Converter.html#ccsdspy.converters.Converter",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for all converter objects."]; "DatetimeConverter" [URL="api/ccsdspy.converters.DatetimeConverter.html#ccsdspy.converters.DatetimeConverter",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Post-processing conversion for converting timestamp fields to datetime"]; "Converter" -> "DatetimeConverter" [arrowsize=0.5,style="setlinewidth(0.5)"]; "EnumConverter" [URL="api/ccsdspy.converters.EnumConverter.html#ccsdspy.converters.EnumConverter",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Post-processing conversion for applying dictionary replacement of"]; "Converter" -> "EnumConverter" [arrowsize=0.5,style="setlinewidth(0.5)"]; "EnumConverterMissingKey" [URL="api/ccsdspy.converters.EnumConverterMissingKey.html#ccsdspy.converters.EnumConverterMissingKey",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="During conversion a value was encountered which did not have a"]; "LinearConverter" [URL="api/ccsdspy.converters.LinearConverter.html#ccsdspy.converters.LinearConverter",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Post-processing conversion which applies a linear (y=mx+b)"]; "PolyConverter" -> "LinearConverter" [arrowsize=0.5,style="setlinewidth(0.5)"]; "PolyConverter" [URL="api/ccsdspy.converters.PolyConverter.html#ccsdspy.converters.PolyConverter",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Post-processing conversion which applies calibration using a series"]; "Converter" -> "PolyConverter" [arrowsize=0.5,style="setlinewidth(0.5)"]; "StringifyBytesConverter" [URL="api/ccsdspy.converters.StringifyBytesConverter.html#ccsdspy.converters.StringifyBytesConverter",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Post-processing conversion which converts byte arrays or multi-byte"]; "Converter" -> "StringifyBytesConverter" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

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.