Skip to content
README.md 1.71 KiB
Newer Older
Romolo Politi's avatar
Romolo Politi committed
# PyCCSDS
Romolo Politi's avatar
Romolo Politi committed

Romolo Politi's avatar
Romolo Politi committed
---

Romolo Politi's avatar
Romolo Politi committed
PyCCSDS is a library to read a data packet coming from a space mission that follows the Consultative Committee for Space Data Systems (CCSDS) standard
Romolo Politi's avatar
Romolo Politi committed

Current version **0.1.0**

Romolo Politi's avatar
Romolo Politi committed
[[_TOC_]]

## Installation
Romolo Politi's avatar
Romolo Politi committed
```shell
python3 -m pip install Python-CCSDS
```
Romolo Politi's avatar
Romolo Politi committed
## Usage
Romolo Politi's avatar
Romolo Politi committed
```python
Romolo Politi's avatar
Romolo Politi committed
from PyCCSDS.ccsds import CCSDS
Romolo Politi's avatar
Romolo Politi committed

dat = CCSDS('BepiColombo',packet)
```
wehre *packet* is a string with the HEX rappresentation of the pachet

Romolo Politi's avatar
Romolo Politi committed
## Limitation
Romolo Politi's avatar
Romolo Politi committed

## Data Structure

Romolo Politi's avatar
Romolo Politi committed
The CCSDS Header is composed by two blocks:
+ the Source Packet Header 
+ the Packet Data Field

The first one il long 48 bits the second one has a varble dimension and structure depending by the type and the content of the packet. in [Figure 1](#figure-1-telemetry-packet) is reported the structure for a Telemetry Packet.
Romolo Politi's avatar
Romolo Politi committed

Romolo Politi's avatar
Romolo Politi committed
The structure of the CCSDS class follow the structure of the packet header.


```mermaid
classDiagram
    CCSDS --|> SPH
    CCSDS --|> PDF
    SPH --|> packetID
    SPH--|> sequenceControl
    PDF --|> DFHeader
    class CCSDS{
        + str Data 
    }
    class DFHeader{
        + uint PUSVersion
        + uint ServiceType
        + uint ServiceSubType
        + uint DestinationId
        + uint Synchronization
        + uint CorseTime
        + uint FineTime
        + str SCET
        + str  UTCTime
    }
    class SPH{
        + uint packetLength
    }
    class packetID{
        + uint VersionNum
        + uint packetType
        + uint dataFieldHeaderFlag 
        + uint Apid
        + uint Pid
        + uint Pcat
    }
    class sequenceControl{
        + bin SegmentationFlag
        + uint SSC
    }
    class PDF{
        +str Data
    }
```
Romolo Politi's avatar
Romolo Politi committed

Romolo Politi's avatar
Romolo Politi committed
![TM packet](docs/TM_Packet_Header.png "Telemetry packet")
Romolo Politi's avatar
Romolo Politi committed
#### Figure 1 - Telemetry Packet