tts_data_utils.multimission
Submodules
tts_data_utils.multimission.alarms
- class tts_data_utils.multimission.alarms.AlarmRecordContainer(raw_data=None, metadata=None, name=None, cast_fields=False, **kwargs)
Bases:
DataContainer- DATA_ITEM_CLS
alias of
AlarmRecordItem
- NAME = 'Alarm Records Container'
- property default_time_label
The default time field used for chronological operations.
- property repr_cols
Columns to be displayed in visual representations.
- class tts_data_utils.multimission.alarms.AlarmRecordItem(source, subcontainers=None, copy_data=False, cast_fields=False, fill=False, is_django=False, validate=True, default_dispo=None)
Bases:
DataItem- DICT_VALID_KEYS = [('Level', <class 'str'>), ('Type', <class 'str'>), ('Count', <class 'int'>), ('First Time (scet)', (<class 'datetime.datetime'>, None)), ('Last Time (scet)', (<class 'datetime.datetime'>, None)), ('First Time (sclk)', (<class 'float'>, None)), ('Last Time (sclk)', (<class 'float'>, None)), ('First Time (lst)', (<class 'datetime.datetime'>, None)), ('Last Time (lst)', (<class 'datetime.datetime'>, None)), ('Largest Violating Value', (<class 'float'>, <class 'int'>, <class 'str'>)), ('Smallest Violating Value', (<class 'float'>, <class 'int'>, <class 'str'>))]
- NAME = 'alarm record'
Name of the data item to be printed in some situations
- TIME_FORMATS = {'ert': '%Y-%jT%H:%M:%S.%f', 'lst': 'TBD', 'rct': '%Y-%jT%H:%M:%S.%f', 'scet': '%Y-%jT%H:%M:%S.%f'}
- property default_html_row_style
Returns row styling based on the EVR severity level.
- property level
The severity level of the event.
- property message
The descriptive log message.
- property name
The mnemonic identifier of the EVR.
- property time
Primary timestamp (SCET) for the event.
- property time_str
String-formatted representation of the event time.
tts_data_utils.multimission.eha
- class tts_data_utils.multimission.eha.EhaContainer(raw_data=None, metadata=None, name=None, cast_fields=False, **kwargs)
Bases:
DataContainerA specialized container for AMPCS time-series telemetry data.
JPL/NASA Context: While designed for AMPCS (Advanced Multi-Mission Operations System) data formats common at JPL, this serves as a general-purpose pattern for any NASA mission tracking time-stamped channel values.
- Parameters:
raw_data – List of dictionaries matching the EhaItem schema.
metadata – Header or session metadata from the telemetry source.
name – Override name for the container instance.
cast_fields – If True, attempts to convert raw inputs to EhaItem types.
- NAME = 'eha'
- property default_time_label
The default time field used for sorting and LAD operations.
- lad(time_type=None)
Calculates and returns the “Latest Available Data” (LAD).
The Concept: In a stream containing thousands of data points, you often only want to know the current state of the spacecraft. LAD collapses the time series by identifying every unique channel and returning only the record with the most recent timestamp for that channel.
- Parameters:
time_type (str) – The time field to use for determining ‘recency’ (e.g., ‘scet’, ‘ert’).
- Returns:
A new EhaContainer containing only the latest points.
- Return type:
- property repr_cols
The list of columns used for visual/table representations.
- unique_alarms()
- class tts_data_utils.multimission.eha.EhaItem(source, subcontainers=None, copy_data=False, cast_fields=False, fill=False, is_django=False, validate=True, default_dispo=None)
Bases:
DataItemA specialized DataItem representing a single telemetry point from an AMPCS-style stream.
The Concept: Engineering Health Analysis (EHA) data is the “pulse” of a spacecraft. Each item represents a single measurement (a channel) at a specific point in time. Because spacecraft data can have very different timestamps depending on where it is in space, this class tracks multiple timestamps (SCET, ERT, SCLK) to reconcile when an event happened at the spacecraft versus when it was received on Earth.
Data Logic (DN vs EU): Telemetry is often received as a raw “Data Number” (DN). This class stores the raw DN, its string representation, and—if calibration is applied—the “Engineering Unit” (EU), which is the physical value (e.g., Volts, Celsius).
- Parameters:
recordType (str) – Record Type for this data point.
sessionId (int) – AMPCS session ID for this data point.
sessionHost (str) – AMPCS session host for this data point.
channelId (str) – Unique identifier for the telemetry channel.
dssId – Deep Space Station identifier.
vcid (int) – Virtual Channel ID.
name (str) – Human-readable name of the channel.
module (str or None) – Flight Software Module that produced this channel.
ert (datetime) – Earth Receive Time (UTC).
scet (datetime) – Spacecraft Elapsed Time (UTC).
rct (datetime or None) – Range Corrected Time.
lst (str or None) – Local Mean Solar Time (Mars surface time).
sclk (float) – Spacecraft clock (seconds since epoch).
dn (int | float | str) – Raw Data Number.
dnStr (str) – String representation of the DN.
eu (float or None) – Calibrated Engineering Unit.
status (str) – Enumerated string value (e.g., ‘OK’, ‘TIMEOUT’).
dnAlarmState (str) – Is the raw value in an alarm state?
euAlarmState (str) – Is the engineering value in an alarm state?
realtime (bool) – True if received in realtime; False if played back from recorders.
type (str) – Channel source (e.g., ‘FSW’ or ‘SSE’).
- DICT_VALID_KEYS = [('recordType', <class 'str'>), ('sessionId', <class 'int'>), ('sessionHost', <class 'str'>), ('channelId', <class 'str'>), ('dssId', <class 'int'>), ('vcid', <class 'int'>), ('name', <class 'str'>), ('module', (<class 'str'>, None)), ('ert', <class 'datetime.datetime'>), ('scet', <class 'datetime.datetime'>), ('rct', (<class 'datetime.datetime'>, None)), ('lst', (<class 'str'>, None)), ('sclk', <class 'float'>), ('dn', (<class 'int'>, <class 'float'>, <class 'str'>)), ('dnStr', <class 'str'>), ('eu', (<class 'float'>, None)), ('status', <class 'str'>), ('dnAlarmState', <class 'str'>), ('euAlarmState', <class 'str'>), ('realtime', <class 'bool'>), ('type', <class 'str'>)]
- NAME = 'eha'
Name of the data item to be printed in some situations
- TIME_FORMATS = {'ert': '%Y-%jT%H:%M:%S.%f', 'scet': '%Y-%jT%H:%M:%S.%f'}
- property default_html_row_style
Returns default CSS styles for HTML table rows.
- property time
The primary timestamp for the telemetry point.
Usage Note: Currently defaults to scet (Spacecraft Elapsed Time).
- property time_str
Returns the primary timestamp formatted as a string.
tts_data_utils.multimission.evr
- class tts_data_utils.multimission.evr.EvrContainer(raw_data=None, metadata=None, name=None, cast_fields=False, **kwargs)
Bases:
DataContainerA specialized container for managing collections of Spacecraft Event Records (EVRs).
The Concept: In mission operations, EVRs are often the first place engineers look when something goes wrong. This container provides high-level utilities to manage these logs, most importantly the gaps() method, which verifies the completeness of the data stream.
Data Context: Designed to mimic AMPCS-like time-series logs, it follows standard NASA/JPL patterns for multi-mission event reporting.
- Parameters:
raw_data – List of dictionaries matching the EvrItem schema.
metadata – Header data for the telemetry set.
- LEVELS = ['DIAGNOSTIC', 'COMMAND', 'ACTIVITY_LO', 'ACTIVITY_HI', 'WARNING_LO', 'WARNING_HI', 'FATAL']
- NAME = 'evrs'
- property default_time_label
The default time field used for chronological operations.
- gaps()
Analyzes sequence IDs to identify missing data segments.
The Concept: EVRs are produced with sequential indices. If a dataset contains index 500 and 505 but is missing 501-504, a data gap has occurred (likely due to station handover or downlink issues). This method performs a gap audit across all severity levels to determine exactly what information is missing.
- Returns:
A container summarizing detected gaps.
- Return type:
- property repr_cols
Columns to be displayed in visual representations.
- class tts_data_utils.multimission.evr.EvrGapContainer(raw_data=None, metadata=None, name=None, cast_fields=False, **kwargs)
Bases:
DataContainerA container for auditing and reporting missing EVR data.
The Concept: In operations, unavoidable data gaps occur (e.g., atmospheric interference). This container provides the “Audit Trail” for those gaps, allowing operators to proceed with caution if they know critical ‘FATAL’ or ‘COMMAND’ level messages are missing from their current view.
- DATA_ITEM_CLS
alias of
EvrGapItem
- LEVELS = ['DIAGNOSTIC', 'COMMAND', 'ACTIVITY_LO', 'ACTIVITY_HI', 'WARNING_LO', 'WARNING_HI', 'FATAL', 'SIM ERROR']
- NAME = 'evr gap container'
- property default_time_label
Primary chronological key for sorting gaps.
- property repr_cols
Columns displayed in reports.
- class tts_data_utils.multimission.evr.EvrGapItem(source, subcontainers=None, copy_data=False, cast_fields=False, fill=False, is_django=False, validate=True, default_dispo=None)
Bases:
DataItemA record quantifying a missing segment of Event Report telemetry.
The Concept: Instead of representing a message, this item represents a “hole” in the spacecraft logs. It identifies the timestamps and sequence indices that the ground system expected to receive but did not. This is critical for determining if the team is making decisions based on incomplete telemetry.
- Parameters:
Level – The severity level of the missing reports.
(SCET) (End Time) – Time of the last successful report before the gap.
(SCET) – Time of the first successful report after the gap.
Index (Last Missing) – The sequence ID of the first missing report.
Index – The sequence ID of the last missing report.
EVRs (Total Missing) – Count of indices missing in this specific gap.
- DICT_VALID_KEYS = [('Level', <class 'str'>), ('Begin Time (SCET)', <class 'datetime.datetime'>), ('End Time (SCET)', <class 'datetime.datetime'>), ('Begin Time (ERT)', <class 'datetime.datetime'>), ('End Time (ERT)', <class 'datetime.datetime'>), ('First Missing Index', <class 'int'>), ('Last Missing Index', <class 'int'>), ('Total Missing EVRs', <class 'int'>)]
- NAME = 'evr gap'
Name of the data item to be printed in some situations
- TIME_FORMATS = {'Begin Time (ERT)': '%Y-%jT%H:%M:%S.%f', 'Begin Time (SCET)': '%Y-%jT%H:%M:%S.%f', 'End Time (ERT)': '%Y-%jT%H:%M:%S.%f', 'End Time (SCET)': '%Y-%jT%H:%M:%S.%f'}
- property default_html_row_style
Styles the row based on the severity of the missing EVRs.
- property level
The severity level for which this gap was detected.
- property time
The starting timestamp of the detected gap.
- property time_str
String representation of the gap’s beginning.
- class tts_data_utils.multimission.evr.EvrItem(source, subcontainers=None, copy_data=False, cast_fields=False, fill=False, is_django=False, validate=True, default_dispo=None)
Bases:
DataItemA specialized DataItem representing a single Event Record (EVR) from a spacecraft.
The Concept: Event Records are the log messages of a spacecraft’s Flight Software (FSW). Unlike telemetry channels (EHA), which provide continuous numerical data, EVRs provide discrete notifications about state changes, command executions, or other events. They are the primary tool used by operators to understand the logical flow of mission events.
How it works: Each EVR carries a severity level, a unique eventId, and a human-readable message. Because EVRs are critical for troubleshooting, they include high-fidelity timestamps (SCET/ERT) and sequence indices to ensure they can be reassembled chronologically, even if received out of order.
- Parameters:
recordType – The specific category of data point.
sessionId – AMPCS session ID for traceability.
sessionHost – The workstation/server host for the session.
name – The mnemonic name for the specific event type.
module – The specific FSW module that issued the report.
level – Severity level (e.g. ACTIVITY_LO, DIAGNOSTIC, WARNING_HI, FATAL).
eventId – A numeric hash uniquely identifying the event type.
vcid – Virtual Channel ID used for transmission.
dssId – Deep Space Station ID that received the data.
fromSse (bool) – True if originating from Ground System Equipment; False for FSW.
realtime (bool) – True if received in realtime; False if played back from recorder.
sclk – Spacecraft clock value at time of event.
scet – Spacecraft Elapsed Time (UTC).
ert – Earth Receive Time (UTC).
rct – Range Corrected Time.
lst – Local Mean Solar Time (string representation).
message – The descriptive log text.
metadata – Combined dictionary of keywords and values for event-specific data.
- DICT_VALID_KEYS = [('recordType', <class 'str'>), ('sessionId', <class 'int'>), ('sessionHost', <class 'str'>), ('name', <class 'str'>), ('module', <class 'str'>), ('level', <class 'str'>), ('eventId', <class 'int'>), ('vcid', <class 'int'>), ('dssId', <class 'int'>), ('fromSse', <class 'bool'>), ('realtime', <class 'bool'>), ('sclk', <class 'float'>), ('scet', <class 'datetime.datetime'>), ('ert', <class 'datetime.datetime'>), ('rct', (<class 'datetime.datetime'>, None)), ('lst', (<class 'datetime.datetime'>, None)), ('message', <class 'str'>), ('metadataKeywordList', <class 'str'>), ('metadataValuesList', <class 'str'>), ('metadata', <class 'dict'>)]
- NAME = 'evr'
Name of the data item to be printed in some situations
- TIME_FORMATS = {'ert': '%Y-%jT%H:%M:%S.%f', 'lst': 'TBD', 'rct': '%Y-%jT%H:%M:%S.%f', 'scet': '%Y-%jT%H:%M:%S.%f'}
- property default_html_row_style
Returns row styling based on the EVR severity level.
- is_warning()
Returns True if the event level is WARNING or higher.
- property level
The severity level of the event.
- property message
The descriptive log message.
- property name
The mnemonic identifier of the EVR.
- property time
Primary timestamp (SCET) for the event.
- property time_str
String-formatted representation of the event time.
tts_data_utils.multimission.evr_gaps
- class tts_data_utils.multimission.evr_gaps.EvrGapContainer(raw_data=None, metadata=None, name=None, nogaps=False, cast_fields=False, **kwargs)
Bases:
DataContainerA collection of EvrGapItems, typically used for telemetry health audits.
The Concept: When mission operators download data, they need to know if the “story” of the mission is complete. This container acts as an “Incompleteness Report.” By aggregating all detected gaps, it allows engineers to see at a glance if critical data (like ‘FATAL’ or ‘COMMAND’ level EVRs) failed to reach the ground.
Severity Filtering: The container uses a standard set of EVR severity levels to help color-code and prioritize which gaps need immediate attention (e.g., investigating a ground station outage).
- Parameters:
raw_data – A list of dicts representing detected EVR gaps.
metadata – Header information from the telemetry source.
name – Human-readable name for the container.
nogaps – A flag used during initialization (internal use).
cast_fields – If True, attempts to force data into the EvrGapItem schema.
- DATA_ITEM_CLS
alias of
EvrGapItem
- LEVELS = ['DIAGNOSTIC', 'COMMAND', 'ACTIVITY_LO', 'ACTIVITY_HI', 'WARNING_LO', 'WARNING_HI', 'FATAL']
- NAME = 'evr gap container'
- property default_time_label
The primary time key used for sorting gaps chronologically.
- property repr_cols
The specific columns to display in visual representations (HTML/Tables).
- class tts_data_utils.multimission.evr_gaps.EvrGapItem(source, subcontainers=None, copy_data=False, cast_fields=False, fill=False, is_django=False, validate=True, default_dispo=None)
Bases:
DataItemA specialized record representing a missing segment in Event Report (EVR) telemetry.
The Concept: Event Reports (EVRs) are the “logs” of a spacecraft, describing actions taken or states reached. Each EVR usually has a sequence index. If we see Index 100 followed immediately by Index 105, we have a “Gap.”
An EvrGapItem doesn’t represent a message from the spacecraft; it represents the absence of messages. It quantifies how much information was lost and during what timeframe, helping engineers determine the severity of data loss based on the importance of the missing data (its “Level”).
- Parameters:
Level (str) – The severity level of the EVRs that are missing.
Time (End) – The timestamp of the last successful EVR before the gap.
Time – The timestamp of the first successful EVR after the gap.
Index (Last Missing) – The sequence counter of the first missing report.
Index – The sequence counter of the last missing report.
EVRs (Total Missing) – The count of missing reports in this specific gap.
- DICT_VALID_KEYS = [('Level', <class 'str'>), ('Begin Time', <class 'datetime.datetime'>), ('End Time', <class 'datetime.datetime'>), ('First Missing Index', <class 'int'>), ('Last Missing Index', <class 'int'>), ('Total Missing EVRs', <class 'int'>)]
- NAME = 'evr gap'
Name of the data item to be printed in some situations
- TIME_FORMATS = {'Begin Time': '%Y-%jT%H:%M:%S.%f'}
- property default_html_row_style
Returns the CSS style mapping associated with the EVR Level severity.
- property level
Returns the severity level (e.g., FATAL, WARNING_HI) for this gap.
- property time
The start of the data gap window.
- property time_str
Returns a string representation of the gap’s beginning.
tts_data_utils.multimission.expected_lad
- class tts_data_utils.multimission.expected_lad.ExpectedLadContainer(raw_data=None, metadata=None, name=None, nogaps=False, cast_fields=False, **kwargs)
Bases:
DataContainerA collection of ExpectedLadItems, representing a full “Master Comparison List.”
The Concept: This container is typically loaded from a spreadsheet or a database containing the “Success Criteria” for a specific mission phase (e.g., Launch, Entry, Descent, and Landing).
Usage Note: When paired with an EhaContainer, this container allows the InvulnerableDataManager to perform “Self-Correcting” or “Auto-Auditing” reports, comparing real-time telemetry against these predefined requirements.
- DATA_ITEM_CLS
alias of
ExpectedLadItem
- NAME = 'Expected LAD'
- property default_time_label
The default time key used for sorting.
- property repr_cols
The list of columns intended for display in reports.
- class tts_data_utils.multimission.expected_lad.ExpectedLadItem(source, subcontainers=None, copy_data=False, cast_fields=False, fill=False, is_django=False, validate=True, default_dispo=None)
Bases:
DataItemA specialized DataItem defining the “Golden State” for a telemetry channel.
The Concept: In automated mission analysis, knowing the current value (LAD) of a channel is only half the battle. We also need to know what that value should be. An ExpectedLadItem acts as a requirements record or a “truth” item.
How it works: It pairs a Channel ID with an Expected Value and a Condition (e.g., ‘==’, ‘>’, ‘within tolerance’). When a telemetry report is generated, the system compares the Actual Value against these criteria to automatically generate headlines and disposition messages for operators.
Disposition Logic: The item includes fields for “Headline (True)” and “Headline (False)”. This allows the software to instantly draft a status report: if the condition is met, it uses the “True” text; if not, it uses the “False” text to flag the discrepancy.
- Parameters:
Group – Logical grouping for the measurement (e.g., ‘Power’, ‘Thermal’).
ID (Channel) – The telemetry mnemonic identifier.
Name (Display) – A human-readable label for the channel.
Type (Data) – The expected Python or Telemetry data type.
Value (Actual) – The baseline value used for comparison.
Condition – The mathematical logic used for evaluation (e.g., ‘GT’, ‘LT’, ‘EQ’).
Tolerance – Acceptable variance for numerical comparisons.
(True) (Disposition Message) – Text to display if the actual value matches the expected state.
(True) – Detailed explanation for a “Pass” state.
(False) (Disposition Message) – Text to display if the actual value violates the condition.
(False) – Detailed explanation for a “Fail” state.
Handling (Disposition) – Instructions on how to calculate or pull the actual value.
Handling – Instructions on how to process the pass/fail result.
Value – The real-time measurement pulled from the latest telemetry.
Time (Measurement) – The timestamp associated with the actual measurement.
- DICT_VALID_KEYS = [('Group', <class 'str'>), ('Channel ID', <class 'str'>), ('Display Name', <class 'str'>), ('Data Type', <class 'str'>), ('Expected Value', (<class 'int'>, <class 'float'>, <class 'str'>, None)), ('Condition', <class 'str'>), ('Tolerance', (<class 'int'>, <class 'float'>, <class 'str'>, None)), ('Headline (True)', (<class 'str'>, None)), ('Disposition Message (True)', (<class 'str'>, None)), ('Headline (False)', (<class 'str'>, None)), ('Disposition Message (False)', (<class 'str'>, None)), ('Derivation Handling', (<class 'str'>, None)), ('Disposition Handling', (<class 'str'>, None)), ('Actual Value', (<class 'int'>, <class 'float'>, <class 'str'>, None)), ('Measurement Time', (<class 'str'>, None))]
- NAME = 'Expected LAD Item'
Name of the data item to be printed in some situations
- TIME_FORMATS = {}
- property default_html_row_style
Returns row-level CSS styling (defaults to empty).
- is_warning()
Returns True if the check result represents a warning or fatal state.
- property level
The severity level associated with this check.
- property message
The result message generated by the comparison.
- property name
The channel identifier.
- property time
The SCET timestamp associated with the expectation or measurement.
- property time_str
String representation of the measurement timestamp.
tts_data_utils.multimission.planning_rule
- class tts_data_utils.multimission.planning_rule.PlanningRuleContainer(**kwargs)
Bases:
DataContainerThe Concept: This container acts as a digital “Rulebook.” When generating a mission plan or analyzing a sequence of commands, this container is used to look up the definitions and impacts of the rules being checked.
Mission Specifics: While named for OCO-2, the structure follows the standard patterns required for any mission using the Teamtools Studio planning validation workflow.
- DATA_ITEM_CLS
alias of
PlanningRuleItem
- DO_NOT_DIFF = []
Keys to ignore when running self.diff.
- NAME = 'Planning Rule'
- property repr_cols
The list of columns intended for display in rule reports.
- class tts_data_utils.multimission.planning_rule.PlanningRuleItem(source, subcontainers=None, copy_data=False, cast_fields=False, fill=False, is_django=False, validate=True, default_dispo=None)
Bases:
DataItemA specialized record representing a mission constraint or operational rule.
The Concept: Planning rules are the “laws” of a spacecraft’s schedule. They define what the spacecraft can and cannot do (e.g., “Do not point the instrument at the sun while the cover is open”).
A PlanningRuleItem captures the metadata of these constraints, allowing automated schedulers or human planners to understand the risk and impact associated with violating a specific mission requirement.
Database Integration: This class includes a DJANGO_KEY_MAP to handle the translation between database-friendly snake_case fields (used in the Planning Service) and report-friendly Title Case fields used in this library.
- Parameters:
ID (Rule) – Unique identifier for the planning constraint.
Category (Functional) – The subsystem the rule applies to (e.g., ‘ADCS’, ‘Power’).
Maturity (str) – The current status of the rule (e.g., ‘Draft’, ‘Flight Validated’).
Title (str) – A short, descriptive name for the rule.
Description (str) – The full text of the constraint.
Impact (Violation) – Explanation of what happens if this rule is broken.
Criticality (str) – Severity of the rule (e.g., ‘High’, ‘Mission Ending’).
- DICT_VALID_KEYS = [('Rule ID', <class 'str'>), ('Functional Category', <class 'str'>), ('Maturity', <class 'str'>), ('Title', <class 'str'>), ('Description', <class 'str'>), ('Violation Impact', <class 'str'>), ('Criticality', <class 'str'>)]
- DJANGO_KEY_MAP = {'criticality': 'Criticality', 'description': 'Description', 'functional_category': 'Functional Category', 'impact_of_violation': 'Violation Impact', 'maturity': 'Maturity', 'rule_id': 'Rule ID', 'title': 'Title', 'uuid': 'uuid'}
- TIME_FORMATS = {}
- time()
[Disabled]
Planning rules are static constraints and do not have a single point-in-time association.