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

Romolo Politi's avatar
Romolo Politi committed
SCOSpy is a python library for the Satellite Control and Operation System 2000 (SCOS-2000) header written as hexadecimal string.

Current version is 0.2.0
Romolo Politi's avatar
Romolo Politi committed

Romolo Politi's avatar
Romolo Politi committed
## Table of Contents
+ [Library Installation](#library-installation)
+ [Usage](#usage)
+ [Data Structure](#data-structure)
  + [Common Packet Header Structure (CHP)](#common-packet-header-structure)
  + [TCPH](tcph)
Romolo Politi's avatar
Romolo Politi committed

## Library Installation
```
Romolo Politi's avatar
Romolo Politi committed
   $ pip install SCOSpy
```
## Usage
Romolo Politi's avatar
Romolo Politi committed

Romolo Politi's avatar
Romolo Politi committed

   a = SCOS(packet)
Romolo Politi's avatar
Romolo Politi committed
where *packet* is the hexadecimal string rapresentation of the Telemetry packet.

Romolo Politi's avatar
Romolo Politi committed
## Limitation
at the moment the software works only for Telemetry and Telecommand packets for the BepiColombo ESA Mission. In the next versions other missions will be implemented.

## Data Structure
Romolo Politi's avatar
Romolo Politi committed

The SCOS object contain:

* **Common Packet Header Structure (CPH)**
Romolo Politi's avatar
Romolo Politi committed

and one of the following sub-object:

* **Telemetry Packet Header (TMPH)**
* **Telecommand Packet Header (TCPH)**

### Common Packet Header Structure (CHP)
Romolo Politi's avatar
Romolo Politi committed


In the CHP are present the following fields.

<table>
<tr><th>Field</th><th>Description</th></tr>
<tr><th> CTree </th><td>Used in earlier version of SCOS-2000 by c-tree to support packets storing in files and be kept for backward compatibility.</td></tr>
<tr><th>AccessF</th><td>Storing mode, values are:

* 0 for an inserted packet;
* 1 for an update

</td></tr>
<tr><th>SimFlag</th><td>Simulated packet, values are:

* 0 for a non-simulated packet generated by the spacecraft
* 1 for a simulated packet generated by a Simulator or test tool.

</td></tr>
Romolo Politi's avatar
Romolo Politi committed
<tr><th>FilingTime</th><td>Filing Time. For TM this is the timestamp. For TCs, this is the release time.</td></tr>
<tr><th>CreationTime</th><td>Creation Time (in seconds since 1st Jan 1970 00:00:00) – this is a secondary retrieval key and for TM is the time at which the SCOS-2000 packet was
  created, which is also approximately the time that the packet was received by the MCS and stored.

  For TCs, this is its (estimated) execution time</td></tr>
  <tr><th>CreateID</th><td>Used by the old SCOS-2000 archive for generating a retrieval key and set by the application which generated the packet</td></tr>
  <tr><th>SCID</th><td>In the case of telemetry, Spacecraft ID. See :ref:`spacecraft_id_table`.<br/>
    It has two fields:
    <table>
      <tr><th>ID</th><td> Numeric identificative</td><tr>
      <tr><th>Descriprion<td>Name of the Spacraft</td></tr>
    </table>
    </td></tr>
    <tr><th>GSID</th><td> In the case of telemetry, the ID and name of the ground station which receives the frame containing this packet. See :ref:ground_id.<br/>
      It has two fields:
      <table>
        <tr><th>ID</th><td> Numeric identificative</td><tr>
        <tr><th>Station<td>Name of the Ground Station</td></tr>
      </table>
    </td></tr>
    <tr><th>PSize</th><td>Packet Size. Size of the entire SCOS-2000 packet, including all headers and the packet data.</td></tr>
    <tr><th>PType</th><td>Determines the type of SCOS-2000 packet. See :ref:packet_type for details.</td></tr>
    <tr><th>Version</th><td>The version of this packet structure.</td></tr>
    <tr><th>FilingFlag</th><td>Set to **1** if this packet is to be filed in the MCS archive, otherwise **0**.</td></tr>
    <tr><th>DistFlag</th><td>Set to : **1** if this packet is to be distributed to the MCS applications, otherwise **0**.</td></tr>
    <tr><th>TSPolicy</th><td>Determines the timestamp policy for spacecraft TM, i.e. what will be set in the Filing Time fields above:
      <table>
        <tr><th>0</th><td>packet is time-stamped with the creation time – i.e. SCOS-2000 packet creation</td></tr>
        <tr><th>1</th><td>that the packet is time-stamped with the time of transmission of the frame it was received in, i.e. Earth Reception Time minus the propagation delay (applicable to spacecraft TM only)</td></tr>
        <tr><th>2</th><td>the correlated SCET (for spacecraft TM only)</td></tr>
      </table>
    </td></tr>
    <tr><th>TQ</th><td>Time quality of the timestamp, used only if the TsPolicy is set to 2:
      <table>
        <tr><th>0</th><td>Good</td></tr>
        <tr><th>1</th><td>Inaccurate</td></tr>
        <tr><th>2</th><td>Bad</td></tr>
      </table>
    </td></tr>
    <tr><th>StreamID</th><td>The datastream identifier in the MCS, which for TM maps to VCs:
      <table>
        <tr><th>1000</th><td>VC0 Real-Time Non-Science (online)</td></tr>
        <tr><th>1001</th><td>VC1 Playback Non-Science (online)</td></tr>
        <tr><th>1002</th><td>VC2 Science (online)</td></tr>
        <tr><th>1003</th><td>VC3 File-Transfer (online)</td></tr>
        <tr><th>2000</th><td>VC0 Real-Time Non-Science (offline)</td></tr>
        <tr><th>2001</th><td>VC1 Playback Non-Science (offline)</td></tr>
        <tr><th>2002</th><td>VC1 Playback Non-Science (offline)</td></tr>
        <tr><th>2003</th><td>VC2 Science (offline)</td></tr>
        <tr><td colspan="2"> For TCs stream **1** is used.</td></tr>
        <tr><td colspan="2"> For EVs stream **1000** and **1001** is used.</td></tr>
        <tr><th>65535</th><td>is used for internal non spacecraft TM packets, which should be ignored by external users.</td></tr>
      </table>
    </td></tr>
    <tr><th>SeqCounter</th><td>Internal MCS counter used for detecting gaps – not related to the spacecraft source sequence count value in the PUS header</td></tr>
    <tr><th>SPID</th><td>the numerical packet ID which identifies the packet structure, and maps to packet definitions in the TM/TC MIB database. Note: For TC packets, SPIDs 100 and 200 are used.</td></tr>
    <tr><th>MissionID</th><td>For telemetry, the MCS mission identifier. See :ref:`mission_id`</td></tr>
</table>
Romolo Politi's avatar
Romolo Politi committed
.. _spacecraft_id_table_:
Romolo Politi's avatar
Romolo Politi committed
.. list-table:: Spacecraft ID
   :widths: 10 90
   :header-rows: 1

   * - ID
     - Spacecraft
   * - 816
     - BepiColombo, TM received over X-Band
   * - 817
     - BepiColombo, TM received over Ka-Band


.. _ground_id:
.. list-table:: Ground Stations ID
   :widths: 10 90
   :header-rows: 1

   * - ID
     - Ground Station Description
   * - 21
     - Kourou
   * - 22
     - Perth
   * - 23
     - New Norcia
   * - 24
     - Cebreros
   * - 25
     - Malargue
   * - 30
     - Maspalomas
   * - 97
     - Usuda
   * - 98
     - Uchinoura

.. _mission_id:
.. list-table:: Mission ID
   :widths: 10 90
   :header-rows: 1

   * - ID
     - Mission
   * - **816**
     - BepiColombo

Romolo Politi's avatar
Romolo Politi committed
.. _packet_type_:
Romolo Politi's avatar
Romolo Politi committed
.. list-table: Packet Types
   :widths: 10 90
   :header-rows: 1

   * - ID
     - Description
   * - **1**
     - Telemetry
   * - **2**
     - Telecommand
   * - **3**
     - Event