juice-simphony 0.1.0rc1__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.
Files changed (132) hide show
  1. juice_simphony-0.1.0rc1/LICENSE.md +1 -0
  2. juice_simphony-0.1.0rc1/PKG-INFO +126 -0
  3. juice_simphony-0.1.0rc1/README.md +106 -0
  4. juice_simphony-0.1.0rc1/pyproject.toml +27 -0
  5. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/__init__.py +0 -0
  6. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/attitude/__init__.py +0 -0
  7. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/attitude/attitude.py +32 -0
  8. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/attitude/xml_attitude.py +147 -0
  9. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/common/__init__.py +0 -0
  10. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/common/fileHandle.py +59 -0
  11. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/common/fileHandleEps.py +33 -0
  12. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/common/fileHandleEps1.py +30 -0
  13. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/common/fileHandleTml.py +77 -0
  14. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/common/fileHandleXML.py +59 -0
  15. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/common/fileName.py +58 -0
  16. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/common/fileTemplate.py +57 -0
  17. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/common/utils.py +47 -0
  18. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/config/__init__.py +0 -0
  19. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/config/agmCfgFiles.py +20 -0
  20. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/config/agmIniFile.py +19 -0
  21. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/config/configuration.py +357 -0
  22. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/config/epsEvtDefFile.py +35 -0
  23. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/config/epsFile.py +19 -0
  24. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/config/mappsIniFile.py +19 -0
  25. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/definitions/__init__.py +0 -0
  26. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/definitions/definitions.py +100 -0
  27. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/definitions/toplevelObsDef.py +18 -0
  28. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/environment/__init__.py +0 -0
  29. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/environment/environment.py +302 -0
  30. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/environment/trajectory.py +193 -0
  31. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/graphicalPath.py +76 -0
  32. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/main.py +120 -0
  33. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/modelling/__init__.py +0 -0
  34. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/modelling/experiment/experiment.py +34 -0
  35. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/modelling/experiment/topLevelExpEdf.py +50 -0
  36. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/modelling/modelling.py +56 -0
  37. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/modelling/toplevelEdf.py +18 -0
  38. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/root/__init__.py +0 -0
  39. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/root/seg_conf.py +251 -0
  40. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/root/toplevelEvt.py +59 -0
  41. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/root/toplevelItl.py +65 -0
  42. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/scenario.py +263 -0
  43. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/timeline/__init__.py +0 -0
  44. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/timeline/inst_timeline.py +50 -0
  45. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/timeline/inst_top_timeline.py +35 -0
  46. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/timeline/juice_comms.py +79 -0
  47. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/timeline/plat_prof_timeline.py +56 -0
  48. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/timeline/segmentation.py +79 -0
  49. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/timeline/timeline.py +71 -0
  50. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/Scenario/timeline/timelineFile.py +41 -0
  51. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/SegmentationImporter/SegmentationImporter.py +1458 -0
  52. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/SegmentationImporter/__init__.py +0 -0
  53. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/SegmentationImporter/mapps_io/__init__.py +1 -0
  54. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/SegmentationImporter/mapps_io/common/fileHandle.py +59 -0
  55. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/SegmentationImporter/mapps_io/common/fileHandleEps.py +45 -0
  56. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/SegmentationImporter/mapps_io/common/fileName.py +46 -0
  57. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/SegmentationImporter/mapps_io/instToplevelObsDef.py +31 -0
  58. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/SegmentationImporter/mapps_io/obsDefinition.py +85 -0
  59. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/SegmentationImporter/mapps_io/obsDefinitions.py +61 -0
  60. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/SegmentationImporter/mapps_io/profileCsv.py +42 -0
  61. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/SegmentationImporter/mapps_io/segDefinition.py +70 -0
  62. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/SegmentationImporter/mapps_io/timeline.py +90 -0
  63. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/SegmentationImporter/mapps_io/toplevelDefs.py +30 -0
  64. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/SegmentationImporter/mapps_io/toplevelObsDef.py +31 -0
  65. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/SegmentationImporter/restApiPlan.py +49 -0
  66. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/SegmentationImporter/segmentation_profiles.py +841 -0
  67. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/SegmentationImporter/shtRestClient.py +587 -0
  68. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/__init__.py +0 -0
  69. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/.gitignore +10 -0
  70. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/CMakeLists.txt +34 -0
  71. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/FileGeneration/CMakeLists.txt +48 -0
  72. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/FileGeneration/EventsFile.cpp +128 -0
  73. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/FileGeneration/EventsFile.hpp +17 -0
  74. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/FileGeneration/OrbitDataFile.cpp +179 -0
  75. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/FileGeneration/OrbitDataFile.hpp +57 -0
  76. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/FileGeneration/OrbitDefFile.cpp +188 -0
  77. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/FileGeneration/OrbitDefFile.hpp +58 -0
  78. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/FileGeneration/TrajectoryEngine.cpp +131 -0
  79. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/FileGeneration/TrajectoryEngine.hpp +59 -0
  80. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/README.md +26 -0
  81. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/Utils/CMakeLists.txt +15 -0
  82. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/Utils/CommonTypes.hpp +37 -0
  83. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/Utils/Conversions.hpp +36 -0
  84. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/Utils/TimeUtils.cpp +1160 -0
  85. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/Utils/TimeUtils.hpp +196 -0
  86. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/Utils/rapidcsv.hpp +1431 -0
  87. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceCK.h +155 -0
  88. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceCel.h +441 -0
  89. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceDLA.h +260 -0
  90. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceDSK.h +903 -0
  91. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceDtl.h +251 -0
  92. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceEK.h +448 -0
  93. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceEll.h +115 -0
  94. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceErr.h +141 -0
  95. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceFrm.h +202 -0
  96. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceGF.h +345 -0
  97. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceOccult.h +147 -0
  98. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceOsc.h +86 -0
  99. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpicePln.h +106 -0
  100. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceSPK.h +128 -0
  101. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceSrf.h +94 -0
  102. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceUsr.h +278 -0
  103. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceZad.h +209 -0
  104. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceZdf.h +260 -0
  105. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceZfc.h +13803 -0
  106. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceZim.h +1677 -0
  107. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceZmc.h +989 -0
  108. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceZpl.h +117 -0
  109. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceZpr.h +4725 -0
  110. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceZrnm.h +82 -0
  111. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/SpiceZst.h +199 -0
  112. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/f2c.h +683 -0
  113. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/f2cMang.h +390 -0
  114. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/fio.h +107 -0
  115. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/fmt.h +100 -0
  116. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/fp.h +28 -0
  117. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/lio.h +74 -0
  118. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/rawio.h +41 -0
  119. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/signal1.h +118 -0
  120. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/zzalloc.h +133 -0
  121. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/include/zzerror.h +86 -0
  122. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/lib/linux/cspice.a +0 -0
  123. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/cspice/lib/mac/cspice.a +0 -0
  124. juice_simphony-0.1.0rc1/src/juice_simphony/CompositionEngine/trajectory_engine/testStub.cpp +26 -0
  125. juice_simphony-0.1.0rc1/src/juice_simphony/__init__.py +0 -0
  126. juice_simphony-0.1.0rc1/src/juice_simphony/cli.py +21 -0
  127. juice_simphony-0.1.0rc1/src/juice_simphony/commons/__init__.py +0 -0
  128. juice_simphony-0.1.0rc1/src/juice_simphony/commons/commons.py +55 -0
  129. juice_simphony-0.1.0rc1/src/juice_simphony/juice_simphony.py +87 -0
  130. juice_simphony-0.1.0rc1/src/juice_simphony/poetry.lock +131 -0
  131. juice_simphony-0.1.0rc1/src/juice_simphony/spice_interface/__init__.py +0 -0
  132. juice_simphony-0.1.0rc1/src/juice_simphony/spice_interface/spice_interface.py +194 -0
@@ -0,0 +1 @@
1
+ Text pending on the decision of the ESA licencing board.
@@ -0,0 +1,126 @@
1
+ Metadata-Version: 2.1
2
+ Name: juice-simphony
3
+ Version: 0.1.0rc1
4
+ Summary: JUICE Scenario Generator
5
+ License: MIT
6
+ Author: JUICE SOC Team
7
+ Requires-Python: >=3.9,<4.0
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: 3.9
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Requires-Dist: jinja2 (>=3.1.6,<4.0.0)
15
+ Requires-Dist: python-dotenv (>=1.1.0,<2.0.0)
16
+ Requires-Dist: requests (>=2.32.3,<3.0.0)
17
+ Requires-Dist: setuptools (>=80.3.1,<81.0.0)
18
+ Description-Content-Type: text/markdown
19
+
20
+ # Symphony Web
21
+
22
+
23
+ ## Getting started
24
+
25
+
26
+ ## Project requirements
27
+
28
+ - Python 3.8
29
+ - Git
30
+
31
+ ## Preparing the environment
32
+
33
+ - Clone web repository:
34
+ git clone https://juigitlab.esac.esa.int/core-system/uplink/phs/juice-simphony.git
35
+
36
+
37
+ - Find in "data/simphony" path the cfg_config.json and edit it for setting valid paths.
38
+ Example:
39
+
40
+ ```
41
+ {
42
+ "inputs": {
43
+ "juice_conf": "$HOME/juice_conf"
44
+ },
45
+ "scenario_generator": {
46
+ "scenario_output_area_abs_path": "$HOME/JUICE_PREOPS/PLANNING"
47
+ },
48
+ "spice": {
49
+ "kernel_abs_path": "$HOME/juice/kernels",
50
+ "available_toolkits": [
51
+ {
52
+ "toolkit_version": "N0067"
53
+ }
54
+ ]
55
+ }
56
+ }
57
+ ```
58
+
59
+
60
+
61
+
62
+ ## Run the script
63
+
64
+ ```
65
+ juice-simphony
66
+ ```
67
+
68
+ This uses a default configuration file located in the directory specified above data/simphony/config_scenario.json.
69
+
70
+ ```
71
+ {
72
+ "scenario_id": "S008_01",
73
+ "shortDesc": "ORB17",
74
+ "main_target": "Jupiter",
75
+ "trajectory": "CREMA_5_1_150lb_23_1_a3",
76
+ "mnemonic": "S008_ORB17_S13P00",
77
+ "startTime": "2032-12-18T17:32:33",
78
+ "endTime": "2033-01-08T21:05:31",
79
+ "iniAbsolutePath": "SOFTWARE/MAPPS",
80
+ "descriptions": {
81
+ "scenario_id": "number of the science scenario as per SOCs reference (scenario_number plus version index); expected format: 1 letter + 3 digits + _ + 2 digits (e.g., 'S008_01')",
82
+ "main_target": "object of interest (not used)",
83
+ "labelPrefix": "string (not used)",
84
+ "code": "sequential number of the output scenario",
85
+ "version": "version of the output scenario",
86
+ "trajectory": "trajectory identifier, to be used together with mnemonic; not needed if segment_id is provided",
87
+ "mnemonic": "mnemonic of the trajectory; to be used together with trajectory; not needed if segment_id is provided",
88
+ "segment_id": "segmentation identified; see https://juicesoc.esac.esa.int/rest_api/plan/; not needed if both trajectory and mnemonic are provided",
89
+ "shortDesc": "string for the output folder",
90
+ "startTime": "scenario start time; timestamp in ISO 8601 format YYYY-MM-DDTHH:MM:SS",
91
+ "endTime": "scenario end time; timestamp in ISO 8601 format YYYY-MM-DDTHH:MM:SS",
92
+ "iniAbsolutePath": "string (not used)"
93
+ }
94
+ }
95
+ ```
96
+ These are the current input parameters, some of them might be updated in the future.
97
+
98
+ For a different input, the script is aimed at be run using an input configuration file from the command like, called as
99
+ ```
100
+ juice-simphony --config yourpath/config_scenario.json
101
+ ```
102
+ The segmentation can be selected either with both "trajectory" and "mnemonic", or using "segment_id". In this case, the input would be
103
+ ```
104
+ {
105
+ "scenario_id": "S008_01",
106
+ "shortDesc": "ORB17",
107
+ "main_target": "Jupiter",
108
+ "segment_id": 409,
109
+ "startTime": "2032-12-18T17:32:33",
110
+ "endTime": "2033-01-08T21:05:31",
111
+ "iniAbsolutePath": "SOFTWARE/MAPPS"
112
+ }
113
+ ```
114
+ If "segment_id" is provided (used to define the trajectory as an SHT code), the parameters "trajectory" and "mnemonic" are ignored. For the Plan list, please check: https://juicesoc.esac.esa.int/rest_api/plan/
115
+
116
+ To generate the MAPPS configuration, the parameter --mapps needs to be added to the command line, this is
117
+ ```
118
+ juice-simphony --mapps
119
+
120
+ or
121
+
122
+ juice-simphony --config yourpath/config_scenario.json --mapps
123
+ ```
124
+
125
+ The output is a zip file in the output folder provided above in the configuration.
126
+
@@ -0,0 +1,106 @@
1
+ # Symphony Web
2
+
3
+
4
+ ## Getting started
5
+
6
+
7
+ ## Project requirements
8
+
9
+ - Python 3.8
10
+ - Git
11
+
12
+ ## Preparing the environment
13
+
14
+ - Clone web repository:
15
+ git clone https://juigitlab.esac.esa.int/core-system/uplink/phs/juice-simphony.git
16
+
17
+
18
+ - Find in "data/simphony" path the cfg_config.json and edit it for setting valid paths.
19
+ Example:
20
+
21
+ ```
22
+ {
23
+ "inputs": {
24
+ "juice_conf": "$HOME/juice_conf"
25
+ },
26
+ "scenario_generator": {
27
+ "scenario_output_area_abs_path": "$HOME/JUICE_PREOPS/PLANNING"
28
+ },
29
+ "spice": {
30
+ "kernel_abs_path": "$HOME/juice/kernels",
31
+ "available_toolkits": [
32
+ {
33
+ "toolkit_version": "N0067"
34
+ }
35
+ ]
36
+ }
37
+ }
38
+ ```
39
+
40
+
41
+
42
+
43
+ ## Run the script
44
+
45
+ ```
46
+ juice-simphony
47
+ ```
48
+
49
+ This uses a default configuration file located in the directory specified above data/simphony/config_scenario.json.
50
+
51
+ ```
52
+ {
53
+ "scenario_id": "S008_01",
54
+ "shortDesc": "ORB17",
55
+ "main_target": "Jupiter",
56
+ "trajectory": "CREMA_5_1_150lb_23_1_a3",
57
+ "mnemonic": "S008_ORB17_S13P00",
58
+ "startTime": "2032-12-18T17:32:33",
59
+ "endTime": "2033-01-08T21:05:31",
60
+ "iniAbsolutePath": "SOFTWARE/MAPPS",
61
+ "descriptions": {
62
+ "scenario_id": "number of the science scenario as per SOCs reference (scenario_number plus version index); expected format: 1 letter + 3 digits + _ + 2 digits (e.g., 'S008_01')",
63
+ "main_target": "object of interest (not used)",
64
+ "labelPrefix": "string (not used)",
65
+ "code": "sequential number of the output scenario",
66
+ "version": "version of the output scenario",
67
+ "trajectory": "trajectory identifier, to be used together with mnemonic; not needed if segment_id is provided",
68
+ "mnemonic": "mnemonic of the trajectory; to be used together with trajectory; not needed if segment_id is provided",
69
+ "segment_id": "segmentation identified; see https://juicesoc.esac.esa.int/rest_api/plan/; not needed if both trajectory and mnemonic are provided",
70
+ "shortDesc": "string for the output folder",
71
+ "startTime": "scenario start time; timestamp in ISO 8601 format YYYY-MM-DDTHH:MM:SS",
72
+ "endTime": "scenario end time; timestamp in ISO 8601 format YYYY-MM-DDTHH:MM:SS",
73
+ "iniAbsolutePath": "string (not used)"
74
+ }
75
+ }
76
+ ```
77
+ These are the current input parameters, some of them might be updated in the future.
78
+
79
+ For a different input, the script is aimed at be run using an input configuration file from the command like, called as
80
+ ```
81
+ juice-simphony --config yourpath/config_scenario.json
82
+ ```
83
+ The segmentation can be selected either with both "trajectory" and "mnemonic", or using "segment_id". In this case, the input would be
84
+ ```
85
+ {
86
+ "scenario_id": "S008_01",
87
+ "shortDesc": "ORB17",
88
+ "main_target": "Jupiter",
89
+ "segment_id": 409,
90
+ "startTime": "2032-12-18T17:32:33",
91
+ "endTime": "2033-01-08T21:05:31",
92
+ "iniAbsolutePath": "SOFTWARE/MAPPS"
93
+ }
94
+ ```
95
+ If "segment_id" is provided (used to define the trajectory as an SHT code), the parameters "trajectory" and "mnemonic" are ignored. For the Plan list, please check: https://juicesoc.esac.esa.int/rest_api/plan/
96
+
97
+ To generate the MAPPS configuration, the parameter --mapps needs to be added to the command line, this is
98
+ ```
99
+ juice-simphony --mapps
100
+
101
+ or
102
+
103
+ juice-simphony --config yourpath/config_scenario.json --mapps
104
+ ```
105
+
106
+ The output is a zip file in the output folder provided above in the configuration.
@@ -0,0 +1,27 @@
1
+ [tool.poetry]
2
+ name = "juice-simphony"
3
+ #version = "0.1.0"
4
+ version = "0.1.0-rc.1" # RC version
5
+ description = "JUICE Scenario Generator"
6
+ authors = ["JUICE SOC Team"]
7
+ license = "MIT"
8
+ readme = "README.md"
9
+ packages = [{ include = "juice_simphony", from = "src" }]
10
+
11
+ [tool.poetry.dependencies]
12
+ python = "^3.9"
13
+
14
+ python-dotenv = "^1.1.0"
15
+ jinja2 = "^3.1.6"
16
+ setuptools = "^80.3.1"
17
+ requests = "^2.32.3"
18
+ [tool.poetry.group.dev.dependencies]
19
+ pytest = "^8.0.0"
20
+
21
+ [build-system]
22
+ requires = ["poetry-core"]
23
+ build-backend = "poetry.core.masonry.api"
24
+
25
+ [tool.poetry.scripts]
26
+ juice-simphony = "juice_simphony.cli:run"
27
+
@@ -0,0 +1,32 @@
1
+ import juice_simphony.CompositionEngine.Scenario.common.utils as utils
2
+ from juice_simphony.CompositionEngine.Scenario.definitions.toplevelObsDef import toplevelObsDef
3
+ from juice_simphony.CompositionEngine.SegmentationImporter.SegmentationImporter import segmentationTimeline
4
+ from juice_simphony.CompositionEngine.Scenario.attitude import xml_attitude as xml_att
5
+
6
+
7
+ import os
8
+
9
+ class attitude:
10
+
11
+ def __init__(self, segmentationTimelineInst, root_path, parameters=0):
12
+ self.root_path = root_path
13
+ self.segTimeline = segmentationTimelineInst
14
+ self.parameters = parameters
15
+ self.mainFolderPath = ""
16
+ self.structure = {}
17
+
18
+ def build(self):
19
+ self.createMainFolder('POINTING')
20
+ self.structure["path"] = self.mainFolderPath;
21
+ self.structure["xmlAttitudeFile"] = self.addRootContent()
22
+ return self.structure
23
+
24
+ def createMainFolder(self, folderName):
25
+ self.mainFolderPath = utils.createFolder(self.root_path, folderName)
26
+
27
+ def addRootContent(self):
28
+ xml_seg_attitude = self.segTimeline.getXmlAttitude()
29
+ if xml_seg_attitude["valid"]:
30
+ xml_att_file = xml_att.xml_attitude(self.mainFolderPath, xml_seg_attitude["xml_tree"], self.parameters)
31
+ return xml_att_file.genFile()
32
+ return ""
@@ -0,0 +1,147 @@
1
+ from jinja2 import Template
2
+ import os
3
+ from datetime import datetime
4
+ from xml.etree import ElementTree as et
5
+ import xml.etree.cElementTree as etree
6
+ from xml.dom import minidom
7
+ from copy import deepcopy
8
+
9
+ from juice_simphony.CompositionEngine.Scenario.common.fileHandleEps1 import fileHandleEps1
10
+ from juice_simphony.CompositionEngine.Scenario.common.fileName import fileName
11
+ from juice_simphony.CompositionEngine.Scenario.common.fileHandleXML import fileHandleXML
12
+
13
+ class xml_attitude(fileHandleXML):
14
+
15
+ def __init__(self, path, xml_att_struct, params = 0):
16
+ self.params = {}
17
+ if params!=0:
18
+ self.params.update(params)
19
+ self.path = path
20
+ self.rootPath = path
21
+ self.xml_att_struct = xml_att_struct
22
+ self.params["prefix"] = "PTR"
23
+ self.params["type"] = "SOC"
24
+ self.params["desc"] = ""
25
+ self.params["version"] = "SXXPYY"
26
+ self.params["ext"] = "ptx"
27
+ self.fileName = ""
28
+ self.template = 0
29
+ self.startTime = self.params["startTime"]
30
+ self.endTime = self.params["endTime"]
31
+ self.time_format = "%Y-%m-%dT%H:%M:%S"
32
+ fileName.__init__(self, self.params)
33
+
34
+ def indent(self, elem, level=0):
35
+ i = "\n" + level*" "
36
+ j = "\n" + (level-1)*" "
37
+ if len(elem):
38
+ if not elem.text or not elem.text.strip():
39
+ elem.text = i + " "
40
+ if not elem.tail or not elem.tail.strip():
41
+ elem.tail = i
42
+ for subelem in elem:
43
+ self.indent(subelem, level+1)
44
+ if not elem.tail or not elem.tail.strip():
45
+ elem.tail = j
46
+ else:
47
+ if level and (not elem.tail or not elem.tail.strip()):
48
+ elem.tail = j
49
+ return elem
50
+
51
+ def writeTimelineHeader(self):
52
+ self.writeHeader(self.params["scenarioID"], "JUICE SEGMENTATION ATTITUDE")
53
+ #comment = etree.Comment(' === Some Comment === ')
54
+ #root.insert(1, comment) # 1 is the index where comment is inserted
55
+ self.insertEmptyLine()
56
+
57
+ def write_xml_body(self):
58
+ #print (etree.tostring(self.xml_filtered_att, encoding='utf8', method='xml'))
59
+ #self.indent(self.xml_filtered_att)
60
+ xmlstr = minidom.parseString(etree.tostring(self.xml_filtered_att,encoding="unicode")).toprettyxml(indent = " ")
61
+ line_list = [s for s in xmlstr.splitlines() if s.strip("\r\n").strip()]
62
+ xmlstr = os.linesep.join(line_list)
63
+ # COMMENTED by PE
64
+ #print(xmlstr)
65
+ self.fileHdl.write(xmlstr)
66
+ # et.indent(self.xml_filtered_att, space=' ', level=0)
67
+ # self.fileHdl.write(et.tostring(self.xml_filtered_att,encoding="unicode"))
68
+
69
+ def writeContent(self):
70
+ self.writeTimelineHeader()
71
+ self.xml_filtered_att = self.filterPtr(self.xml_att_struct, self.startTime, self.endTime)
72
+ self.write_xml_body()
73
+
74
+ def filterPtr(self, xml_struct_att, start_time, end_time, cut_block = True):
75
+ start_time_dt = datetime.strptime(start_time, self.time_format)
76
+ end_time_dt = datetime.strptime(end_time, self.time_format)
77
+
78
+ # Get timeline node
79
+ timeline = next(xml_struct_att.iter("timeline"))
80
+ xml_block_list = list(xml_struct_att.iter("block"))
81
+ xml_block_list_out = []
82
+ #xml_block_list_len = len(xml_block_list)
83
+ num_of_filtered_blocks = 0
84
+ for index,xml_block in enumerate(xml_block_list):
85
+ if (xml_block.attrib["ref"] == "SLEW"): continue
86
+ # xml_seg = next(xml_block.iter("segmentation"), None)
87
+ # if not xml_seg == None:
88
+ xml_seg_start_time_dt = datetime.strptime(xml_block.find('startTime').text.strip(), self.time_format)
89
+ xml_seg_end_time_dt = datetime.strptime(xml_block.find('endTime').text.strip(), self.time_format)
90
+ intersect, cutted_block, xml_cut_start_time_dt, xml_cut_end_time_dt = self.intersectTimeRange(start_time_dt, end_time_dt, xml_seg_start_time_dt, xml_seg_end_time_dt, cut_block)
91
+ if intersect:
92
+ if num_of_filtered_blocks >= 1:
93
+ if xml_block_list[index-1].attrib["ref"] == "SLEW":
94
+ xml_block_list_out.append(xml_block_list[index-1])
95
+ num_of_filtered_blocks = num_of_filtered_blocks + 1
96
+ if cutted_block:
97
+ xml_block_start_time = next(xml_block.iter("startTime"), None)
98
+ if not xml_block_start_time == None:
99
+ xml_block_start_time.text = datetime.strftime(xml_cut_start_time_dt, "%Y-%m-%dT%H:%M:%S")
100
+ xml_block_end_time = next(xml_block.iter("endTime"), None)
101
+ if not xml_block_end_time == None:
102
+ xml_block_end_time.text = datetime.strftime(xml_cut_end_time_dt, "%Y-%m-%dT%H:%M:%S")
103
+ xml_block_list_out.append(xml_block)
104
+ last_block_end_time = xml_cut_end_time_dt
105
+ last_block = xml_block_list_out[-1]
106
+ xml_block_end_time = next(last_block.iter("endTime"), None)
107
+ if not xml_block_end_time == None:
108
+ xml_block_end_time.text = datetime.strftime(last_block_end_time, "%Y-%m-%dT%H:%M:%S")
109
+ else:
110
+ end_time_el = et.Element("endTime")
111
+ end_time_el.text = datetime.strftime(last_block_end_time, "%Y-%m-%dT%H:%M:%S")
112
+ last_block.append(end_time_el)
113
+ timeline.clear()
114
+ timeline.attrib["frame"] = "SC";
115
+ timeline.extend(xml_block_list_out)
116
+
117
+ return xml_struct_att
118
+
119
+ def intersectTimeRange(self, startTime, endTime, xml_seg_start_time, xml_seg_end_time, cut_block = True):
120
+ cutted_block = False
121
+ if endTime <= xml_seg_start_time: # st et xml_st xml_et
122
+ return (False, cutted_block, xml_seg_start_time, xml_seg_end_time)
123
+ else:
124
+ if xml_seg_end_time <= startTime: # xml_st xml_et st et
125
+ return (False, cutted_block, xml_seg_start_time, xml_seg_end_time)
126
+ else:
127
+ if cut_block:
128
+ if endTime < xml_seg_end_time: # xml_st et xml_et
129
+ # Cut block end time
130
+ xml_seg_end_time = endTime
131
+ cutted_block = True
132
+ if startTime > xml_seg_start_time: # xml_st st xml_et
133
+ # Cut block start time
134
+ xml_seg_start_time = startTime
135
+ cutted_block = True
136
+ return (True, cutted_block, xml_seg_start_time, xml_seg_end_time)
137
+
138
+ if __name__ == "__main__":
139
+ xml_doc = et.parse(R"Z:\VALIDATION\simphony\pcm\phs_pcm_test_004\input\TMP\CREMA_5_0.xml")
140
+ root = xml_doc.getroot()
141
+
142
+ params = {}
143
+ params["scenarioID"] = "SJS0003C30A"
144
+ params["startTime"] = "2032-09-01T01:00:00"
145
+ params["endTime"] = "2032-09-28T08:00:00"
146
+ #xml_att_file = xml_attitude(path="Z:\VALIDATION\simphony\pcm\phs_pcm_test_001\scenario_generator\output", xml_att_struct=xml_doc.getroot(), params=params)
147
+ #xml_att_file.genFile()
@@ -0,0 +1,59 @@
1
+ import configparser
2
+ from jinja2 import Template
3
+ import os
4
+ from juice_simphony.CompositionEngine.Scenario.common.fileName import fileName
5
+
6
+ class fileHandle(fileName):
7
+
8
+ def __init__(self, path, params=0):
9
+ if params!= 0: self.params.update(params)
10
+ self.path = path
11
+ self.fileName = ""
12
+ fileName.__init__(self)
13
+
14
+ def genFile(self):
15
+
16
+ # Generate file name
17
+ self.fileName = self.genBaseFileName() + "." + self.params["ext"]
18
+ destFilePath = os.path.join(self.path, self.fileName)
19
+ #destFilePath = self.path
20
+
21
+ # Open File
22
+ self.fileHdl = open(destFilePath, "w")
23
+
24
+ # Write Content
25
+ self.writeContent()
26
+
27
+ # Close File
28
+ self.fileHdl.close()
29
+
30
+ return destFilePath
31
+
32
+ def loadRefFile(self, filePath):
33
+ with open(filePath) as tplFile:
34
+ self.template = Template(tplFile.read())
35
+
36
+ def writeContent(self):
37
+ a=1
38
+
39
+ def writeHeader(self, title, shortDesc, description=""):
40
+ self.fileHdl.write( "#----------------------------------------------------------------------------------------------------#\n")
41
+ self.fileHdl.write( "# #\n")
42
+ self.fileHdl.write('#{:^100s}#\n'.format(title))
43
+ self.fileHdl.write('#{:^100s}#\n'.format(shortDesc))
44
+ self.fileHdl.write( "# #\n")
45
+ self.fileHdl.write( "#----------------------------------------------------------------------------------------------------#\n")
46
+
47
+ if description != "":
48
+ self.fileHdl.write ("\n")
49
+
50
+ self.fileHdl.write ("#----------------------------------------------------------------------------------------------------#\n")
51
+ self.fileHdl.write ("# DESCRIPTION:\n")
52
+ self.fileHdl.write (description + "\n")
53
+ self.fileHdl.write ("#----------------------------------------------------------------------------------------------------#\n")
54
+
55
+ def insertEmptyLine(self):
56
+ self.fileHdl.write("\n")
57
+
58
+ def insertComment(self,text):
59
+ self.fileHdl.write("# " + text + "\n")
@@ -0,0 +1,33 @@
1
+
2
+ import os
3
+ from juice_simphony.CompositionEngine.Scenario.common.fileHandle import fileHandle
4
+
5
+ class fileHandleEps(fileHandle):
6
+ def __init__(self, path, params=0):
7
+ if params!= 0: self.params.update(params)
8
+ self.path = path
9
+ fileHandle.__init__(self, path)
10
+
11
+ def insertVersion (self, version = 1):
12
+ self.fileHdl.write("# Timeline version" + "\n")
13
+ self.fileHdl.write("Version: 1" + "\n")
14
+
15
+ def insertTimeWindow (self, startTime, endTime):
16
+ self.fileHdl.write("# Time Window" + "\n")
17
+ self.fileHdl.write("Start_time: " + startTime + "\n")
18
+ self.fileHdl.write("End_time: " + endTime + "\n")
19
+
20
+ def insertInclude(self,params):
21
+ fileNameRel = os.path.relpath(params["filePath"], self.rootPath).replace("\\","/")
22
+ if "fileDescription" in params:
23
+ self.insertEmptyLine()
24
+ self.fileHdl.write("# " + params["fileDescription"] + "\n")
25
+ self.fileHdl.write("Include: " + fileNameRel + "\n")
26
+
27
+ def insertIncludeFile(self,params):
28
+ fileNameRel = os.path.relpath(params["filePath"], self.rootPath).replace("\\","/")
29
+ if "fileDescription" in params:
30
+ self.insertEmptyLine()
31
+ self.fileHdl.write("# " + params["fileDescription"] + "\n")
32
+ self.fileHdl.write("Include_file: " + "\"" + fileNameRel + "\"" + "\n")
33
+
@@ -0,0 +1,30 @@
1
+ import os
2
+ from .fileHandle import fileHandle
3
+
4
+ class fileHandleEps1(fileHandle):
5
+ def __init__(self):
6
+ fileHandle.__init__(self,self.path)
7
+
8
+ def insertVersion (self, version = 1):
9
+ self.fileHdl.write("# Timeline version" + "\n")
10
+ self.fileHdl.write("Version: 1" + "\n")
11
+
12
+ def insertTimeWindow (self, startTime, endTime):
13
+ self.fileHdl.write("# Time Window" + "\n")
14
+ self.fileHdl.write("Start_time: " + startTime + "\n")
15
+ self.fileHdl.write("End_time: " + endTime + "\n")
16
+
17
+ def insertInclude(self,params):
18
+ fileNameRel = os.path.relpath(params["filePath"], self.rootPath).replace("\\","/")
19
+ if "fileDescription" in params:
20
+ self.insertEmptyLine()
21
+ self.fileHdl.write("# " + params["fileDescription"] + "\n")
22
+ self.fileHdl.write("Include: " + fileNameRel + "\n")
23
+
24
+ def insertIncludeFile(self,params):
25
+ fileNameRel = os.path.relpath(params["filePath"], self.rootPath).replace("\\","/")
26
+ if "fileDescription" in params:
27
+ self.insertEmptyLine()
28
+ self.fileHdl.write("# " + params["fileDescription"] + "\n")
29
+ self.fileHdl.write("Include_file: " + "\"" + fileNameRel + "\"" + "\n")
30
+
@@ -0,0 +1,77 @@
1
+ import os
2
+ from juice_simphony.CompositionEngine.Scenario.common.fileHandleEps import fileHandleEps
3
+
4
+ class fileHandleTml(fileHandleEps):
5
+ def __init__(self, path, params=0):
6
+ if params!= 0: self.params.update(params)
7
+ self.path = path
8
+ self.fileName = ""
9
+ fileHandleEps.__init__(self, self.path, self.params)
10
+
11
+ def insertInitPM (self, param, par_pad, value, value_pad, comment):
12
+ self.fileHdl.write(f'Init_PM: { param : <{par_pad}} {value:<{value_pad}.2f} # {comment}\n')
13
+
14
+ def insertInitMS (self, exp, exp_pad, module, module_pad, mode, mode_pad, comment):
15
+ self.fileHdl.write(f'Init_MS: { exp : <{exp_pad}}{ module : <{module_pad}}{ mode : <{mode_pad}} # {comment}\n')
16
+
17
+ def insertRequestEntry(self,date, exp, mode, action, par_label, par_value, comment):
18
+ comment_lines = comment.splitlines()
19
+ for comment_line in comment_lines:
20
+ if comment_line != "": self.fileHdl.write(f'# {comment_line}\n')
21
+ if 'Z' in date:
22
+ self.fileHdl.write(f'{date} {exp} {mode} {action} ({par_label} = {par_value:12.7f})\n')
23
+ else:
24
+ self.fileHdl.write(f'{date}Z {exp} {mode} {action} ({par_label} = {par_value:12.7f})\n')
25
+
26
+ def insertLine(self,text):
27
+ self.fileHdl.write(text + "\n")
28
+ ''''
29
+ # Spacecrat platform initialization
30
+ # ------------------------------------
31
+
32
+ Init_PM: BATTERY_DOD 0.0 # Battery DoD
33
+ Init_MS: JUICE DST_X_R NOM # Antena Receiver always ON
34
+ Init_MS: JUICE PLATFORM ON # Platform ON to enable platform power consumption
35
+
36
+
37
+ # Set platform profile
38
+ # ---------------------
39
+ 2032-01-09T16:44:04Z JUICE * SET_POWER (VALUE=572.9135779720983)
40
+ '''''
41
+ if __name__ == '__main__':
42
+
43
+ param = "BATTERY_DOD"
44
+ par_pad = 8
45
+ value = 0.0
46
+ value_pad = 8
47
+ comment = "Antena Receiver always ON"
48
+ print(f'Init_PM: { param : <{par_pad}} {value:<{value_pad}.2f} # {comment}')
49
+
50
+ exp = "JUICE"
51
+ exp_pad = 8
52
+ module = "DST_X_R"
53
+ module_pad = 9
54
+ mode = "NOM"
55
+ mode_pad = 5
56
+ comment = "Antena Receiver always ON"
57
+ print(f'Init_PM: { exp : <{exp_pad}} { module : <{module_pad}} { mode : <{mode_pad}} # {comment}')
58
+
59
+ exp = "JUICE"
60
+ exp_pad = 8
61
+ module = "PLATFORM"
62
+ module_pad = 9
63
+ mode = "ON"
64
+ mode_pad = 5
65
+ comment = "Platform ON to enable platform power consumption"
66
+ print(f'Init_PM: { exp : <{exp_pad}} { module : <{module_pad}} { mode : <{mode_pad}} # {comment}')
67
+
68
+ date = "2032-01-09T16:44:04Z"
69
+ exp = "JUICE"
70
+ mode = " * "
71
+ action = "SET_POWER"
72
+ par_label = "VALUE"
73
+ par_value = 572.9135779720983
74
+ comment = "This is coming from R[001]"
75
+ print(f'Comment: {comment}')
76
+ # 2032-01-09T16:44:04Z JUICE * SET_POWER (VALUE=572.9135779720983)
77
+ print(f'{date} {exp} {mode} {action} ({par_label} = {par_value:18.13f})')