ptr-editor 0.4.2__tar.gz → 0.4.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/PKG-INFO +3 -3
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/pyproject.toml +3 -3
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/xml/lxml_adapter.py +5 -4
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/juice_jsoc/itl/elements.py +23 -32
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/juice_jsoc/itl/jsoc-itl-schema.json +42 -16
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/juice_jsoc/opl/elements.py +55 -42
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/agm_config/agm_config.py +14 -7
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/elements/__init__.py +2 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/elements/attitude.py +7 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/elements/blocks.py +22 -2
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/elements/metadata.py +3 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/elements/offset.py +3 -0
- ptr_editor-0.4.3/src/ptr_editor/elements/offset_builder.py +377 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/elements/phase_angle.py +45 -24
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/elements/timeline.py +5 -1
- ptr_editor-0.4.3/src/ptr_editor/generators/base.py +51 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/html.py +98 -5
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/versioned_file_manager/file_info.py +1 -1
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/versioned_file_manager/manager.py +2 -2
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_solver/cached_solver.py +93 -6
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_solver/ptr_solver.py +211 -40
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_solver/solvable_mixin.py +4 -1
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/time_segments/plot.py +46 -6
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/time_segments/segment_mixin.py +12 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/time_segments/segments_collection_mixin.py +120 -28
- ptr_editor-0.4.2/src/ptr_editor/generators/base.py +0 -25
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/.gitignore +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/LICENSE +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/README.md +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/README.md +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/core/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/core/base_element.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/core/converter_factory.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/core/decorators.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/core/decorators_utils.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/core/field_transformer.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/core/fields.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/core/inspect.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/core/protocols.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/core/sentinels.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/core/type_utils.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/core/validator_factory.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/elements_registry.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/formatting.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/globals.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/pandas.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/resolution/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/resolution/registry.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/resolution/strategies.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/xml/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/xml/converter.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/xml/converters.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/xml/custom_disambiguator.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/xml/io.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/attrs_xml/xml/utils.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/juice_jsoc/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/juice_jsoc/apl/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/juice_jsoc/apl/elements.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/juice_jsoc/apl/jsoc-apl-schema.json +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/juice_jsoc/base.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/juice_jsoc/diffing.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/juice_jsoc/itl/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/juice_jsoc/opl/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/juice_jsoc/opl/csv.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/juice_jsoc/opl/jsoc-opl-schema.json +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/juice_jsoc/schema.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/juice_jsoc/utils.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/juice_opl/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_cli/README.md +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_cli/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_cli/commands/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_cli/commands/validate.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_cli/commands/version.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_cli/main.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_compare/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/accessors/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/accessors/accessor.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/accessors/attrs_dict_accessor.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/agm_config/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/agm_config/agm_utils.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/agm_config/html.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/agm_validator/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/agm_validator/agm_config_validator.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/context/README.md +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/context/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/context/defaults.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/context/presets.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/context/service_config.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/context/services.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/core/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/core/codenames_gen.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/core/logging.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/core/ptr_element.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/core/tree_utils.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/data/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/data/snippets.txt +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/diffing/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/diffing/diff_report.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/diffing/matcher.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/diffing/text_diff_result.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/diffing/timeline_differ_simple.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/diffing/visualize.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/elements/additional_elements.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/elements/agm_config.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/elements/array.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/elements/directions.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/elements/doc.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/elements/ref_typed_mixin.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/elements/surface.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/elements/units.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/elements/values.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/elements_extractor/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/extra/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/extra/add_block_comments.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/factory/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/factory/attitudes.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/factory/blocks.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/generators/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/generators/generators.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/generators/processor.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/io/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/io/ptr_converter_setup.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/io/simplified_converter.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/io/simplified_converter2.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/io/xml_formatting.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/py.typed +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/services/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/services/quick_access.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/services/resolution_strategies.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/spice_accessors/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/spice_accessors/directions.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/spice_accessors/eval_directions.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/templates/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/templates/html.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/templates/register.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/templates/template.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/validation/README.md +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/validation/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/validation/combinators.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/validation/html.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/validation/ptr_validators.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/validation/result.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/validation/ruleset_registry.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/validation/runner.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/validation/validator.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/versioned_file_manager/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_editor/versioned_file_manager/html.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/ptr_solver/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/time_segments/__init__.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/time_segments/config.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/time_segments/interface.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/time_segments/merging.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/time_segments/opl.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/time_segments/ops.py +0 -0
- {ptr_editor-0.4.2 → ptr_editor-0.4.3}/src/time_segments/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: ptr-editor
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.3
|
|
4
4
|
Summary: Utilities to edit PTR files.
|
|
5
5
|
Project-URL: documentation, https://luca-penasa.github.io/ptr-editor
|
|
6
6
|
Project-URL: homepage, https://luca-penasa.github.io/ptr-editor
|
|
@@ -34,7 +34,7 @@ Requires-Dist: plotly>=5
|
|
|
34
34
|
Requires-Dist: ptwrapper>=2.7.0
|
|
35
35
|
Requires-Dist: python-dotenv>=1.0.0
|
|
36
36
|
Requires-Dist: pyyaml>=6.0.3
|
|
37
|
-
Requires-Dist: quick-spice-manager>=0.0
|
|
37
|
+
Requires-Dist: quick-spice-manager>=0.2.0
|
|
38
38
|
Requires-Dist: requests-cache>=1.2.1
|
|
39
39
|
Requires-Dist: requests>=2.31.0
|
|
40
40
|
Requires-Dist: xmldiff>=2.7.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "ptr-editor"
|
|
3
|
-
version = "0.4.
|
|
3
|
+
version = "0.4.3"
|
|
4
4
|
description = "Utilities to edit PTR files."
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "Luca Penasa", email = "luca.penasa@inaf.it" },
|
|
@@ -40,7 +40,7 @@ dependencies = [
|
|
|
40
40
|
# "numpy<=1.26.4", # needed for ptwrapper to work properly: see https://gitlab.esa.int/juice-soc-public/python/ptwrapper/-/issues/2
|
|
41
41
|
"haikunator>=2.1.0",
|
|
42
42
|
"python-dotenv>=1.0.0",
|
|
43
|
-
"quick-spice-manager>=0.0
|
|
43
|
+
"quick-spice-manager>=0.2.0",
|
|
44
44
|
"xmldiff>=2.7.0",
|
|
45
45
|
"jsonschema>=4.0.0",
|
|
46
46
|
"requests>=2.31.0",
|
|
@@ -61,7 +61,7 @@ cli = [
|
|
|
61
61
|
"rich>=13.0.0",
|
|
62
62
|
]
|
|
63
63
|
spice = [
|
|
64
|
-
"quick-spice-manager>=0.0
|
|
64
|
+
"quick-spice-manager>=0.2.0",
|
|
65
65
|
"spiceypy>=5",
|
|
66
66
|
]
|
|
67
67
|
dev = [
|
|
@@ -81,10 +81,11 @@ def _lxml_element_to_dict(
|
|
|
81
81
|
d[f"@{k}"] = v
|
|
82
82
|
|
|
83
83
|
# Text content
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
# Use direct text nodes rather than only ``el.text`` so values are kept
|
|
85
|
+
# when comments appear before the actual payload (common in AGM <Param>).
|
|
86
|
+
text_nodes = [t for t in el.xpath("text()") if t and t.strip()]
|
|
87
|
+
if text_nodes:
|
|
88
|
+
d["#text"] = "".join(text_nodes).strip()
|
|
88
89
|
|
|
89
90
|
# Children – walk in document order
|
|
90
91
|
children_order: list[tuple[str, Any]] = []
|
|
@@ -13,6 +13,7 @@ from typing import Any, Literal, Self
|
|
|
13
13
|
|
|
14
14
|
import pandas as pd
|
|
15
15
|
from attrs import field
|
|
16
|
+
from cattrs.gen import make_dict_unstructure_fn, override
|
|
16
17
|
from cattrs.preconf.json import make_converter
|
|
17
18
|
from loguru import logger as log
|
|
18
19
|
|
|
@@ -154,8 +155,6 @@ class Configuration(ItlBaseItem):
|
|
|
154
155
|
|
|
155
156
|
# ITL JSON Schema used
|
|
156
157
|
json_schema_version: str | None = field(default=None)
|
|
157
|
-
# MIB version in use
|
|
158
|
-
mib_version: str | None = field(default=None)
|
|
159
158
|
# Flight Control Team User Event file (UEVT) in use
|
|
160
159
|
evt_fct: str | None = field(default=None)
|
|
161
160
|
# Flight Dynamics STP/MTP Event file (EVTC, EVTM) in use
|
|
@@ -178,14 +177,14 @@ class ValidityRange(ItlBaseItem):
|
|
|
178
177
|
class Header(ItlBaseItem):
|
|
179
178
|
"""ITL file header."""
|
|
180
179
|
|
|
181
|
-
# Filename matching pattern ^ITL_.*\.json$ or ^OTL_.*\.json$
|
|
182
|
-
filename: str = field()
|
|
183
180
|
# Creation date of the file in UTC format YYYY-MM-DDThh:mm:ss[.mmm]Z
|
|
184
181
|
creation_date: pd.Timestamp = field(
|
|
185
182
|
converter=lambda x: pd.Timestamp(x) if not isinstance(x, pd.Timestamp) else x,
|
|
186
183
|
)
|
|
187
184
|
# Author(s) of the file - Single author or Multiple authors
|
|
188
185
|
author: str | list[str] = field()
|
|
186
|
+
# Filename matching pattern ^ITL_.*\.json$ or ^OTL_.*\.json$
|
|
187
|
+
filename: str | None = field(default=None)
|
|
189
188
|
# Origin of the file
|
|
190
189
|
origin: str | None = field(default=None)
|
|
191
190
|
# Version of the file
|
|
@@ -294,8 +293,6 @@ padding:6px 0;border-top:1px solid #B2DFDB;border-bottom:1px solid #B2DFDB;">
|
|
|
294
293
|
config_parts = []
|
|
295
294
|
if self.configuration.json_schema_version:
|
|
296
295
|
config_parts.append(f"Schema: {self.configuration.json_schema_version}")
|
|
297
|
-
if self.configuration.mib_version:
|
|
298
|
-
config_parts.append(f"MIB: {self.configuration.mib_version}")
|
|
299
296
|
if self.configuration.evt_fct:
|
|
300
297
|
config_parts.append(f"EVT FCT: {self.configuration.evt_fct}")
|
|
301
298
|
if self.configuration.evt_fdy:
|
|
@@ -381,7 +378,14 @@ class TimelineItem(TimeSegmentMixin, ItlBaseItem):
|
|
|
381
378
|
converter=lambda x: str(x).upper(),
|
|
382
379
|
)
|
|
383
380
|
# Instrument/Unit responsible for the activity
|
|
384
|
-
instrument:
|
|
381
|
+
instrument: Literal[
|
|
382
|
+
"3GM", "RPWI", "GALA", "RIME", "JMAG",
|
|
383
|
+
"JANUS", "UVS", "MAJIS", "SWI",
|
|
384
|
+
"PEPLO", "PEPHI",
|
|
385
|
+
"NAVCAM", "RADEM",
|
|
386
|
+
"COMS",
|
|
387
|
+
"GENERIC", "SPC", "JUICE",
|
|
388
|
+
] = field()
|
|
385
389
|
# Name of the action or observation, must correspond
|
|
386
390
|
# to an observation definition or a modelled action
|
|
387
391
|
name: str = field()
|
|
@@ -397,16 +401,12 @@ class TimelineItem(TimeSegmentMixin, ItlBaseItem):
|
|
|
397
401
|
# Unique ID of the action or observation
|
|
398
402
|
unique_id: str | None = field(default=None)
|
|
399
403
|
# Indicates the observation type if it is PRIME or RIDER
|
|
400
|
-
observation_type: Literal["RIDER", "PRIME"] | None = field(
|
|
404
|
+
observation_type: Literal["RIDER", "PRIME", "OBSERVATION"] | None = field(
|
|
401
405
|
default=None,
|
|
402
406
|
)
|
|
403
407
|
# Target of the activity as a LID of a PDS4 Target
|
|
404
408
|
# (e.g., satellite.earth.moon) or array of targets
|
|
405
409
|
target: str | list[str] | None = field(default=None)
|
|
406
|
-
# Intended POR/group of the activity
|
|
407
|
-
stack: str | None = field(default=None)
|
|
408
|
-
# EPS construct to indicate the mode during the action (ACTIONs only)
|
|
409
|
-
mode: str | None = field(default=None)
|
|
410
410
|
# Action/Observation parameters as key-value pairs
|
|
411
411
|
parameters: dict[str, Any] | None = field(default=None)
|
|
412
412
|
# Optional power usage profile keyed by HH:MM:SS
|
|
@@ -617,26 +617,6 @@ padding:6px 0;border-top:1px solid #ddd;border-bottom:1px solid #ddd;">
|
|
|
617
617
|
</div>
|
|
618
618
|
</div>"""
|
|
619
619
|
|
|
620
|
-
# Stack
|
|
621
|
-
if self.stack:
|
|
622
|
-
html += (
|
|
623
|
-
"<div style='margin-bottom:8px;'>"
|
|
624
|
-
"<div style='font-weight:bold;color:#1976D2;"
|
|
625
|
-
f"font-size:13px;'>\U0001F4E6 Stack</div>"
|
|
626
|
-
f"<div style='color:#333;font-size:13px;"
|
|
627
|
-
f"margin-left:8px;'>{self.stack}</div></div>"
|
|
628
|
-
)
|
|
629
|
-
|
|
630
|
-
# Mode (ACTIONs only)
|
|
631
|
-
if self.mode:
|
|
632
|
-
html += (
|
|
633
|
-
"<div style='margin-bottom:8px;'>"
|
|
634
|
-
"<div style='font-weight:bold;color:#1976D2;"
|
|
635
|
-
f"font-size:13px;'>\u2699\uFE0F Mode</div>"
|
|
636
|
-
f"<div style='color:#333;font-size:13px;"
|
|
637
|
-
f"margin-left:8px;'>{self.mode}</div></div>"
|
|
638
|
-
)
|
|
639
|
-
|
|
640
620
|
# Pointing + pointing description
|
|
641
621
|
if self.pointing:
|
|
642
622
|
ptg_desc = ""
|
|
@@ -1084,6 +1064,17 @@ converter.register_unstructure_hook(str | list[str], _unstructure_str_or_list_re
|
|
|
1084
1064
|
# Register pandas hooks with UTC enforcement for ITL compliance
|
|
1085
1065
|
register_pandas_times_hooks(converter, enforce_utc=True)
|
|
1086
1066
|
|
|
1067
|
+
# Exclude internal/non-schema fields from JSON output
|
|
1068
|
+
converter.register_unstructure_hook(
|
|
1069
|
+
RelativeTime,
|
|
1070
|
+
make_dict_unstructure_fn(
|
|
1071
|
+
RelativeTime,
|
|
1072
|
+
converter,
|
|
1073
|
+
event_abs_time=override(omit=True),
|
|
1074
|
+
),
|
|
1075
|
+
)
|
|
1076
|
+
|
|
1077
|
+
|
|
1087
1078
|
|
|
1088
1079
|
# ---------------------------------------------------------------------------
|
|
1089
1080
|
# Convenience helpers
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"$id": "https://juicesoc.esac.esa.int/data/schemas/jsoc-itl-schema.json",
|
|
4
|
-
"title": "JUICE Science Operations Instrument Timeline Input File Schema
|
|
4
|
+
"title": "JUICE Science Operations Instrument Timeline Input File Schema v05",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"$defs": {
|
|
7
7
|
"dateTimeString": {
|
|
@@ -46,14 +46,43 @@
|
|
|
46
46
|
},
|
|
47
47
|
"target": {
|
|
48
48
|
"oneOf": [
|
|
49
|
+
{
|
|
50
|
+
"type": "null"
|
|
51
|
+
},
|
|
49
52
|
{
|
|
50
53
|
"type": "string",
|
|
54
|
+
"enum": [
|
|
55
|
+
"planet.earth",
|
|
56
|
+
"planet.jupiter",
|
|
57
|
+
"satellite.jupiter.io",
|
|
58
|
+
"satellite.jupiter.europa",
|
|
59
|
+
"satellite.jupiter.ganymede",
|
|
60
|
+
"satellite.jupiter.callisto",
|
|
61
|
+
"plasma_cloud.jupiter.io_torus",
|
|
62
|
+
"ring.jupiter.rings",
|
|
63
|
+
"planetary_system.jupiter_system",
|
|
64
|
+
"calibration_field.starfield",
|
|
65
|
+
"sc_maintenance"
|
|
66
|
+
],
|
|
51
67
|
"description": "Target of the activity as a LID of a PDS4 Target, i.e.: satellite.earth.moon"
|
|
52
68
|
},
|
|
53
69
|
{
|
|
54
70
|
"type": "array",
|
|
55
71
|
"items": {
|
|
56
|
-
"type": "string"
|
|
72
|
+
"type": "string",
|
|
73
|
+
"enum": [
|
|
74
|
+
"planet.earth",
|
|
75
|
+
"planet.jupiter",
|
|
76
|
+
"satellite.jupiter.io",
|
|
77
|
+
"satellite.jupiter.europa",
|
|
78
|
+
"satellite.jupiter.ganymede",
|
|
79
|
+
"satellite.jupiter.callisto",
|
|
80
|
+
"plasma_cloud.jupiter.io_torus",
|
|
81
|
+
"ring.jupiter.rings",
|
|
82
|
+
"planetary_system.jupiter_system",
|
|
83
|
+
"calibration_field.starfield",
|
|
84
|
+
"sc_maintenance"
|
|
85
|
+
]
|
|
57
86
|
},
|
|
58
87
|
"description": "Array of targets of the activity as a LID of a PDS4 Target, i.e.: satellite.earth.moon"
|
|
59
88
|
}
|
|
@@ -66,10 +95,6 @@
|
|
|
66
95
|
"type": "string",
|
|
67
96
|
"description": "ITL JSON Schema used"
|
|
68
97
|
},
|
|
69
|
-
"mib_version": {
|
|
70
|
-
"type": "string",
|
|
71
|
-
"description": "MIB version in use"
|
|
72
|
-
},
|
|
73
98
|
"evt_fct": {
|
|
74
99
|
"type": "string",
|
|
75
100
|
"description": "Flight Control Team User Event file (UEVT) in use"
|
|
@@ -136,6 +161,14 @@
|
|
|
136
161
|
},
|
|
137
162
|
"instrument": {
|
|
138
163
|
"type": "string",
|
|
164
|
+
"enum": [
|
|
165
|
+
"3GM", "RPWI", "GALA", "RIME", "JMAG",
|
|
166
|
+
"JANUS", "UVS", "MAJIS", "SWI",
|
|
167
|
+
"PEPLO", "PEPHI",
|
|
168
|
+
"NAVCAM", "RADEM",
|
|
169
|
+
"COMS",
|
|
170
|
+
"GENERIC", "SPC", "JUICE"
|
|
171
|
+
],
|
|
139
172
|
"description": "Instrument/Unit responsible for the activity"
|
|
140
173
|
},
|
|
141
174
|
"type": {
|
|
@@ -150,17 +183,15 @@
|
|
|
150
183
|
"type": "string",
|
|
151
184
|
"enum": [
|
|
152
185
|
"RIDER",
|
|
153
|
-
"PRIME"
|
|
186
|
+
"PRIME",
|
|
187
|
+
"OBSERVATION",
|
|
188
|
+
null
|
|
154
189
|
],
|
|
155
190
|
"description": "Indicates the observation type if it is PRIME or RIDER"
|
|
156
191
|
},
|
|
157
192
|
"target": {
|
|
158
193
|
"$ref": "#/$defs/target"
|
|
159
194
|
},
|
|
160
|
-
"stack": {
|
|
161
|
-
"type": "string",
|
|
162
|
-
"description": "Intended POR/group of the activity"
|
|
163
|
-
},
|
|
164
195
|
"start_time": {
|
|
165
196
|
"$ref": "#/$defs/absoluteOrRelativeTime",
|
|
166
197
|
"description": "Start time of the activity, either absolute or relative"
|
|
@@ -177,10 +208,6 @@
|
|
|
177
208
|
}
|
|
178
209
|
]
|
|
179
210
|
},
|
|
180
|
-
"mode": {
|
|
181
|
-
"type": "string",
|
|
182
|
-
"description": "EPS construct to indicate the mode during the action"
|
|
183
|
-
},
|
|
184
211
|
"parameters": {
|
|
185
212
|
"type": "object",
|
|
186
213
|
"description": "Action/Observation parameters as an array of parameter name and value pairs",
|
|
@@ -404,7 +431,6 @@
|
|
|
404
431
|
}
|
|
405
432
|
},
|
|
406
433
|
"required": [
|
|
407
|
-
"filename",
|
|
408
434
|
"creation_date",
|
|
409
435
|
"author"
|
|
410
436
|
],
|
|
@@ -46,7 +46,6 @@ def fetch_schema(url: str = OPL_SCHEMA_URL, *, force_refresh: bool = False) -> d
|
|
|
46
46
|
return _fetch_schema_generic(_LOCAL_OPL_SCHEMA_PATH, force_refresh=force_refresh)
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
|
|
50
49
|
def validate_opl_json(
|
|
51
50
|
data: dict | str | Path,
|
|
52
51
|
schema: dict | None = None,
|
|
@@ -66,14 +65,22 @@ def validate_opl_json(
|
|
|
66
65
|
Tuple of (is_valid, messages) where messages include errors and warnings
|
|
67
66
|
|
|
68
67
|
Example:
|
|
69
|
-
>>> is_valid, errors =
|
|
68
|
+
>>> is_valid, errors = (
|
|
69
|
+
... validate_opl_json(
|
|
70
|
+
... "opl.json"
|
|
71
|
+
... )
|
|
72
|
+
... )
|
|
70
73
|
>>> if not is_valid:
|
|
71
|
-
... for
|
|
74
|
+
... for (
|
|
75
|
+
... error
|
|
76
|
+
... ) in errors:
|
|
72
77
|
... print(error)
|
|
73
78
|
"""
|
|
74
79
|
if schema is None:
|
|
75
80
|
schema = fetch_schema()
|
|
76
|
-
return validate_json(
|
|
81
|
+
return validate_json(
|
|
82
|
+
data, schema, "OPL", strict=strict, warn_extra_fields=warn_extra_fields
|
|
83
|
+
)
|
|
77
84
|
|
|
78
85
|
|
|
79
86
|
class OplBaseItem(JsocBaseItem):
|
|
@@ -96,7 +103,6 @@ class OplBaseItem(JsocBaseItem):
|
|
|
96
103
|
return json.dumps(data, indent=indent, ensure_ascii=False)
|
|
97
104
|
|
|
98
105
|
|
|
99
|
-
|
|
100
106
|
@element_define
|
|
101
107
|
class RelativeTime(OplBaseItem):
|
|
102
108
|
"""Relative time specification."""
|
|
@@ -135,10 +141,7 @@ class RelativeTime(OplBaseItem):
|
|
|
135
141
|
_enforce_naive_utc_timestamp(pd.Timestamp(value)) - self.event_abs_time
|
|
136
142
|
)
|
|
137
143
|
else:
|
|
138
|
-
msg =
|
|
139
|
-
"Cannot set time on RelativeTime"
|
|
140
|
-
" without event_abs_time defined."
|
|
141
|
-
)
|
|
144
|
+
msg = "Cannot set time on RelativeTime without event_abs_time defined."
|
|
142
145
|
raise ValueError(msg)
|
|
143
146
|
|
|
144
147
|
|
|
@@ -223,9 +226,7 @@ class Header(OplBaseItem):
|
|
|
223
226
|
end = self.validity_range.end_time or "N/A"
|
|
224
227
|
validity_str = f"{start} → {end}"
|
|
225
228
|
|
|
226
|
-
lbl =
|
|
227
|
-
"font-weight:bold;color:#1976D2;font-size:13px;"
|
|
228
|
-
)
|
|
229
|
+
lbl = "font-weight:bold;color:#1976D2;font-size:13px;"
|
|
229
230
|
val = "color:#333;font-size:13px;"
|
|
230
231
|
mono = "font-family:'Courier New',monospace;word-break:break-all;"
|
|
231
232
|
|
|
@@ -235,7 +236,7 @@ padding:12px;background:#fff3e0;\
|
|
|
235
236
|
font-family:'Segoe UI',Arial,sans-serif;max-width:900px;">
|
|
236
237
|
<div style="margin-bottom:12px;">
|
|
237
238
|
<div style="font-size:16px;font-weight:bold;color:#E65100;">\
|
|
238
|
-
\
|
|
239
|
+
\U0001f4a1 OPL Header</div>
|
|
239
240
|
</div>
|
|
240
241
|
<div style="display:grid;grid-template-columns:1fr 1fr;\
|
|
241
242
|
gap:4px 12px;margin-bottom:10px;\
|
|
@@ -250,11 +251,11 @@ padding:6px 0;border-top:1px solid #FFE0B2;border-bottom:1px solid #FFE0B2;">
|
|
|
250
251
|
</div>
|
|
251
252
|
<div>
|
|
252
253
|
<div style="{lbl}📄 Filename</div>
|
|
253
|
-
<div style="{val}{mono}">{self.filename or
|
|
254
|
+
<div style="{val}{mono}">{self.filename or "N/A"}</div>
|
|
254
255
|
</div>
|
|
255
256
|
<div>
|
|
256
257
|
<div style="{lbl}🏷️ Version</div>
|
|
257
|
-
<div style="{val}">{self.version or
|
|
258
|
+
<div style="{val}">{self.version or "N/A"}</div>
|
|
258
259
|
</div>
|
|
259
260
|
</div>"""
|
|
260
261
|
|
|
@@ -513,8 +514,7 @@ class TimelineItem(TimeSegmentMixin, OplBaseItem):
|
|
|
513
514
|
}
|
|
514
515
|
type_bg = type_colors.get(self.type, "#616161")
|
|
515
516
|
type_badge = (
|
|
516
|
-
f"<span style='{badge_style}background:{type_bg};'>"
|
|
517
|
-
f"{self.type}</span>"
|
|
517
|
+
f"<span style='{badge_style}background:{type_bg};'>{self.type}</span>"
|
|
518
518
|
)
|
|
519
519
|
obs_badge = ""
|
|
520
520
|
if self.observation_type:
|
|
@@ -528,18 +528,18 @@ class TimelineItem(TimeSegmentMixin, OplBaseItem):
|
|
|
528
528
|
designer_flag = (
|
|
529
529
|
f"<span style='{badge_style}background:#FF6F00;'"
|
|
530
530
|
" title='Pointing designer requested'>"
|
|
531
|
-
"\
|
|
531
|
+
"\U0001f3af Designer</span>"
|
|
532
532
|
)
|
|
533
533
|
elif self.pointing_designer is False:
|
|
534
534
|
designer_flag = (
|
|
535
535
|
f"<span style='{badge_style}background:#9E9E9E;"
|
|
536
536
|
"text-decoration:line-through;'"
|
|
537
537
|
" title='Pointing designer NOT requested'>"
|
|
538
|
-
"\
|
|
538
|
+
"\U0001f3af Designer</span>"
|
|
539
539
|
)
|
|
540
540
|
instrument_badge = (
|
|
541
541
|
f"<span style='{badge_style}background:#00695C;'>"
|
|
542
|
-
f"\
|
|
542
|
+
f"\U0001f52d {self.instrument}</span>"
|
|
543
543
|
)
|
|
544
544
|
|
|
545
545
|
# --- duration ---
|
|
@@ -573,12 +573,10 @@ class TimelineItem(TimeSegmentMixin, OplBaseItem):
|
|
|
573
573
|
if target_display != "N/A":
|
|
574
574
|
target_badge = (
|
|
575
575
|
f"<span style='{badge_style}background:#4E342E;'>"
|
|
576
|
-
f"\
|
|
576
|
+
f"\U0001f3af {target_display}</span>"
|
|
577
577
|
)
|
|
578
578
|
|
|
579
|
-
lbl =
|
|
580
|
-
"font-weight:bold;color:#1976D2;font-size:13px;"
|
|
581
|
-
)
|
|
579
|
+
lbl = "font-weight:bold;color:#1976D2;font-size:13px;"
|
|
582
580
|
val = "color:#333;font-size:13px;"
|
|
583
581
|
mono = "font-family:'Courier New',monospace;"
|
|
584
582
|
|
|
@@ -594,7 +592,7 @@ flex-wrap:wrap;">
|
|
|
594
592
|
style="background:none;border:1px solid #bbb;border-radius:3px;\
|
|
595
593
|
cursor:pointer;font-size:11px;padding:1px 5px;\
|
|
596
594
|
vertical-align:middle;color:#888;" \
|
|
597
|
-
title="Copy ID to clipboard">\
|
|
595
|
+
title="Copy ID to clipboard">\U0001f4cb</button>\
|
|
598
596
|
<span style="color:#444;font-size:11px;{mono}\
|
|
599
597
|
word-break:break-all;" title="Unique ID">{uid}</span>
|
|
600
598
|
{type_badge}{obs_badge}{designer_flag}
|
|
@@ -610,15 +608,15 @@ word-break:break-all;" title="Unique ID">{uid}</span>
|
|
|
610
608
|
gap:4px 12px;margin-bottom:10px;\
|
|
611
609
|
padding:6px 0;border-top:1px solid #ddd;border-bottom:1px solid #ddd;">
|
|
612
610
|
<div>
|
|
613
|
-
<div style="{lbl}">\
|
|
611
|
+
<div style="{lbl}">\u25b6 Start</div>
|
|
614
612
|
<div style="{val}{mono}">{self.start_time}</div>
|
|
615
613
|
</div>
|
|
616
614
|
<div>
|
|
617
|
-
<div style="{lbl}">\
|
|
615
|
+
<div style="{lbl}">\u25a0 End</div>
|
|
618
616
|
<div style="{val}{mono}">{self.end_time}</div>
|
|
619
617
|
</div>
|
|
620
618
|
<div>
|
|
621
|
-
<div style="{lbl}">\
|
|
619
|
+
<div style="{lbl}">\u23f1 Duration</div>
|
|
622
620
|
<div style="{val}{mono}">{duration_str}</div>
|
|
623
621
|
</div>
|
|
624
622
|
</div>"""
|
|
@@ -636,7 +634,7 @@ padding:6px 0;border-top:1px solid #ddd;border-bottom:1px solid #ddd;">
|
|
|
636
634
|
html += (
|
|
637
635
|
"<div style='margin-bottom:8px;'>"
|
|
638
636
|
"<div style='font-weight:bold;color:#1976D2;"
|
|
639
|
-
f"font-size:13px;'>\
|
|
637
|
+
f"font-size:13px;'>\U0001f9ed Pointing</div>"
|
|
640
638
|
f"<div style='color:#333;font-size:13px;"
|
|
641
639
|
f"margin-left:8px;'>{self.pointing}</div>"
|
|
642
640
|
f"{ptg_desc}</div>"
|
|
@@ -645,7 +643,7 @@ padding:6px 0;border-top:1px solid #ddd;border-bottom:1px solid #ddd;">
|
|
|
645
643
|
html += (
|
|
646
644
|
"<div style='margin-bottom:8px;'>"
|
|
647
645
|
"<div style='font-weight:bold;color:#1976D2;"
|
|
648
|
-
f"font-size:13px;'>\
|
|
646
|
+
f"font-size:13px;'>\U0001f9ed Pointing</div>"
|
|
649
647
|
f"<div style='color:#555;font-size:13px;"
|
|
650
648
|
f"margin-left:8px;line-height:1.4;'>"
|
|
651
649
|
f"{self.pointing_description}</div></div>"
|
|
@@ -653,17 +651,15 @@ padding:6px 0;border-top:1px solid #ddd;border-bottom:1px solid #ddd;">
|
|
|
653
651
|
|
|
654
652
|
_optional_sections: list[tuple[str, str | None, str]] = [
|
|
655
653
|
(
|
|
656
|
-
"\
|
|
654
|
+
"\U0001f4c5 Scheduling Rules",
|
|
657
655
|
self.scheduling_rules,
|
|
658
656
|
"#555",
|
|
659
657
|
),
|
|
660
|
-
("\
|
|
658
|
+
("\U0001f4ac Comment", self.comment, "#555"),
|
|
661
659
|
]
|
|
662
660
|
for label, value, color in _optional_sections:
|
|
663
661
|
if value:
|
|
664
|
-
italic =
|
|
665
|
-
"font-style:italic;" if "Comment" in label else ""
|
|
666
|
-
)
|
|
662
|
+
italic = "font-style:italic;" if "Comment" in label else ""
|
|
667
663
|
html += (
|
|
668
664
|
f"<div style='margin-bottom:8px;'>"
|
|
669
665
|
f"<div style='font-weight:bold;color:#1976D2;"
|
|
@@ -692,17 +688,18 @@ padding:6px 0;border-top:1px solid #ddd;border-bottom:1px solid #ddd;">
|
|
|
692
688
|
# --- profiles ---
|
|
693
689
|
if self.power_profile:
|
|
694
690
|
html += self._format_profile_html(
|
|
695
|
-
self.power_profile,
|
|
691
|
+
self.power_profile,
|
|
692
|
+
"\u26a1 Power Profile",
|
|
696
693
|
)
|
|
697
694
|
if self.data_rate_profile:
|
|
698
695
|
html += self._format_profile_html(
|
|
699
696
|
self.data_rate_profile,
|
|
700
|
-
"\
|
|
697
|
+
"\U0001f4e1 Data Rate Profile",
|
|
701
698
|
)
|
|
702
699
|
if self.data_volume_profile:
|
|
703
700
|
html += self._format_profile_html(
|
|
704
701
|
self.data_volume_profile,
|
|
705
|
-
"\
|
|
702
|
+
"\U0001f4be Data Volume Profile",
|
|
706
703
|
)
|
|
707
704
|
|
|
708
705
|
# --- instrument_area ---
|
|
@@ -710,12 +707,14 @@ padding:6px 0;border-top:1px solid #ddd;border-bottom:1px solid #ddd;">
|
|
|
710
707
|
import json as _json
|
|
711
708
|
|
|
712
709
|
area_json = _json.dumps(
|
|
713
|
-
self.instrument_area,
|
|
710
|
+
self.instrument_area,
|
|
711
|
+
indent=2,
|
|
712
|
+
ensure_ascii=False,
|
|
714
713
|
)
|
|
715
714
|
html += (
|
|
716
715
|
"<div style='margin-bottom:8px;'>"
|
|
717
716
|
"<div style='font-weight:bold;color:#1976D2;"
|
|
718
|
-
"font-size:14px;'>\
|
|
717
|
+
"font-size:14px;'>\U0001f4e6 Instrument Area</div>"
|
|
719
718
|
"<pre style='margin-left:8px;font-size:12px;"
|
|
720
719
|
"background:#e8e8e8;padding:6px;border-radius:4px;"
|
|
721
720
|
f"overflow-x:auto;'>{area_json}</pre></div>"
|
|
@@ -734,8 +733,6 @@ class Timeline(SegmentsCollectionMixin[TimelineItem], OplBaseItem):
|
|
|
734
733
|
# Array of timeline items (observations and actions)
|
|
735
734
|
timeline: list[TimelineItem] = field(factory=list)
|
|
736
735
|
|
|
737
|
-
|
|
738
|
-
|
|
739
736
|
@property
|
|
740
737
|
def _segments_(self) -> list[TimelineItem]:
|
|
741
738
|
"""Return timeline items as segments for SegmentsCollectionMixin."""
|
|
@@ -882,6 +879,22 @@ class Timeline(SegmentsCollectionMixin[TimelineItem], OplBaseItem):
|
|
|
882
879
|
from .csv import timeline_from_csv_file
|
|
883
880
|
|
|
884
881
|
return timeline_from_csv_file(path, has_header=has_header)
|
|
882
|
+
|
|
883
|
+
def filter_by_instrument(self, instrument: str) -> "Timeline":
|
|
884
|
+
"""Filter timeline items by instrument.
|
|
885
|
+
|
|
886
|
+
Just a quick helper that calls filter_by_attribute with the "instrument" attribute.
|
|
887
|
+
|
|
888
|
+
Args:
|
|
889
|
+
instrument: Instrument name to filter by (e.g., "3GM", "RPWI")
|
|
890
|
+
|
|
891
|
+
Returns:
|
|
892
|
+
New Timeline object containing only items for the specified instrument
|
|
893
|
+
|
|
894
|
+
Example:
|
|
895
|
+
>>> rpwi_timeline = timeline.filter_by_instrument("RPWI")
|
|
896
|
+
"""
|
|
897
|
+
return self.filter_by_attribute("instrument", instrument)
|
|
885
898
|
|
|
886
899
|
@classmethod
|
|
887
900
|
def from_json_file(
|
|
@@ -27,14 +27,23 @@ targets_to_agm_dir_shortnames = {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
|
|
30
|
+
def _get_agm_config_dir() -> Path:
|
|
31
|
+
"""Resolve the ptwrapper AGM config subdirectory.
|
|
32
|
+
|
|
33
|
+
The directory was renamed from ``age`` to ``agm`` in ptwrapper at around 2.6.
|
|
34
|
+
Falls back to ``age`` when the ``agm`` directory does not exist.
|
|
35
|
+
"""
|
|
36
|
+
base = Path(ptwrapper.__file__).parent / "config"
|
|
37
|
+
agm = base / "agm"
|
|
38
|
+
return agm if agm.exists() else base / "age"
|
|
39
|
+
|
|
40
|
+
|
|
30
41
|
def _get_agm_fix_definition_file() -> Path:
|
|
31
42
|
"""
|
|
32
43
|
Get the path to the fixed definitions XML file, for the currently installed ptwrapper.
|
|
33
44
|
"""
|
|
34
45
|
|
|
35
|
-
return (
|
|
36
|
-
Path(ptwrapper.__file__).parent / "config/agm/cfg_agm_jui_fixed_definitions.xml"
|
|
37
|
-
)
|
|
46
|
+
return _get_agm_config_dir() / "cfg_agm_jui_fixed_definitions.xml"
|
|
38
47
|
|
|
39
48
|
|
|
40
49
|
def _get_agm_config_file() -> Path:
|
|
@@ -42,7 +51,7 @@ def _get_agm_config_file() -> Path:
|
|
|
42
51
|
Get the AGM configuration with fixed definitions, for the currently installed ptwrapper.
|
|
43
52
|
"""
|
|
44
53
|
|
|
45
|
-
return
|
|
54
|
+
return _get_agm_config_dir() / "cfg_agm_jui.xml"
|
|
46
55
|
|
|
47
56
|
|
|
48
57
|
def _get_agm_predefined_blocks_file() -> Path:
|
|
@@ -50,9 +59,7 @@ def _get_agm_predefined_blocks_file() -> Path:
|
|
|
50
59
|
Get the path to the predefined blocks XML file, for the currently installed ptwrapper.
|
|
51
60
|
"""
|
|
52
61
|
|
|
53
|
-
return (
|
|
54
|
-
Path(ptwrapper.__file__).parent / "config/agm/cfg_agm_jui_predefined_block.xml"
|
|
55
|
-
)
|
|
62
|
+
return _get_agm_config_dir() / "cfg_agm_jui_predefined_block.xml"
|
|
56
63
|
|
|
57
64
|
|
|
58
65
|
@define
|
|
@@ -85,6 +85,7 @@ from .offset import (
|
|
|
85
85
|
RasterOffsetAngles,
|
|
86
86
|
ScanOffsetAngles,
|
|
87
87
|
)
|
|
88
|
+
from .offset_builder import MeridianStareBuilder
|
|
88
89
|
|
|
89
90
|
# Phase angle elements
|
|
90
91
|
from .phase_angle import (
|
|
@@ -178,6 +179,7 @@ __all__ = [
|
|
|
178
179
|
# Offsets
|
|
179
180
|
"CustomOffsetAngles",
|
|
180
181
|
"FixedOffsetAngles",
|
|
182
|
+
"MeridianStareBuilder",
|
|
181
183
|
"OffsetAngles",
|
|
182
184
|
"RasterOffsetAngles",
|
|
183
185
|
"ScanOffsetAngles",
|
|
@@ -125,6 +125,13 @@ class Attitude(BaseAttitude):
|
|
|
125
125
|
"""
|
|
126
126
|
return self.offset_ref_axis is not None and self.offset_angles is not None
|
|
127
127
|
|
|
128
|
+
@property
|
|
129
|
+
def is_custom(self) -> bool:
|
|
130
|
+
"""True if the attitude has a CustomOffsetAngles offpointing."""
|
|
131
|
+
from .offset import CustomOffsetAngles # noqa: PLC0415
|
|
132
|
+
|
|
133
|
+
return isinstance(self.offset_angles, CustomOffsetAngles)
|
|
134
|
+
|
|
128
135
|
|
|
129
136
|
@element_define
|
|
130
137
|
class TrackAttitude(Attitude):
|