Core module
This module provides functions to compute and visualize data delivery scenarios.
Instrument context
The InstrumentContext
class defines the constraints from the
instrument, such as the segment duration, the session duration, the data
generation rate, etc.
The default values are based on ESA-LISA-EST-MIS-TN-0003 - LISA Science Data Description and Budget (Iss1Rev0), assuming no data loss. You can change these values to match your specific context.
>>> context = InstrumentContext(packet_loss_rate=0.1)
Derived parameters, such as the volume of live data to download per telemetry session, the necessary download rate to send all live data in a session, the time to download all archived data, etc., are computed from the context. You can print a summary of these parameters.
>>> context.print_derived_parameters()
Volume of archived data to download per telemetry session: 6423.926 Mbits
Necessary download rate to send all live data in a session: 223.1 kbps
Volume of priority-1 data in one segement: 5316.3 kbits
Download time for one priority-1 data segment: 23.8 s
Number of segments that can be downloaded between priority live segments: 11
Time to download all 192 archived data: 1.5 h
- class chopchop.core.InstrumentContext(*, segment_duration=300.0, session_duration=28800.0, session_interval=86400.0, sc_generation_rate=10980.0, priority_sc_generation_rate=3580.0, generation_rate_margin=0.5, packet_overhead=0.1, downlink_overhead=20000.0, sc2sc_transfer_time=8.3391023799538, sc2ground_transfer_time=166.78204759907604, packet_loss_rate=0.0)[source]
Defines the contrainsts from the instrument.
Default values are based on ESA-LISA-EST-MIS-TN-0003 - LISA Science Data Description and Budget (Iss1Rev0), denoted as [AD1].
-
downlink_overhead:
float
Overhead for data downlink [bps].
-
generation_rate_margin:
float
Margin on the data generation rate per spacecraft (relative value).
-
packet_loss_rate:
float
Data packet loss rate during transfer.
-
packet_overhead:
float
Packet overhead for data generation (relative value).
-
priority_sc_generation_rate:
float
Priority-1 data generation rate per spacecraft, without margin [bps].
-
sc2ground_transfer_time:
float
Spacecraft-to-ground transfer time [s].
-
sc2sc_transfer_time:
float
Spacecraft-to-spacecraft transfer time [s].
-
sc_generation_rate:
float
Data generation rate per spacecraft, without margin [bps].
-
segment_duration:
float
Duration of each segment [s].
A segment is the smallest unit of data that can be delivered.
-
session_duration:
float
Duration of a telemetry session [s].
A telemetry session is a commmunication session between the LISA instrument and the ground station. During a telemetry session, commands are sent to the instrument and data segements are received.
-
session_interval:
float
Interval between two telemetry sessions [s].
The interval between two telemetry sessions is the time between the beginning of two consecutive telemetry sessions.
-
downlink_overhead:
Telemetry strategy
We currently implement a single telemetry strategy, the
DefaultTelemetryStrategy
. In this strategy, we download the live data
segments as soon as they are available, and we download the archived data
segments in the idle time between two live segments.
Packets that are lost during the download are retransmitted at the end of the download queue between live segments, once all archived data has been downloaded.
- class chopchop.core.DefaultTelemetryStrategy[source]
Define the default download strategy.
In this strategy, we download the live data segments as soon as they are available, and we download the archived data segments in the idle time between two live segments.
Packets that are lost during the download are retransmitted at the end of the download queue between live segments, once all archived data has been downloaded.
Telemetry simulation
You can simulate a telemetry session using the simulate_telemetry()
function. You can provide a custom telemetry strategy, an instrument context, and
a random seed for data packet loss simulation.
>>> strategy = DefaultTelemetryStrategy()
>>> simulation = simulate_telemetry(strategy)
>>> len(simulation.received_packets)
287
>>> simulation.lost_packets
[]
You can also use this function to plot the received segments and the accumulated data at each data packet reception time.
>>> simulation.plot_received_segments()
>>> simulation.plot_accumulated_data()
- class chopchop.core.TelemetrySimulation(*, context, strategy, reception_times, received_packets, lost_packets)[source]
Results of a telemetry simulation.
- compute_masks(data_times)[source]
Compute masks to be applied on a continuous data array.
Each mask select the available (accumulated packets) data segments at each reception time, given in
reception_times
.- Parameters:
data_times (array-like of shape (M,)) – Times attached to the data array to be masked [s]. The times should be represented as the number of seconds since the current telemetry session start.
- Returns:
The masks are returned as a 2-dimensional array. The first dimension corresponds to the data packet reception time (when the mask becomes valid) and is of size
N = len(self.reception_times)
, and the second dimension corresponds to the data times.- Return type:
Array, of shape (N, M)
-
context:
InstrumentContext
Instrument context.
-
lost_packets:
list
[tuple
[float
,DataSegment
]] List of lost packets and their expected reception times [s].
- plot_accumulated_data()[source]
Plot available data at each data packet reception time.
- Return type:
None
-
received_packets:
list
[DataSegment
] List of received packets in the same order as
reception_times
.
-
reception_times:
list
[float
] List of data packet reception times (in increasing order) [s].
-
strategy:
DefaultTelemetryStrategy
Telemetry strategy.
Types
- chopchop.core.Time
Time [s].
The time scale is here given by the user, and depends on the context.
- chopchop.core.DataPacket
For now, we represent a data packet as a data segment.
- class chopchop.core.DataSegment(start_time, duration)[source]
Data segment.
-
duration:
float
Segment duration [s].
- property end_time: float
Segment end time [s].
- classmethod from_start_end(start_time, end_time)[source]
Create a data segment from start and end times.
- Return type:
- merge(other)[source]
Merge two segments.
- Parameters:
other (DataSegment) – Other segment.
- Returns:
Merged segment.
- Return type:
- Raises:
ValueError – If the segments do not overlap.
- overlaps(other)[source]
Check if the segment overlaps another segment.
- Parameters:
other (DataSegment) – Other segment.
- Returns:
True if the segments overlap.
- Return type:
bool
-
start_time:
float
Segment start time [s].
-
duration:
- chopchop.core.merge_segements(segments, *, ordered=False)[source]
Merge overlapping segments.
- Parameters:
segments (list[DataSegment]) – List of data segments.
ordered (bool) – If True, the segments are assumed to be ordered by start time.
- Returns:
List of merged data segments as a new list.
- Return type:
list[DataSegment]