ptwrapper 2.1.0__tar.gz → 2.4.2__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 (35) hide show
  1. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/PKG-INFO +18 -31
  2. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/README.md +16 -29
  3. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/pyproject.toml +2 -2
  4. ptwrapper-2.4.2/setup.py +44 -0
  5. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/__init__.py +1 -1
  6. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/cli.py +69 -46
  7. ptwrapper-2.1.0/src/ptwrapper/config/age/cfg_agm_jui_jupiter.xml → ptwrapper-2.4.2/src/ptwrapper/config/age/cfg_agm_jui_multibody.xml +142 -115
  8. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/config/age/cfg_agm_jui_multibody_event_definitions.xml +0 -0
  9. ptwrapper-2.4.2/src/ptwrapper/config/age/cfg_agm_jui_multibody_fixed_definitions.xml +878 -0
  10. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/config/age/cfg_agm_jui_multibody_predefined_block.xml +55 -20
  11. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/config/session_file.json +1 -1
  12. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/utils.py +26 -26
  13. ptwrapper-2.1.0/src/ptwrapper/config/age/cfg_agm_jui_multibody_fixed_definitions.xml +0 -373
  14. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/LICENSE.txt +0 -0
  15. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/.flake8 +0 -0
  16. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/config/ise/BRF_MAL_SGICD_2_1_300101_351005.brf +0 -0
  17. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/config/ise/RES_C50_SA_CELLS_EFFICIENCY_310101_351003.csv +0 -0
  18. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/config/ise/eps.cfg +0 -0
  19. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/config/ise/events.juice.def +0 -0
  20. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/config/ise/phs_com_res_sa_cells_count.asc +0 -0
  21. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/config/ise/units.def +0 -0
  22. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/input/TOP_events.evf +0 -0
  23. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/input/downlink.evf +0 -0
  24. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/input/edf/EDF_JUI_SPC_LINK_KAB.edf +0 -0
  25. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/input/edf/EDF_JUI_SPC_LINK_XB.edf +0 -0
  26. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/input/edf/TBD.edf +0 -0
  27. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/input/edf/TOP_experiments.edf +0 -0
  28. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/input/edf/juice__spacecraft.edf +0 -0
  29. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/input/edf/juice__spacecraft_platform.edf +0 -0
  30. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/input/edf/juice__spacecraft_ssmm.edf +0 -0
  31. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/input/itl/TBD.itl +0 -0
  32. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/input/itl/TOP_timelines.itl +0 -0
  33. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/input/itl/downlink.itl +0 -0
  34. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/input/itl/platform.itl +0 -0
  35. {ptwrapper-2.1.0 → ptwrapper-2.4.2}/src/ptwrapper/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ptwrapper
3
- Version: 2.1.0
3
+ Version: 2.4.2
4
4
  Summary: A Pointing Tool OSVE wrapper
5
5
  Home-page: https://juigitlab.esac.esa.int/core-system/uplink/auxiliary-tools/ptwrapper
6
6
  License: European Space Agency Public License (ESA-PL) Permissive (Type 3) – v2.4
@@ -22,14 +22,14 @@ Classifier: Programming Language :: Python :: 3.8
22
22
  Classifier: Programming Language :: Python :: 3.9
23
23
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
24
  Classifier: Typing :: Typed
25
- Requires-Dist: osve (>=2.1.0)
25
+ Requires-Dist: osve (>=2.4.1)
26
26
  Project-URL: Documentation, https://.github.io/ptwrapper
27
27
  Project-URL: Repository, https://juigitlab.esac.esa.int/core-system/uplink/auxiliary-tools/ptwrapper
28
28
  Description-Content-Type: text/markdown
29
29
 
30
30
  # Pointing Tool Wrapper
31
31
 
32
- A JUICE SOC [Pointing Tool](https://juicept.esac.esa.int/) wrapper (`PTwrapper`) for LINUX and MACOSX for use in a local computer.
32
+ A JUICE SOC [Pointing Tool](https://juicept.esac.esa.int/) wrapper (`PTwrapper`) for WINDOWS, LINUX, and MACOSX for use in a local computer.
33
33
 
34
34
  Allows to simulate a Pointing Timeline Request (PTR) and to generate the corresponding SPICE CK, resolved PTR,
35
35
  available Power, and quaternions dump file.
@@ -53,30 +53,14 @@ pip install ptwrapper
53
53
 
54
54
  * Clone this repository
55
55
  * Requirements:
56
- * [Poetry](https://python-poetry.org/)
57
56
  * Python 3.7+
58
57
  * Create a virtual environment and install the dependencies
59
58
 
60
- Install the package and its dependencies:
61
-
62
- ```sh
63
- poetry install
64
- ```
65
-
66
- Then, after your edits, check that flake8 is happy:
67
-
68
- ```sh
69
- poetry run flake8
70
-
71
- ```
72
-
73
- and all the tests passed:
74
-
75
- ```sh
76
- poetry run pytest -s
59
+ ```shx
60
+ pip install -e .
77
61
  ```
78
62
 
79
- You can also run the tests with in the `tests` directory with:
63
+ Run the tests with in the `tests` directory with:
80
64
 
81
65
  ```shell
82
66
  python3 -m unittest
@@ -137,9 +121,9 @@ The package has a CLI entry point:
137
121
  ```shell
138
122
  ptwrapper -h
139
123
 
140
- usage: ptwrapper [-h] [-s SESSION_FILE] [-m META_KERNEL] [-p PTR] [-w WORKING_DIR] [-o OUTPUT_DIR] [-t TIME_STEP] [-n] [-q] [-v]
124
+ usage: ptwrapper [-h] [-s SESSION_FILE] [-m META_KERNEL] [-p PTR] [-w WORKING_DIR] [-o OUTPUT_DIR] [-t TIME_STEP] [-np] [-sa] [-mga] [-q] [-f] [-v]
141
125
 
142
- Pointing Tool Wrapper (PTWrapper) simulates a PTR and generates the corresponding SPICE CK, resolved PTR, available Power, and quaternions dump file. PTWrapper uses OSVE to simulate the PTR.
126
+ 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 simulate the PTR.
143
127
 
144
128
  optional arguments:
145
129
  -h, --help show this help message and exit
@@ -154,10 +138,13 @@ optional arguments:
154
138
  Path to the output directory. Overwrites default output file names. Default is the structure of the built-in session file.
155
139
  -t TIME_STEP, --time-step TIME_STEP
156
140
  Output CK file time step in seconds. Default is 5s.
157
- -n, --no-power Indicate not to calculate available power. Default is that the Available Power will be computed.
158
- -q, --quaternions Indicate to calculate quaternions. Default is that the quaternions will not be computed.
141
+ -np, --no-power Indicates not to calculate available power. Default is that the Available Power will be computed.
142
+ -sa, --sa-ck Generate the Solar Arrays SPICE CK. Default is that the SA CK is not generated.
143
+ -mga, --mga-ck Generate the Medium Gain Antenna SPICE CK. Default is that the MGA CK is not generated.
144
+ -q, --quaternions Calculate the quaternions. Default is that the quaternions will not be computed.
145
+ -f, --fixed-definitions
146
+ Print the AGM Fixed Definitions in use for PTR design.
159
147
  -v, --version OSVE, AGM, and EPS libraries version.
160
-
161
148
  ```
162
149
 
163
150
  You can either run the CLI using an OSVE configuration file (`SESSION_FILE`) or by specifying a
@@ -222,10 +209,10 @@ The same run without specifying the `OUTPUT_DIRECTORY` yields the following dire
222
209
  .
223
210
  |-- config
224
211
  | |-- age
225
- | | |-- AGMConfig.xml
226
- | | |-- CFG_AGM_JUI_MULTIBODY_EVENT_DEFINITIONS.xml
227
- | | |-- CFG_AGM_JUI_MULTIBODY_FIXED_DEFINITIONS.xml
228
- | | `-- CFG_AGM_JUI_MULTIBODY_PREDEFINED_BLOCK.xml
212
+ | | |-- cfg_agm_jui_jupiter.xml
213
+ | | |-- cfg_agm_jui_multibody_event_definitions.xml
214
+ | | |-- cfg_agm_jui_multibody_fixed_definitions.xml
215
+ | | `-- cfg_agm_jui_multibody_predefined_block.xml
229
216
  | `-- ise
230
217
  | |-- BRF_MAL_SGICD_2_1_300101_351005.brf
231
218
  | |-- RES_C50_SA_CELLS_EFFICIENCY_310101_351003.csv
@@ -1,6 +1,6 @@
1
1
  # Pointing Tool Wrapper
2
2
 
3
- A JUICE SOC [Pointing Tool](https://juicept.esac.esa.int/) wrapper (`PTwrapper`) for LINUX and MACOSX for use in a local computer.
3
+ A JUICE SOC [Pointing Tool](https://juicept.esac.esa.int/) wrapper (`PTwrapper`) for WINDOWS, LINUX, and MACOSX for use in a local computer.
4
4
 
5
5
  Allows to simulate a Pointing Timeline Request (PTR) and to generate the corresponding SPICE CK, resolved PTR,
6
6
  available Power, and quaternions dump file.
@@ -24,30 +24,14 @@ pip install ptwrapper
24
24
 
25
25
  * Clone this repository
26
26
  * Requirements:
27
- * [Poetry](https://python-poetry.org/)
28
27
  * Python 3.7+
29
28
  * Create a virtual environment and install the dependencies
30
29
 
31
- Install the package and its dependencies:
32
-
33
- ```sh
34
- poetry install
35
- ```
36
-
37
- Then, after your edits, check that flake8 is happy:
38
-
39
- ```sh
40
- poetry run flake8
41
-
42
- ```
43
-
44
- and all the tests passed:
45
-
46
- ```sh
47
- poetry run pytest -s
30
+ ```shx
31
+ pip install -e .
48
32
  ```
49
33
 
50
- You can also run the tests with in the `tests` directory with:
34
+ Run the tests with in the `tests` directory with:
51
35
 
52
36
  ```shell
53
37
  python3 -m unittest
@@ -108,9 +92,9 @@ The package has a CLI entry point:
108
92
  ```shell
109
93
  ptwrapper -h
110
94
 
111
- usage: ptwrapper [-h] [-s SESSION_FILE] [-m META_KERNEL] [-p PTR] [-w WORKING_DIR] [-o OUTPUT_DIR] [-t TIME_STEP] [-n] [-q] [-v]
95
+ usage: ptwrapper [-h] [-s SESSION_FILE] [-m META_KERNEL] [-p PTR] [-w WORKING_DIR] [-o OUTPUT_DIR] [-t TIME_STEP] [-np] [-sa] [-mga] [-q] [-f] [-v]
112
96
 
113
- Pointing Tool Wrapper (PTWrapper) simulates a PTR and generates the corresponding SPICE CK, resolved PTR, available Power, and quaternions dump file. PTWrapper uses OSVE to simulate the PTR.
97
+ 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 simulate the PTR.
114
98
 
115
99
  optional arguments:
116
100
  -h, --help show this help message and exit
@@ -125,10 +109,13 @@ optional arguments:
125
109
  Path to the output directory. Overwrites default output file names. Default is the structure of the built-in session file.
126
110
  -t TIME_STEP, --time-step TIME_STEP
127
111
  Output CK file time step in seconds. Default is 5s.
128
- -n, --no-power Indicate not to calculate available power. Default is that the Available Power will be computed.
129
- -q, --quaternions Indicate to calculate quaternions. Default is that the quaternions will not be computed.
112
+ -np, --no-power Indicates not to calculate available power. Default is that the Available Power will be computed.
113
+ -sa, --sa-ck Generate the Solar Arrays SPICE CK. Default is that the SA CK is not generated.
114
+ -mga, --mga-ck Generate the Medium Gain Antenna SPICE CK. Default is that the MGA CK is not generated.
115
+ -q, --quaternions Calculate the quaternions. Default is that the quaternions will not be computed.
116
+ -f, --fixed-definitions
117
+ Print the AGM Fixed Definitions in use for PTR design.
130
118
  -v, --version OSVE, AGM, and EPS libraries version.
131
-
132
119
  ```
133
120
 
134
121
  You can either run the CLI using an OSVE configuration file (`SESSION_FILE`) or by specifying a
@@ -193,10 +180,10 @@ The same run without specifying the `OUTPUT_DIRECTORY` yields the following dire
193
180
  .
194
181
  |-- config
195
182
  | |-- age
196
- | | |-- AGMConfig.xml
197
- | | |-- CFG_AGM_JUI_MULTIBODY_EVENT_DEFINITIONS.xml
198
- | | |-- CFG_AGM_JUI_MULTIBODY_FIXED_DEFINITIONS.xml
199
- | | `-- CFG_AGM_JUI_MULTIBODY_PREDEFINED_BLOCK.xml
183
+ | | |-- cfg_agm_jui_jupiter.xml
184
+ | | |-- cfg_agm_jui_multibody_event_definitions.xml
185
+ | | |-- cfg_agm_jui_multibody_fixed_definitions.xml
186
+ | | `-- cfg_agm_jui_multibody_predefined_block.xml
200
187
  | `-- ise
201
188
  | |-- BRF_MAL_SGICD_2_1_300101_351005.brf
202
189
  | |-- RES_C50_SA_CELLS_EFFICIENCY_310101_351003.csv
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "ptwrapper"
3
- version = "2.1.0"
3
+ version = "2.4.2"
4
4
  description = "A Pointing Tool OSVE wrapper"
5
5
  authors = [
6
6
  "Marc Costa <marc.costa@ext.esa.int>",
@@ -35,7 +35,7 @@ ptwrapper = 'ptwrapper.cli:cli'
35
35
 
36
36
  [tool.poetry.dependencies]
37
37
  python = ">=3.8 <4.0"
38
- osve = '>=2.1.0'
38
+ osve = ">=2.4.1"
39
39
 
40
40
  [tool.poetry.dev-dependencies]
41
41
  autoflake = "*"
@@ -0,0 +1,44 @@
1
+ # -*- coding: utf-8 -*-
2
+ from setuptools import setup
3
+
4
+ package_dir = \
5
+ {'': 'src'}
6
+
7
+ packages = \
8
+ ['ptwrapper']
9
+
10
+ package_data = \
11
+ {'': ['*'],
12
+ 'ptwrapper': ['config/*',
13
+ 'config/age/*',
14
+ 'config/ise/*',
15
+ 'input/*',
16
+ 'input/edf/*',
17
+ 'input/itl/*']}
18
+
19
+ install_requires = \
20
+ ['osve>=2.4.1']
21
+
22
+ entry_points = \
23
+ {'console_scripts': ['ptwrapper = ptwrapper.cli:cli']}
24
+
25
+ setup_kwargs = {
26
+ 'name': 'ptwrapper',
27
+ 'version': '2.4.2',
28
+ 'description': 'A Pointing Tool OSVE wrapper',
29
+ 'long_description': '# Pointing Tool Wrapper\n\nA JUICE SOC [Pointing Tool](https://juicept.esac.esa.int/) wrapper (`PTwrapper`) for WINDOWS, LINUX, and MACOSX for use in a local computer.\n\nAllows to simulate a Pointing Timeline Request (PTR) and to generate the corresponding SPICE CK, resolved PTR, \navailable Power, and quaternions dump file.\n\n`PTwrapper` is based on OSVE and mainly provides a shortcut to use the required functionalities and setup limited\nto simulate PTRs. You can find more information on OSVE [here](https://juigitlab.esac.esa.int/core-system/uplink/phs/osve).\n\n\n### Documentation\n\nDocumentation is available at the [JUICE SOC Toolkit Help](https://juicesoc.esac.esa.int/panel/#/navigation/help).\n\n\n## Installation\n\n```shx\npip install ptwrapper\n```\n\n## Development and testing\n\n* Clone this repository\n* Requirements:\n * Python 3.7+\n* Create a virtual environment and install the dependencies\n\n```shx\npip install -e .\n```\n\nRun the tests with in the `tests` directory with:\n\n```shell\npython3 -m unittest\n```\n\n\n## Using the library\n\nAfter installing the library can be used with the Python Shell or with its CLI.\n\n\n### Python Shell\n\nA basic test of the library for a PTR processing is provided. The sample creates in the working directory a structure \nfolder to invoke the execution and dumps inside the OUTPUT folder the expected products (SPICE CK, resolved PTR, \navailable Power, and quaternions CSV)\n\n```\nimport os\n\nfrom ptwrapper import execute\nfrom ptwrapper import create_structure\n\nptr_content = """<prm>\n <body>\n <segment>\n <data>\n <timeline frame="SC">\n <block ref="OBS">\n <startTime>2030-10-15T03:40:00</startTime>\n <endTime>2030-10-15T04:15:00</endTime>\n <attitude ref="track">\n <boresight ref="SC_Zaxis"/>\n <target ref="Jupiter"/>\n <phaseAngle ref="powerOptimised">\n <yDir>false</yDir>\n </phaseAngle>\n </attitude>\n <metadata>\n <comment>Track Power Optimised C3.0</comment>\n </metadata>\n </block>\n </timeline>\n </data>\n </segment>\n </body>\n</prm>\n"""\nmk_path = \'metakernel.tm\'\nsession_file_path = create_structure(\'.\', mk_path, ptr_content)\nexecute(os.path.dirname(session_file_path), session_file_path)\n```\n\n### Command line interface\n\nThe package has a CLI entry point:\n\n```shell\nptwrapper -h\n\nusage: ptwrapper [-h] [-s SESSION_FILE] [-m META_KERNEL] [-p PTR] [-w WORKING_DIR] [-o OUTPUT_DIR] [-t TIME_STEP] [-np] [-sa] [-mga] [-q] [-f] [-v]\n\nPointing Tool Wrapper (PTWrapper) simulates a PTR and generates the corresponding resolved PTR, SPICE CK kernels,and other attitude related files. PTWrapper uses OSVE to simulate the PTR.\n\noptional arguments:\n -h, --help show this help message and exit\n -s SESSION_FILE, --session-file SESSION_FILE\n Path to the session file to run the simulation. If provided the other arguments are ignored.\n -m META_KERNEL, --meta-kernel META_KERNEL\n Path to the meta-kernel file.\n -p PTR, --ptr PTR Path to the PTR/PTX file input file.\n -w WORKING_DIR, --working-dir WORKING_DIR\n Path to the working directory. Default is the current directory.\n -o OUTPUT_DIR, --output-dir OUTPUT_DIR\n Path to the output directory. Overwrites default output file names. Default is the structure of the built-in session file.\n -t TIME_STEP, --time-step TIME_STEP\n Output CK file time step in seconds. Default is 5s.\n -np, --no-power Indicates not to calculate available power. Default is that the Available Power will be computed.\n -sa, --sa-ck Generate the Solar Arrays SPICE CK. Default is that the SA CK is not generated.\n -mga, --mga-ck Generate the Medium Gain Antenna SPICE CK. Default is that the MGA CK is not generated.\n -q, --quaternions Calculate the quaternions. Default is that the quaternions will not be computed.\n -f, --fixed-definitions\n Print the AGM Fixed Definitions in use for PTR design.\n -v, --version OSVE, AGM, and EPS libraries version.\n```\n\nYou can either run the CLI using an OSVE configuration file (`SESSION_FILE`) or by specifying a \nnumber of inputs and assume the rest of parameters as provided by the default configuration file \nincluded in the package. \n\nIn addition, if you do not specify an output directory (`OUTPUT_DIR`), the package will replicate\nthe canonical output directory and file structure and will also generate a `SESSION_FILE` that can\nbe reused. Contrarily, if you specify an `OUTPUT_DIR` the output will be simplified and provided in\nthat directory; additionally the output files will inherit the name of the input `PTR` file.\n\n> **WARNING:** Remember that the input `META_KERNEL` needs to have an adequate \n> relative or absolute path for its `PATH_VALUES` variable value.\n\nA couple of examples are provided hereunder. First specifying the output directory:\n\n```shell\nptwrapper -m kernels/juice_mini_local.tm -p ptr_simphony.xml -o . \n\nptwrapper session execution\nAGM version: 9.3.0.p1\nOSVE version: 1.6.0\n[INFO] <AGE> Attitude Generation Module initialization started\n[INFO] <AGE> AGE module setup started\n[INFO] <AGE> AGE module setup successfully completed\n[INFO] <AGE> Attitude Generation Module initialization completed\n[INFO] <AGE> Loading Attitude Timeline\n[INFO] <AGE> Checking Attitude Timeline\n[INFO] <AGE> Initializing Attitude Timeline\n[INFO] <AGE> TOTAL ENERGY for POINTING block from 2030-10-15T03:40:00Z to 2030-10-15T04:15:00Z\n[INFO] <AGE> Attitude from actual PTR: 812.096753 Wh (812.096753 Wh)\n[INFO] <AGE> Attitude from loaded CK: 812.096096 Wh (812.096096 Wh)\n[INFO] <PIF> XML PTR file: "ptr_resolved.ptx" generated\n[INFO] <PIF> Generating CK file with the following USER DEFINED parameters:\n[INFO] <PIF> CK frame ID: -28001\n[INFO] <PIF> CK time step: 5 s\n[INFO] <AGE> Writing Attitude Spice CK File: juice_sc_ptr.bc\n[INFO] <PIF> CK file: "juice_sc_ptr.bc" generated\n[INFO] <AGE> Writing Attitude Text File\n[INFO] <PIF> POWER CSV file: "power.csv" generated\nRenaming quaternions.csv to ptr_simphony_quaternions.csv\nRenaming power.csv to ptr_simphony_power.csv\nRenaming ptr_resolved.ptx to ptr_simphony_resolved.ptx\nRenaming juice_sc_ptr.bc to ptr_simphony.bc\nCleaning up OSVE execution files and directories\n```\n\nThis will generate the following output files.\n\n```shell\n.\n|-- ptr_simphony.bc\n|-- ptr_simphony.csv\n|-- ptr_simphony.xml\n|-- ptr_simphony_log.json\n`-- ptr_simphony_resolved.ptx\n```\n\nThe same run without specifying the `OUTPUT_DIRECTORY` yields the following directory structure:\n\n```shell\n.\n|-- config\n| |-- age\n| | |-- cfg_agm_jui_jupiter.xml\n| | |-- cfg_agm_jui_multibody_event_definitions.xml\n| | |-- cfg_agm_jui_multibody_fixed_definitions.xml\n| | `-- cfg_agm_jui_multibody_predefined_block.xml\n| `-- ise\n| |-- BRF_MAL_SGICD_2_1_300101_351005.brf\n| |-- RES_C50_SA_CELLS_EFFICIENCY_310101_351003.csv\n| |-- eps.cfg\n| |-- events.juice.def\n| |-- phs_com_res_sa_cells_count.asc\n| `-- units.def\n|-- kernel\n| `-- juice_mini_local.tm\n|-- output\n| |-- juice_sc_ptr.bc\n| |-- power.csv\n| |-- ptr_resolved.ptx\n| |-- log.json\n| `-- quaternions.csv\n|-- ptr\n| `-- PTR_PT_V1.ptx\n`-- session_file.json\n```',
30
+ 'author': 'Marc Costa',
31
+ 'author_email': 'marc.costa@ext.esa.int',
32
+ 'maintainer': 'None',
33
+ 'maintainer_email': 'None',
34
+ 'url': 'https://juigitlab.esac.esa.int/core-system/uplink/auxiliary-tools/ptwrapper',
35
+ 'package_dir': package_dir,
36
+ 'packages': packages,
37
+ 'package_data': package_data,
38
+ 'install_requires': install_requires,
39
+ 'entry_points': entry_points,
40
+ 'python_requires': '>=3.8,<4.0',
41
+ }
42
+
43
+
44
+ setup(**setup_kwargs)
@@ -1,3 +1,3 @@
1
1
  from .utils import create_structure
2
2
  from .utils import remove_directory_if_empty
3
- from .cli import execute
3
+ from .cli import execute
@@ -1,4 +1,3 @@
1
- """PTR Command Line Interface module."""
2
1
  import os
3
2
  import sys
4
3
  import shutil as sh
@@ -18,7 +17,8 @@ def execute(root_scenario_path, session_file_path):
18
17
 
19
18
  def cli(test=False):
20
19
  """CLI Resolve a PTR and generate a SPICE CK."""
21
- parser = ArgumentParser(description='Pointing Tool Wrapper (PTWrapper) simulates a PTR and generates the corresponding resolved PTR, SPICE CK kernels,'
20
+ parser = ArgumentParser(description='Pointing Tool Wrapper (PTWrapper) simulates a PTR and generates the '
21
+ 'corresponding resolved PTR, SPICE CK kernels,'
22
22
  'and other attitude related files. PTWrapper uses OSVE to simulate the PTR.')
23
23
 
24
24
  # Exclusive group for session-file and the other parameters
@@ -42,6 +42,9 @@ def cli(test=False):
42
42
  "Default is that the MGA CK is not generated.")
43
43
  parser.add_argument("-q", "--quaternions", action="store_true", help="Calculate the quaternions. "
44
44
  "Default is that the quaternions will not be computed.")
45
+ parser.add_argument("-f", "--fixed-definitions",
46
+ help="Print the AGM Fixed Definitions in use for PTR design.",
47
+ action="store_true")
45
48
  parser.add_argument("-v", "--version",
46
49
  help="OSVE, AGM, and EPS libraries version.",
47
50
  action="store_true")
@@ -58,6 +61,20 @@ def cli(test=False):
58
61
  print("")
59
62
  sys.exit(1)
60
63
 
64
+ if args.fixed_definitions:
65
+ fixed_definitions_filepath = os.path.join(
66
+ os.path.dirname(__file__), "config/age", "cfg_agm_jui_multibody_fixed_definitions.xml"
67
+ )
68
+ try:
69
+ with open(fixed_definitions_filepath, 'r') as file:
70
+ content = file.read()
71
+ print(content)
72
+ except FileNotFoundError:
73
+ print("The file could not be found.")
74
+ except Exception as e:
75
+ print("An error occurred:", e)
76
+ sys.exit(1)
77
+
61
78
  if args.session_file:
62
79
  # Handle session-file exclusively
63
80
  # Do something with args.session_file
@@ -97,72 +114,78 @@ def cli(test=False):
97
114
  execution = execute(root_scenario_path, session_file_path)
98
115
  if execution != 0:
99
116
  print("PTWrapper session ended with ERRORS check your input files")
117
+ if test:
118
+ return parser
100
119
  sys.exit(-1)
101
120
 
102
121
  if args.output_dir:
103
122
  # Post-process the result
104
- fname = args.ptr.split(os.sep)[-1]
105
- if '.xml' in fname:
106
- fname = fname.split('.xml')[0]
107
- elif '.XML' in fname:
108
- fname = fname.split('.XML')[0]
109
- elif '.PTX' in fname:
110
- fname = fname.split('.PTX')[0]
111
- elif '.ptx' in fname:
112
- fname = fname.split('.ptx')[0]
113
- elif '.ptr' in fname:
114
- fname = fname.split('.ptr')[0]
115
- elif '.PTR' in fname:
116
- fname = fname.split('.PTR')[0]
117
- else:
123
+ fname = os.path.split(args.ptr)[-1]
124
+ fname, ext = os.path.splitext(fname)
125
+ ext = ext.lower()
126
+ if ext not in ['.xml', '.ptx', '.ptr']:
118
127
  raise ValueError('Input PTR extension incorrect (not .xml, .XML ,.ptr, .PTR, .ptx or .PTX)')
119
-
120
- fname = fname.lower()
121
- mkname = args.meta_kernel.split(os.sep)[-1]
122
128
  output_dir = os.path.abspath(args.output_dir)
123
129
 
130
+ mkname = os.path.split(args.meta_kernel)[-1]
131
+
124
132
  if args.quaternions:
125
133
  print(f'Renaming quaternions.csv to {fname}_quaternions.csv')
126
- sh.move(f'{root_scenario_path}/output/quaternions.csv', f'{output_dir}/{fname}_quaternions.csv')
134
+ sh.move(os.path.join(root_scenario_path, 'output', 'quaternions.csv'),
135
+ os.path.join(output_dir, f'{fname}_quaternions.csv'))
127
136
 
128
137
  if args.sa_ck:
129
- print(f'Renaming juice_sa_ptr.bc/csv to juice_sa_{fname}.bc/csv')
130
- sh.move(f'{root_scenario_path}/output/juice_sa_ptr.bc', f'{output_dir}/juice_sa_{fname}.bc')
131
- sh.move(f'{root_scenario_path}/output/juice_sa_ptr.csv', f'{output_dir}/juice_sa_{fname}.csv')
138
+ sa_bc_path = os.path.join(root_scenario_path, 'output', 'juice_sa_ptr.bc')
139
+ if os.path.exists(sa_bc_path):
140
+ print(f'Renaming juice_sa_ptr.bc/csv to juice_sa_{fname}.bc/csv')
141
+ sh.move(sa_bc_path, os.path.join(output_dir, f'juice_sa_{fname}.bc'))
142
+ sh.move(os.path.join(root_scenario_path, 'output', 'juice_sa_ptr.csv'),
143
+ os.path.join(output_dir, f'juice_sa_{fname}.csv'))
144
+ else:
145
+ print('SA CSV and CK files not generated.')
132
146
 
133
147
  if args.mga_ck:
134
- print(f'Renaming juice_mga_ptr.bc/csv to juice_mga_{fname}.bc/csv')
135
- sh.move(f'{root_scenario_path}/output/juice_mga_ptr.bc', f'{output_dir}/juice_mga_{fname}.bc')
136
- sh.move(f'{root_scenario_path}/output/juice_mga_ptr.csv', f'{output_dir}/juice_mga_{fname}.csv')
148
+ mga_bc_path = os.path.join(root_scenario_path, 'output', 'juice_mga_ptr.bc')
149
+ if os.path.exists(mga_bc_path):
150
+ print(f'Renaming juice_mga_ptr.bc/csv to juice_mga_{fname}.bc/csv')
151
+ sh.move(mga_bc_path, os.path.join(output_dir, f'juice_mga_{fname}.bc'))
152
+ sh.move(os.path.join(root_scenario_path, 'output', 'juice_mga_ptr.csv'),
153
+ os.path.join(output_dir, f'juice_mga_{fname}.csv'))
154
+ else:
155
+ print('MGA CSV and CK files not generated.')
137
156
 
138
157
  if not args.no_power:
139
- print(f'Renaming power.csv to {fname}_power.csv')
140
- sh.move(f'{root_scenario_path}/output/power.csv', f'{output_dir}/{fname}_power.csv')
158
+ print(f'Renaming power.csv to {fname.lower()}_v01_power.csv')
159
+ sh.move(os.path.join(root_scenario_path, 'output', 'power.csv'),
160
+ os.path.join(output_dir, f'{fname.lower()}_v01_power.csv'))
141
161
 
142
- print(f'Renaming ptr_resolved.ptx to {fname}_resolved.ptx')
143
- sh.move(f'{root_scenario_path}/output/ptr_resolved.ptx', f'{output_dir}/{fname}_resolved.ptx')
162
+ print(f'Renaming ptr_resolved.ptx to {fname.lower()}_v01_resolved.ptx')
163
+ sh.move(os.path.join(root_scenario_path, 'output', 'ptr_resolved.ptx'),
164
+ os.path.join(output_dir, f'{fname.lower()}_v01_resolved.ptx'))
144
165
 
145
- print(f'Renaming juice_sc_ptr.bc to {fname}.bc')
146
- sh.move(f'{root_scenario_path}/output/juice_sc_ptr.bc', f'{output_dir}/juice_sc_{fname}.bc')
166
+ print(f'Renaming juice_sc_ptr.bc to juice_sc_{fname.lower()}_v01.bc')
167
+ sh.move(os.path.join(root_scenario_path, 'output', 'juice_sc_ptr.bc'),
168
+ os.path.join(output_dir, f'juice_sc_{fname.lower()}_v01.bc'))
147
169
 
148
- print(f'Renaming log.json to {fname}_log.json')
149
- sh.move(f'{root_scenario_path}/output/log.json', f'{output_dir}/{fname}_log.json')
170
+ print(f'Renaming log.json to {fname.lower()}_log.json')
171
+ sh.move(os.path.join(root_scenario_path, 'output', 'log.json'),
172
+ os.path.join(output_dir, f'{fname.lower()}_log.json'))
150
173
 
151
174
  print('Cleaning up OSVE execution files and directories')
152
- os.remove(f'{root_scenario_path}/input/PTR_PT_V1.ptx')
153
- os.remove(f'{root_scenario_path}/input/downlink.evf')
154
- os.remove(f'{root_scenario_path}/input/TOP_events.evf')
155
- sh.rmtree(f'{root_scenario_path}/input/edf')
156
- sh.rmtree(f'{root_scenario_path}/input/itl')
157
- os.remove(f'{root_scenario_path}/session_file.json')
158
- sh.rmtree(f'{root_scenario_path}/config/age')
159
- sh.rmtree(f'{root_scenario_path}/config/ise')
160
-
161
- if args.meta_kernel != f'{root_scenario_path}/kernel/{mkname}':
162
- os.remove(f'{root_scenario_path}/kernel/{mkname}')
175
+ os.remove(os.path.join(root_scenario_path, 'input', 'PTR_PT_V1.ptx'))
176
+ os.remove(os.path.join(root_scenario_path, 'input', 'downlink.evf'))
177
+ os.remove(os.path.join(root_scenario_path, 'input', 'TOP_events.evf'))
178
+ sh.rmtree(os.path.join(root_scenario_path, 'input', 'edf'))
179
+ sh.rmtree(os.path.join(root_scenario_path, 'input', 'itl'))
180
+ os.remove(os.path.join(root_scenario_path, 'session_file.json'))
181
+ sh.rmtree(os.path.join(root_scenario_path, 'config', 'age'))
182
+ sh.rmtree(os.path.join(root_scenario_path, 'config', 'ise'))
183
+
184
+ if args.meta_kernel != os.path.join(root_scenario_path, 'kernel', mkname):
185
+ os.remove(os.path.join(root_scenario_path, 'kernel', mkname))
163
186
 
164
187
  for directory in ['kernel', 'output', 'input', 'config']:
165
- remove_directory_if_empty(f'{root_scenario_path}/{directory}')
188
+ remove_directory_if_empty(os.path.join(root_scenario_path, directory))
166
189
 
167
190
  print("PTWrapper session ended successfully")
168
191