ptwrapper 2.4.2__tar.gz → 2.7.1__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.
- ptwrapper-2.7.1/PKG-INFO +248 -0
- ptwrapper-2.7.1/README.md +215 -0
- {ptwrapper-2.4.2 → ptwrapper-2.7.1}/pyproject.toml +10 -7
- ptwrapper-2.7.1/src/ptwrapper/__init__.py +12 -0
- ptwrapper-2.7.1/src/ptwrapper/cli.py +199 -0
- ptwrapper-2.4.2/src/ptwrapper/config/age/cfg_agm_jui_multibody.xml → ptwrapper-2.7.1/src/ptwrapper/config/agm/cfg_agm_jui.xml +76 -50
- ptwrapper-2.7.1/src/ptwrapper/config/agm/cfg_agm_jui_event_definitions.xml +33 -0
- ptwrapper-2.4.2/src/ptwrapper/config/age/cfg_agm_jui_multibody_fixed_definitions.xml → ptwrapper-2.7.1/src/ptwrapper/config/agm/cfg_agm_jui_fixed_definitions.xml +367 -161
- ptwrapper-2.4.2/src/ptwrapper/config/age/cfg_agm_jui_multibody_predefined_block.xml → ptwrapper-2.7.1/src/ptwrapper/config/agm/cfg_agm_jui_predefined_block.xml +127 -14
- ptwrapper-2.7.1/src/ptwrapper/config/eps/events.juice.def +977 -0
- ptwrapper-2.7.1/src/ptwrapper/config/session_file.json +122 -0
- ptwrapper-2.7.1/src/ptwrapper/html_log.py +513 -0
- ptwrapper-2.7.1/src/ptwrapper/input/TOP_crema_5_0_events.evf +7 -0
- ptwrapper-2.7.1/src/ptwrapper/input/TOP_crema_5_1_150lb_23_1_a3_events.evf +7 -0
- ptwrapper-2.7.1/src/ptwrapper/input/TOP_crema_5_1_150lb_23_1_events.evf +7 -0
- ptwrapper-2.7.1/src/ptwrapper/input/evf/EVT_CREMA_5_0_GEOPIPELINE.EVF +53899 -0
- ptwrapper-2.7.1/src/ptwrapper/input/evf/EVT_CREMA_5_1_150LB_23_1_A3_GEOPIPELINE.EVF +51303 -0
- ptwrapper-2.7.1/src/ptwrapper/input/evf/EVT_CREMA_5_1_150LB_23_1_GEOPIPELINE.EVF +64128 -0
- ptwrapper-2.7.1/src/ptwrapper/input/evf/EVT__GEOPIPELINE.EVF +3 -0
- ptwrapper-2.7.1/src/ptwrapper/main.py +103 -0
- ptwrapper-2.7.1/src/ptwrapper/subscribers.py +1132 -0
- ptwrapper-2.7.1/src/ptwrapper/utils.py +319 -0
- ptwrapper-2.4.2/PKG-INFO +0 -234
- ptwrapper-2.4.2/README.md +0 -205
- ptwrapper-2.4.2/setup.py +0 -44
- ptwrapper-2.4.2/src/ptwrapper/__init__.py +0 -3
- ptwrapper-2.4.2/src/ptwrapper/cli.py +0 -193
- ptwrapper-2.4.2/src/ptwrapper/config/age/cfg_agm_jui_multibody_event_definitions.xml +0 -19
- ptwrapper-2.4.2/src/ptwrapper/config/ise/events.juice.def +0 -660
- ptwrapper-2.4.2/src/ptwrapper/config/session_file.json +0 -64
- ptwrapper-2.4.2/src/ptwrapper/utils.py +0 -226
- {ptwrapper-2.4.2 → ptwrapper-2.7.1}/LICENSE.txt +0 -0
- {ptwrapper-2.4.2 → ptwrapper-2.7.1}/src/ptwrapper/.flake8 +0 -0
- {ptwrapper-2.4.2/src/ptwrapper/config/ise → ptwrapper-2.7.1/src/ptwrapper/config/eps}/BRF_MAL_SGICD_2_1_300101_351005.brf +0 -0
- {ptwrapper-2.4.2/src/ptwrapper/config/ise → ptwrapper-2.7.1/src/ptwrapper/config/eps}/RES_C50_SA_CELLS_EFFICIENCY_310101_351003.csv +0 -0
- {ptwrapper-2.4.2/src/ptwrapper/config/ise → ptwrapper-2.7.1/src/ptwrapper/config/eps}/eps.cfg +0 -0
- {ptwrapper-2.4.2/src/ptwrapper/config/ise → ptwrapper-2.7.1/src/ptwrapper/config/eps}/phs_com_res_sa_cells_count.asc +0 -0
- {ptwrapper-2.4.2/src/ptwrapper/config/ise → ptwrapper-2.7.1/src/ptwrapper/config/eps}/units.def +0 -0
- /ptwrapper-2.4.2/src/ptwrapper/input/TOP_events.evf → /ptwrapper-2.7.1/src/ptwrapper/input/TOP__events.evf +0 -0
- {ptwrapper-2.4.2 → ptwrapper-2.7.1}/src/ptwrapper/input/downlink.evf +0 -0
- {ptwrapper-2.4.2 → ptwrapper-2.7.1}/src/ptwrapper/input/edf/EDF_JUI_SPC_LINK_KAB.edf +0 -0
- {ptwrapper-2.4.2 → ptwrapper-2.7.1}/src/ptwrapper/input/edf/EDF_JUI_SPC_LINK_XB.edf +0 -0
- {ptwrapper-2.4.2 → ptwrapper-2.7.1}/src/ptwrapper/input/edf/TBD.edf +0 -0
- {ptwrapper-2.4.2 → ptwrapper-2.7.1}/src/ptwrapper/input/edf/TOP_experiments.edf +0 -0
- {ptwrapper-2.4.2 → ptwrapper-2.7.1}/src/ptwrapper/input/edf/juice__spacecraft.edf +0 -0
- {ptwrapper-2.4.2 → ptwrapper-2.7.1}/src/ptwrapper/input/edf/juice__spacecraft_platform.edf +0 -0
- {ptwrapper-2.4.2 → ptwrapper-2.7.1}/src/ptwrapper/input/edf/juice__spacecraft_ssmm.edf +0 -0
- {ptwrapper-2.4.2 → ptwrapper-2.7.1}/src/ptwrapper/input/itl/TBD.itl +0 -0
- {ptwrapper-2.4.2 → ptwrapper-2.7.1}/src/ptwrapper/input/itl/TOP_timelines.itl +0 -0
- {ptwrapper-2.4.2 → ptwrapper-2.7.1}/src/ptwrapper/input/itl/downlink.itl +0 -0
- {ptwrapper-2.4.2 → ptwrapper-2.7.1}/src/ptwrapper/input/itl/platform.itl +0 -0
- {ptwrapper-2.4.2 → ptwrapper-2.7.1}/src/ptwrapper/py.typed +0 -0
ptwrapper-2.7.1/PKG-INFO
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ptwrapper
|
|
3
|
+
Version: 2.7.1
|
|
4
|
+
Summary: A Pointing Tool OSVE wrapper
|
|
5
|
+
License: European Space Agency Public License (ESA-PL) Permissive (Type 3) – v2.4
|
|
6
|
+
License-File: LICENSE.txt
|
|
7
|
+
Author: Marc Costa
|
|
8
|
+
Author-email: marc.costa@ext.esa.int
|
|
9
|
+
Requires-Python: >=3.8,<4.0
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: Other/Proprietary License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
23
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
+
Classifier: Typing :: Typed
|
|
25
|
+
Requires-Dist: numpy (>=1.26.4)
|
|
26
|
+
Requires-Dist: osve (==2.7.2)
|
|
27
|
+
Requires-Dist: spiceypy (>=5.1.2)
|
|
28
|
+
Project-URL: Documentation, https://juicesoc.esac.esa.int/panel/#/navigation/help
|
|
29
|
+
Project-URL: Homepage, https://gitlab.esa.int/juice-soc-public/python/ptwrapper
|
|
30
|
+
Project-URL: Repository, https://gitlab.esa.int/juice-soc-public/python/ptwrapper
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
# Pointing Tool Wrapper
|
|
34
|
+
|
|
35
|
+
A JUICE SOC [Pointing Tool](https://juicept.esac.esa.int/) wrapper (`PTwrapper`) for WINDOWS, LINUX, and MACOSX to be
|
|
36
|
+
used in a local computer.
|
|
37
|
+
|
|
38
|
+
Allows to simulate a Pointing Timeline Request (PTR) and to generate the corresponding SPICE CK, resolved PTR,
|
|
39
|
+
available Power, and quaternions dump file.
|
|
40
|
+
|
|
41
|
+
`PTWrapper` is based on OSVE and mainly provides a shortcut to use the required functionalities and setup limited
|
|
42
|
+
to simulate PTRs. You can find more information on OSVE [here](https://juigitlab.esac.esa.int/core-system/uplink/phs/osve).
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### Documentation
|
|
46
|
+
|
|
47
|
+
There is not PTWrapper specific documentation besides this README file. But extensive documentation on OSVE and on
|
|
48
|
+
the Pointing Tool exists as provided hereunder:
|
|
49
|
+
|
|
50
|
+
- [JUICE SOC Toolkit Help Pointing Tool](https://juicesoc.esac.esa.int/help/pdt/).
|
|
51
|
+
- [JUICE SOC Toolkit Help OSVE](https://juicesoc.esac.esa.int/help/osve/)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
#### Pointing Request Log
|
|
55
|
+
|
|
56
|
+
The only particulars worth mentioning that are not present in the help of the PTWrapper API is the fact that the
|
|
57
|
+
PTWrapper generates a special log file that is designed to help the Pointing Design process.
|
|
58
|
+
|
|
59
|
+
This log is provided as an HTML and as a JSON file. The HTML can be visualized directly with any web browser whereas
|
|
60
|
+
the JSON file can be used to plug it in other tools (such as the Pointing Tool web app itself.)
|
|
61
|
+
|
|
62
|
+
This log provides a list of Attitude simulation WARNINGS and ERRORS sorted per designer instrument. It also includes the
|
|
63
|
+
errors that happen during the slew block before or after a given pointing block.
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
#### A Note on Eclipses
|
|
67
|
+
|
|
68
|
+
An eclipse will result in a reduction of the solar arrays available power.
|
|
69
|
+
|
|
70
|
+
By design, the JUICE SOC Attitude Generator Module (AGM), integrated in OSVE does not calculate eclipses (i.e. when
|
|
71
|
+
a body is in between JUICE and the Sun), instead eclipses are provided via an event file that is trajectory dependent.
|
|
72
|
+
These event files are available for the trajectories in use. The trajectory is identified by PTWrapper by searching
|
|
73
|
+
for the SPICE frames kernel thar provides trajectory events in the used meta-kernel; because of this it is
|
|
74
|
+
extremely recommended to always use the meta-kernels provided by the JUICE SOC.
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
## Installation
|
|
78
|
+
|
|
79
|
+
```shx
|
|
80
|
+
pip install ptwrapper
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Development and testing
|
|
84
|
+
|
|
85
|
+
* Clone this repository
|
|
86
|
+
* Requirements:
|
|
87
|
+
* Python 3.7+
|
|
88
|
+
* Create a virtual environment and install the dependencies
|
|
89
|
+
|
|
90
|
+
```shx
|
|
91
|
+
pip install -e .
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Run the tests with in the `tests` directory with:
|
|
95
|
+
|
|
96
|
+
```shell
|
|
97
|
+
python3 -m unittest
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
## Using the library
|
|
102
|
+
|
|
103
|
+
After installing the library can be used with its CLI or with the Python Shell.
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
### Command line interface (recommended)
|
|
107
|
+
|
|
108
|
+
The package has a CLI entry point:
|
|
109
|
+
|
|
110
|
+
```shell
|
|
111
|
+
ptwrapper -h
|
|
112
|
+
usage: ptwrapper [-h] [-m META_KERNEL] [-p PTR] [-w WORKING_DIR] [-o OUTPUT_DIR] [-t TIME_STEP] [-np] [-sa] [-mga] [-q] [-f] [-v]
|
|
113
|
+
|
|
114
|
+
Pointing Tool Wrapper (PTWrapper) simulates a PTR and generates the corresponding resolved PTR, SPICE CK kernels, and other attitude related files. PTWrapper uses OSVE to
|
|
115
|
+
simulate the PTR.
|
|
116
|
+
|
|
117
|
+
options:
|
|
118
|
+
-h, --help show this help message and exit
|
|
119
|
+
-m META_KERNEL, --meta-kernel META_KERNEL
|
|
120
|
+
[MANDATORY] Path to the SPICE Meta-kernel (MK) file
|
|
121
|
+
-p PTR, --ptr PTR [MANDATORY] Path to the Pointing Timeline Request (PTR) file.
|
|
122
|
+
-w WORKING_DIR, --working-dir WORKING_DIR
|
|
123
|
+
Path to the working directory. Default is the current directory.
|
|
124
|
+
-o OUTPUT_DIR, --output-dir OUTPUT_DIR
|
|
125
|
+
Path to the output directory. Default is the current directory.
|
|
126
|
+
-t TIME_STEP, --time-step TIME_STEP
|
|
127
|
+
Simulation time step in seconds. Default is 5s.
|
|
128
|
+
-pw, --power Calculate the available power and compare it with the one generated from the SPICE meta-kernel. Default is that the Available Power is not calculated.
|
|
129
|
+
-sa, --sa-ck Generate the Solar Arrays SPICE CK.
|
|
130
|
+
-mga, --mga-ck Generate the Medium Gain Antenna SPICE CK.
|
|
131
|
+
-q, --quaternions Calculate the quaternions.
|
|
132
|
+
-ro, --remove-obs-comp
|
|
133
|
+
Remove the observation compatibility checks from the simulation.
|
|
134
|
+
-rc, --remove-checks Remove all the constraint and observation compatibility checks from the simulation (enhances performance).
|
|
135
|
+
-f, --fixed-definitions
|
|
136
|
+
Print the AGM Fixed Definitions in use for PTR design.
|
|
137
|
+
-d, --debug Keep all setup files of the OSVE simulation.
|
|
138
|
+
-v, --version Print OSVE, AGM, and EPS libraries version.
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
> **WARNING:** Remember that the input `mk` needs to have an adequate
|
|
142
|
+
> relative or absolute path for its `PATH_VALUES` variable value.
|
|
143
|
+
|
|
144
|
+
A couple of examples are provided hereunder. First specifying the output directory:
|
|
145
|
+
|
|
146
|
+
```shell
|
|
147
|
+
ptwrapper -m data/kernels/juice_mini_local.tm -p data/ptr_test.xml
|
|
148
|
+
[INFO] <PTWR> PTWrapper session execution
|
|
149
|
+
[WARNING] <PTWR> No JUICE Crema reference found: eclipses not taken into account.
|
|
150
|
+
[INFO] <OSVE> OSVE Version 2.4.5a2
|
|
151
|
+
[INFO] <OSVE> AGM Version 9.3.16_4fc4bbf9
|
|
152
|
+
[INFO] <OSVE> EPS Version 9.3.16_4fc4bbf9
|
|
153
|
+
[INFO] <AGE > Attitude Generation Module initialization started
|
|
154
|
+
[INFO] <AGE > AGE module setup started
|
|
155
|
+
[INFO] <AGE > AGE module setup successfully completed
|
|
156
|
+
[INFO] <AGE > Attitude Generation Module initialization completed
|
|
157
|
+
[INFO] <ISE > Experiment Planning System initialization started
|
|
158
|
+
[INFO] <ISE > Experiment Planning System initialization completed
|
|
159
|
+
[INFO] <OSVE> Load Event File: "TOP__events.evf"
|
|
160
|
+
[INFO] <OSVE> Load Timeline File: "TOP_timelines.itl"
|
|
161
|
+
[WARNING] <OSVE> Not AGM object has eclipse/umbra or penumbra events defined.
|
|
162
|
+
[INFO] <AGE > Loading Attitude Timeline
|
|
163
|
+
[INFO] <AGM > 2030-10-15T03:40:00Z WMM HILL_SPHERE: Initial target body Sun
|
|
164
|
+
[INFO] <AGE > Checking Attitude Timeline
|
|
165
|
+
[INFO] <AGE > Initializing Attitude Timeline
|
|
166
|
+
[====================================================================================================] 100 %
|
|
167
|
+
[WARNING] <OSVE> Attitude Timeline starts after Operations Timeline
|
|
168
|
+
[WARNING] <OSVE> Attitude Timeline ends before Operations Timeline
|
|
169
|
+
[INFO] <OSVE> STARTING SIMULATION
|
|
170
|
+
[INFO] <OSVE> Experiment Timeline Time Period 2022-08-26T01:53:51 - 2035-10-05T00:44:43
|
|
171
|
+
[INFO] <OSVE> Attitude Timeline Time Period 2030-10-15T03:40:00Z - 2030-10-15T04:15:00Z
|
|
172
|
+
[INFO] <OSVE> Simulation Timeline Time Period 2030-10-15T03:40:00Z - 2030-10-15T04:15:00Z
|
|
173
|
+
[WARNING] <ISE > TimelineExecutor: 47 timeline entries skipped at initialisation
|
|
174
|
+
[INFO] <ISE > Entries defined before start time 15-October-2030_03:40:00
|
|
175
|
+
[INFO] <OSVE> Simulation Time Step 5s
|
|
176
|
+
[INFO] <OSVE> Simulation Output Time Step 5s
|
|
177
|
+
[INFO] <OSVE> Simulation FINISHED, Timeline Time Period 2030-10-15T03:40:00Z - 2030-10-15T04:15:00Z
|
|
178
|
+
[WARNING] <ISE > TimelineExecutor: 5712 timeline entries not executed at completion
|
|
179
|
+
[INFO] <ISE > Entries defined after end time 15-October-2030_04:15:00
|
|
180
|
+
[INFO] <AGE > TOTAL ENERGY for POINTING block from 2030-10-15T03:40:00Z to 2030-10-15T04:15:00Z
|
|
181
|
+
[INFO] <AGE > Attitude from actual PTR: 834.043 Wh (834.043 Wh)
|
|
182
|
+
[INFO] <AGE > Attitude from loaded CK: 834.042 Wh (834.042 Wh)
|
|
183
|
+
[INFO] <OSVE> SIMULATION FINISHED
|
|
184
|
+
[INFO] <OSVE> XML PTR file: "ptr_resolved.ptx" generated
|
|
185
|
+
[INFO] <OSVE> Generating SC CK file with the following USER DEFINED parameters:
|
|
186
|
+
[INFO] <OSVE> SC CK SCLK Id: -28999
|
|
187
|
+
[INFO] <OSVE> SC CK frame ID: -28001
|
|
188
|
+
[INFO] <OSVE> SC CK time step: 5 s
|
|
189
|
+
[INFO] <AGE > Writing SC Attitude Spice CK File: juice_sc_ptr.bc
|
|
190
|
+
[INFO] <OSVE> SC CK file: "juice_sc_ptr.bc" generated
|
|
191
|
+
[INFO] <OSVE> POWER CSV file: "power.csv" generated
|
|
192
|
+
[INFO] <PTWR> The PTR has no errors, no PTR log is created
|
|
193
|
+
[INFO] <PTWR> Renaming power.csv to ptr_test_power.csv
|
|
194
|
+
[INFO] <PTWR> Renaming ptr_resolved.ptx to ptr_test_resolved.ptx
|
|
195
|
+
[INFO] <PTWR> Renaming juice_sc_ptr.bc to juice_sc_ptr_test_v01.bc
|
|
196
|
+
[INFO] <PTWR> Renaming log.json to ptr_test_osve_log.json
|
|
197
|
+
[INFO] <PTWR> Cleaning up OSVE execution files and directories
|
|
198
|
+
[INFO] <PTWR> PTWrapper session ended successfully
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
This will generate the following output files.
|
|
202
|
+
|
|
203
|
+
```shell
|
|
204
|
+
.
|
|
205
|
+
|-- juice_sc_ptr_test_v01.bc
|
|
206
|
+
|-- ptr_test_osve_log.json
|
|
207
|
+
|-- ptr_test_power.csv
|
|
208
|
+
`-- ptr_test_resolved.ptx
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Python Shell
|
|
212
|
+
|
|
213
|
+
A basic test of the library for a PTR processing is provided. The sample creates in the working directory a structure
|
|
214
|
+
folder to invoke the execution and dumps inside the OUTPUT folder the expected products (SPICE CK, resolved PTR,
|
|
215
|
+
available Power, and quaternions CSV)
|
|
216
|
+
|
|
217
|
+
```
|
|
218
|
+
from ptwrapper import simulation
|
|
219
|
+
|
|
220
|
+
ptr_content = """<prm>
|
|
221
|
+
<body>
|
|
222
|
+
<segment>
|
|
223
|
+
<data>
|
|
224
|
+
<timeline frame="SC">
|
|
225
|
+
<block ref="OBS">
|
|
226
|
+
<startTime>2030-10-15T03:40:00</startTime>
|
|
227
|
+
<endTime>2030-10-15T04:15:00</endTime>
|
|
228
|
+
<attitude ref="track">
|
|
229
|
+
<boresight ref="SC_Zaxis"/>
|
|
230
|
+
<target ref="Jupiter"/>
|
|
231
|
+
<phaseAngle ref="powerOptimised">
|
|
232
|
+
<yDir>false</yDir>
|
|
233
|
+
</phaseAngle>
|
|
234
|
+
</attitude>
|
|
235
|
+
<metadata>
|
|
236
|
+
<comment>Track Power Optimised C3.0</comment>
|
|
237
|
+
</metadata>
|
|
238
|
+
</block>
|
|
239
|
+
</timeline>
|
|
240
|
+
</data>
|
|
241
|
+
</segment>
|
|
242
|
+
</body>
|
|
243
|
+
</prm>
|
|
244
|
+
"""
|
|
245
|
+
mk_path = 'metakernel.tm'
|
|
246
|
+
simulation(mk_path, ptr_content)
|
|
247
|
+
```
|
|
248
|
+
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# Pointing Tool Wrapper
|
|
2
|
+
|
|
3
|
+
A JUICE SOC [Pointing Tool](https://juicept.esac.esa.int/) wrapper (`PTwrapper`) for WINDOWS, LINUX, and MACOSX to be
|
|
4
|
+
used in a local computer.
|
|
5
|
+
|
|
6
|
+
Allows to simulate a Pointing Timeline Request (PTR) and to generate the corresponding SPICE CK, resolved PTR,
|
|
7
|
+
available Power, and quaternions dump file.
|
|
8
|
+
|
|
9
|
+
`PTWrapper` is based on OSVE and mainly provides a shortcut to use the required functionalities and setup limited
|
|
10
|
+
to simulate PTRs. You can find more information on OSVE [here](https://juigitlab.esac.esa.int/core-system/uplink/phs/osve).
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Documentation
|
|
14
|
+
|
|
15
|
+
There is not PTWrapper specific documentation besides this README file. But extensive documentation on OSVE and on
|
|
16
|
+
the Pointing Tool exists as provided hereunder:
|
|
17
|
+
|
|
18
|
+
- [JUICE SOC Toolkit Help Pointing Tool](https://juicesoc.esac.esa.int/help/pdt/).
|
|
19
|
+
- [JUICE SOC Toolkit Help OSVE](https://juicesoc.esac.esa.int/help/osve/)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
#### Pointing Request Log
|
|
23
|
+
|
|
24
|
+
The only particulars worth mentioning that are not present in the help of the PTWrapper API is the fact that the
|
|
25
|
+
PTWrapper generates a special log file that is designed to help the Pointing Design process.
|
|
26
|
+
|
|
27
|
+
This log is provided as an HTML and as a JSON file. The HTML can be visualized directly with any web browser whereas
|
|
28
|
+
the JSON file can be used to plug it in other tools (such as the Pointing Tool web app itself.)
|
|
29
|
+
|
|
30
|
+
This log provides a list of Attitude simulation WARNINGS and ERRORS sorted per designer instrument. It also includes the
|
|
31
|
+
errors that happen during the slew block before or after a given pointing block.
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
#### A Note on Eclipses
|
|
35
|
+
|
|
36
|
+
An eclipse will result in a reduction of the solar arrays available power.
|
|
37
|
+
|
|
38
|
+
By design, the JUICE SOC Attitude Generator Module (AGM), integrated in OSVE does not calculate eclipses (i.e. when
|
|
39
|
+
a body is in between JUICE and the Sun), instead eclipses are provided via an event file that is trajectory dependent.
|
|
40
|
+
These event files are available for the trajectories in use. The trajectory is identified by PTWrapper by searching
|
|
41
|
+
for the SPICE frames kernel thar provides trajectory events in the used meta-kernel; because of this it is
|
|
42
|
+
extremely recommended to always use the meta-kernels provided by the JUICE SOC.
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## Installation
|
|
46
|
+
|
|
47
|
+
```shx
|
|
48
|
+
pip install ptwrapper
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Development and testing
|
|
52
|
+
|
|
53
|
+
* Clone this repository
|
|
54
|
+
* Requirements:
|
|
55
|
+
* Python 3.7+
|
|
56
|
+
* Create a virtual environment and install the dependencies
|
|
57
|
+
|
|
58
|
+
```shx
|
|
59
|
+
pip install -e .
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Run the tests with in the `tests` directory with:
|
|
63
|
+
|
|
64
|
+
```shell
|
|
65
|
+
python3 -m unittest
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
## Using the library
|
|
70
|
+
|
|
71
|
+
After installing the library can be used with its CLI or with the Python Shell.
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
### Command line interface (recommended)
|
|
75
|
+
|
|
76
|
+
The package has a CLI entry point:
|
|
77
|
+
|
|
78
|
+
```shell
|
|
79
|
+
ptwrapper -h
|
|
80
|
+
usage: ptwrapper [-h] [-m META_KERNEL] [-p PTR] [-w WORKING_DIR] [-o OUTPUT_DIR] [-t TIME_STEP] [-np] [-sa] [-mga] [-q] [-f] [-v]
|
|
81
|
+
|
|
82
|
+
Pointing Tool Wrapper (PTWrapper) simulates a PTR and generates the corresponding resolved PTR, SPICE CK kernels, and other attitude related files. PTWrapper uses OSVE to
|
|
83
|
+
simulate the PTR.
|
|
84
|
+
|
|
85
|
+
options:
|
|
86
|
+
-h, --help show this help message and exit
|
|
87
|
+
-m META_KERNEL, --meta-kernel META_KERNEL
|
|
88
|
+
[MANDATORY] Path to the SPICE Meta-kernel (MK) file
|
|
89
|
+
-p PTR, --ptr PTR [MANDATORY] Path to the Pointing Timeline Request (PTR) file.
|
|
90
|
+
-w WORKING_DIR, --working-dir WORKING_DIR
|
|
91
|
+
Path to the working directory. Default is the current directory.
|
|
92
|
+
-o OUTPUT_DIR, --output-dir OUTPUT_DIR
|
|
93
|
+
Path to the output directory. Default is the current directory.
|
|
94
|
+
-t TIME_STEP, --time-step TIME_STEP
|
|
95
|
+
Simulation time step in seconds. Default is 5s.
|
|
96
|
+
-pw, --power Calculate the available power and compare it with the one generated from the SPICE meta-kernel. Default is that the Available Power is not calculated.
|
|
97
|
+
-sa, --sa-ck Generate the Solar Arrays SPICE CK.
|
|
98
|
+
-mga, --mga-ck Generate the Medium Gain Antenna SPICE CK.
|
|
99
|
+
-q, --quaternions Calculate the quaternions.
|
|
100
|
+
-ro, --remove-obs-comp
|
|
101
|
+
Remove the observation compatibility checks from the simulation.
|
|
102
|
+
-rc, --remove-checks Remove all the constraint and observation compatibility checks from the simulation (enhances performance).
|
|
103
|
+
-f, --fixed-definitions
|
|
104
|
+
Print the AGM Fixed Definitions in use for PTR design.
|
|
105
|
+
-d, --debug Keep all setup files of the OSVE simulation.
|
|
106
|
+
-v, --version Print OSVE, AGM, and EPS libraries version.
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
> **WARNING:** Remember that the input `mk` needs to have an adequate
|
|
110
|
+
> relative or absolute path for its `PATH_VALUES` variable value.
|
|
111
|
+
|
|
112
|
+
A couple of examples are provided hereunder. First specifying the output directory:
|
|
113
|
+
|
|
114
|
+
```shell
|
|
115
|
+
ptwrapper -m data/kernels/juice_mini_local.tm -p data/ptr_test.xml
|
|
116
|
+
[INFO] <PTWR> PTWrapper session execution
|
|
117
|
+
[WARNING] <PTWR> No JUICE Crema reference found: eclipses not taken into account.
|
|
118
|
+
[INFO] <OSVE> OSVE Version 2.4.5a2
|
|
119
|
+
[INFO] <OSVE> AGM Version 9.3.16_4fc4bbf9
|
|
120
|
+
[INFO] <OSVE> EPS Version 9.3.16_4fc4bbf9
|
|
121
|
+
[INFO] <AGE > Attitude Generation Module initialization started
|
|
122
|
+
[INFO] <AGE > AGE module setup started
|
|
123
|
+
[INFO] <AGE > AGE module setup successfully completed
|
|
124
|
+
[INFO] <AGE > Attitude Generation Module initialization completed
|
|
125
|
+
[INFO] <ISE > Experiment Planning System initialization started
|
|
126
|
+
[INFO] <ISE > Experiment Planning System initialization completed
|
|
127
|
+
[INFO] <OSVE> Load Event File: "TOP__events.evf"
|
|
128
|
+
[INFO] <OSVE> Load Timeline File: "TOP_timelines.itl"
|
|
129
|
+
[WARNING] <OSVE> Not AGM object has eclipse/umbra or penumbra events defined.
|
|
130
|
+
[INFO] <AGE > Loading Attitude Timeline
|
|
131
|
+
[INFO] <AGM > 2030-10-15T03:40:00Z WMM HILL_SPHERE: Initial target body Sun
|
|
132
|
+
[INFO] <AGE > Checking Attitude Timeline
|
|
133
|
+
[INFO] <AGE > Initializing Attitude Timeline
|
|
134
|
+
[====================================================================================================] 100 %
|
|
135
|
+
[WARNING] <OSVE> Attitude Timeline starts after Operations Timeline
|
|
136
|
+
[WARNING] <OSVE> Attitude Timeline ends before Operations Timeline
|
|
137
|
+
[INFO] <OSVE> STARTING SIMULATION
|
|
138
|
+
[INFO] <OSVE> Experiment Timeline Time Period 2022-08-26T01:53:51 - 2035-10-05T00:44:43
|
|
139
|
+
[INFO] <OSVE> Attitude Timeline Time Period 2030-10-15T03:40:00Z - 2030-10-15T04:15:00Z
|
|
140
|
+
[INFO] <OSVE> Simulation Timeline Time Period 2030-10-15T03:40:00Z - 2030-10-15T04:15:00Z
|
|
141
|
+
[WARNING] <ISE > TimelineExecutor: 47 timeline entries skipped at initialisation
|
|
142
|
+
[INFO] <ISE > Entries defined before start time 15-October-2030_03:40:00
|
|
143
|
+
[INFO] <OSVE> Simulation Time Step 5s
|
|
144
|
+
[INFO] <OSVE> Simulation Output Time Step 5s
|
|
145
|
+
[INFO] <OSVE> Simulation FINISHED, Timeline Time Period 2030-10-15T03:40:00Z - 2030-10-15T04:15:00Z
|
|
146
|
+
[WARNING] <ISE > TimelineExecutor: 5712 timeline entries not executed at completion
|
|
147
|
+
[INFO] <ISE > Entries defined after end time 15-October-2030_04:15:00
|
|
148
|
+
[INFO] <AGE > TOTAL ENERGY for POINTING block from 2030-10-15T03:40:00Z to 2030-10-15T04:15:00Z
|
|
149
|
+
[INFO] <AGE > Attitude from actual PTR: 834.043 Wh (834.043 Wh)
|
|
150
|
+
[INFO] <AGE > Attitude from loaded CK: 834.042 Wh (834.042 Wh)
|
|
151
|
+
[INFO] <OSVE> SIMULATION FINISHED
|
|
152
|
+
[INFO] <OSVE> XML PTR file: "ptr_resolved.ptx" generated
|
|
153
|
+
[INFO] <OSVE> Generating SC CK file with the following USER DEFINED parameters:
|
|
154
|
+
[INFO] <OSVE> SC CK SCLK Id: -28999
|
|
155
|
+
[INFO] <OSVE> SC CK frame ID: -28001
|
|
156
|
+
[INFO] <OSVE> SC CK time step: 5 s
|
|
157
|
+
[INFO] <AGE > Writing SC Attitude Spice CK File: juice_sc_ptr.bc
|
|
158
|
+
[INFO] <OSVE> SC CK file: "juice_sc_ptr.bc" generated
|
|
159
|
+
[INFO] <OSVE> POWER CSV file: "power.csv" generated
|
|
160
|
+
[INFO] <PTWR> The PTR has no errors, no PTR log is created
|
|
161
|
+
[INFO] <PTWR> Renaming power.csv to ptr_test_power.csv
|
|
162
|
+
[INFO] <PTWR> Renaming ptr_resolved.ptx to ptr_test_resolved.ptx
|
|
163
|
+
[INFO] <PTWR> Renaming juice_sc_ptr.bc to juice_sc_ptr_test_v01.bc
|
|
164
|
+
[INFO] <PTWR> Renaming log.json to ptr_test_osve_log.json
|
|
165
|
+
[INFO] <PTWR> Cleaning up OSVE execution files and directories
|
|
166
|
+
[INFO] <PTWR> PTWrapper session ended successfully
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
This will generate the following output files.
|
|
170
|
+
|
|
171
|
+
```shell
|
|
172
|
+
.
|
|
173
|
+
|-- juice_sc_ptr_test_v01.bc
|
|
174
|
+
|-- ptr_test_osve_log.json
|
|
175
|
+
|-- ptr_test_power.csv
|
|
176
|
+
`-- ptr_test_resolved.ptx
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Python Shell
|
|
180
|
+
|
|
181
|
+
A basic test of the library for a PTR processing is provided. The sample creates in the working directory a structure
|
|
182
|
+
folder to invoke the execution and dumps inside the OUTPUT folder the expected products (SPICE CK, resolved PTR,
|
|
183
|
+
available Power, and quaternions CSV)
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
from ptwrapper import simulation
|
|
187
|
+
|
|
188
|
+
ptr_content = """<prm>
|
|
189
|
+
<body>
|
|
190
|
+
<segment>
|
|
191
|
+
<data>
|
|
192
|
+
<timeline frame="SC">
|
|
193
|
+
<block ref="OBS">
|
|
194
|
+
<startTime>2030-10-15T03:40:00</startTime>
|
|
195
|
+
<endTime>2030-10-15T04:15:00</endTime>
|
|
196
|
+
<attitude ref="track">
|
|
197
|
+
<boresight ref="SC_Zaxis"/>
|
|
198
|
+
<target ref="Jupiter"/>
|
|
199
|
+
<phaseAngle ref="powerOptimised">
|
|
200
|
+
<yDir>false</yDir>
|
|
201
|
+
</phaseAngle>
|
|
202
|
+
</attitude>
|
|
203
|
+
<metadata>
|
|
204
|
+
<comment>Track Power Optimised C3.0</comment>
|
|
205
|
+
</metadata>
|
|
206
|
+
</block>
|
|
207
|
+
</timeline>
|
|
208
|
+
</data>
|
|
209
|
+
</segment>
|
|
210
|
+
</body>
|
|
211
|
+
</prm>
|
|
212
|
+
"""
|
|
213
|
+
mk_path = 'metakernel.tm'
|
|
214
|
+
simulation(mk_path, ptr_content)
|
|
215
|
+
```
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "ptwrapper"
|
|
3
|
-
version = "2.
|
|
3
|
+
version = "2.7.1"
|
|
4
4
|
description = "A Pointing Tool OSVE wrapper"
|
|
5
5
|
authors = [
|
|
6
6
|
"Marc Costa <marc.costa@ext.esa.int>",
|
|
7
|
-
"Rafael Andres <rafael.andres@ext.esa.int>"
|
|
8
|
-
|
|
7
|
+
"Rafael Andres <rafael.andres@ext.esa.int>",
|
|
8
|
+
"Pilar Esquej <pilar.esquej@ext.esa.int>",
|
|
9
|
+
"Paula Betriu <paula.betriu@ext.esa.int>"
|
|
9
10
|
]
|
|
10
11
|
license = "European Space Agency Public License (ESA-PL) Permissive (Type 3) – v2.4"
|
|
11
12
|
readme = "README.md"
|
|
12
13
|
|
|
13
|
-
documentation = "https
|
|
14
|
-
homepage = "https://
|
|
15
|
-
repository = "https://
|
|
14
|
+
documentation = "https://juicesoc.esac.esa.int/panel/#/navigation/help"
|
|
15
|
+
homepage = "https://gitlab.esa.int/juice-soc-public/python/ptwrapper"
|
|
16
|
+
repository = "https://gitlab.esa.int/juice-soc-public/python/ptwrapper"
|
|
16
17
|
|
|
17
18
|
classifiers = [
|
|
18
19
|
"Development Status :: 4 - Beta",
|
|
@@ -35,7 +36,9 @@ ptwrapper = 'ptwrapper.cli:cli'
|
|
|
35
36
|
|
|
36
37
|
[tool.poetry.dependencies]
|
|
37
38
|
python = ">=3.8 <4.0"
|
|
38
|
-
osve = "
|
|
39
|
+
osve = "=2.7.2"
|
|
40
|
+
spiceypy = ">=5.1.2"
|
|
41
|
+
numpy = ">=1.26.4"
|
|
39
42
|
|
|
40
43
|
[tool.poetry.dev-dependencies]
|
|
41
44
|
autoflake = "*"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# *************************************************************************** #
|
|
2
|
+
# This file is subject to the terms and conditions defined in the #
|
|
3
|
+
# file 'LICENSE.txt', which is part of this source code package. #
|
|
4
|
+
# #
|
|
5
|
+
# No part of the package, including this file, may be copied, modified, #
|
|
6
|
+
# propagated, or distributed except according to the terms contained in #
|
|
7
|
+
# the file 'LICENSE.txt'. #
|
|
8
|
+
# #
|
|
9
|
+
# (C) Copyright European Space Agency, 2025 #
|
|
10
|
+
# *************************************************************************** #
|
|
11
|
+
from .utils import create_structure
|
|
12
|
+
from .main import execute, simulation
|