roc-film 1.13.4__py3-none-any.whl → 1.14.0__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. roc/__init__.py +2 -1
  2. roc/film/__init__.py +2 -2
  3. roc/film/commands.py +372 -323
  4. roc/film/config/__init__.py +0 -1
  5. roc/film/constants.py +101 -65
  6. roc/film/descriptor.json +126 -95
  7. roc/film/exceptions.py +28 -27
  8. roc/film/tasks/__init__.py +16 -16
  9. roc/film/tasks/cat_solo_hk.py +86 -74
  10. roc/film/tasks/cdf_postpro.py +438 -309
  11. roc/film/tasks/check_dds.py +39 -45
  12. roc/film/tasks/db_to_anc_bia_sweep_table.py +381 -0
  13. roc/film/tasks/dds_to_l0.py +232 -180
  14. roc/film/tasks/export_solo_coord.py +147 -0
  15. roc/film/tasks/file_handler.py +91 -75
  16. roc/film/tasks/l0_to_hk.py +117 -103
  17. roc/film/tasks/l0_to_l1_bia_current.py +38 -30
  18. roc/film/tasks/l0_to_l1_bia_sweep.py +417 -329
  19. roc/film/tasks/l0_to_l1_sbm.py +250 -208
  20. roc/film/tasks/l0_to_l1_surv.py +185 -130
  21. roc/film/tasks/make_daily_tm.py +40 -37
  22. roc/film/tasks/merge_tcreport.py +77 -71
  23. roc/film/tasks/merge_tmraw.py +102 -89
  24. roc/film/tasks/parse_dds_xml.py +21 -20
  25. roc/film/tasks/set_l0_utc.py +51 -49
  26. roc/film/tests/cdf_compare.py +565 -0
  27. roc/film/tests/hdf5_compare.py +84 -62
  28. roc/film/tests/test_dds_to_l0.py +93 -51
  29. roc/film/tests/test_dds_to_tc.py +8 -11
  30. roc/film/tests/test_dds_to_tm.py +8 -10
  31. roc/film/tests/test_film.py +161 -116
  32. roc/film/tests/test_l0_to_hk.py +64 -36
  33. roc/film/tests/test_l0_to_l1_bia.py +10 -14
  34. roc/film/tests/test_l0_to_l1_sbm.py +14 -19
  35. roc/film/tests/test_l0_to_l1_surv.py +68 -41
  36. roc/film/tests/test_metadata.py +21 -20
  37. roc/film/tests/tests.py +743 -396
  38. roc/film/tools/__init__.py +5 -5
  39. roc/film/tools/dataset_tasks.py +34 -2
  40. roc/film/tools/file_helpers.py +390 -269
  41. roc/film/tools/l0.py +402 -324
  42. roc/film/tools/metadata.py +147 -127
  43. roc/film/tools/skeleton.py +12 -17
  44. roc/film/tools/tools.py +109 -92
  45. roc/film/tools/xlsx2skt.py +161 -139
  46. {roc_film-1.13.4.dist-info → roc_film-1.14.0.dist-info}/LICENSE +127 -125
  47. roc_film-1.14.0.dist-info/METADATA +60 -0
  48. roc_film-1.14.0.dist-info/RECORD +50 -0
  49. {roc_film-1.13.4.dist-info → roc_film-1.14.0.dist-info}/WHEEL +1 -1
  50. roc/film/tasks/l0_to_anc_bia_sweep_table.py +0 -348
  51. roc_film-1.13.4.dist-info/METADATA +0 -120
  52. roc_film-1.13.4.dist-info/RECORD +0 -48
@@ -2,5 +2,4 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
 
5
-
6
5
  # vim: set tw=79 :
roc/film/constants.py CHANGED
@@ -8,39 +8,48 @@ from datetime import datetime
8
8
  from poppy.core.conf import settings
9
9
  from poppy.core.logger import logger
10
10
 
11
- __all__ = ['PLUGIN',
12
- 'PIPELINE_DATABASE',
13
- 'INPUT_DATETIME_STRFTIME',
14
- 'TIME_ISO_STRFORMAT',
15
- 'TIME_DAILY_STRFORMAT',
16
- 'CDF_TRANGE_STRFORMAT',
17
- 'TIME_GEN_STRFORMAT',
18
- 'TIME_JSON_STRFORMAT',
19
- 'TIME_L0_STRFORMAT',
20
- 'TIME_DOY1_STRFORMAT',
21
- 'TIME_DOY2_STRFORMAT',
22
- 'SCOS_HEADER_BYTES',
23
- 'DATA_VERSION',
24
- 'UNKNOWN_IDB',
25
- 'CHUNK_SIZE',
26
- 'TC_ACK_ALLOWED_STATUS',
27
- 'TEMP_DIR',
28
- 'ARCHIVE_DAILY_DIR',
29
- 'TMRAW_PREFIX_BASENAME',
30
- 'TCREPORT_PREFIX_BASENAME',
31
- 'TC_ACK_ALLOWED_STATUS',
32
- 'ANT_1_FLAG',
33
- 'ANT_2_FLAG',
34
- 'ANT_3_FLAG',
35
- 'TM_PACKET_CATEG',
36
- 'MIN_DATETIME',
37
- 'MAX_DATETIME',
38
- 'PACKET_TYPE',
39
- 'CDFEXPORT_PATH',
40
- 'TIMEOUT',
41
- 'CDF_POST_PRO_OPTS_ARGS',
42
- 'BIA_SWEEP_TABLE_NR',
43
- ]
11
+ __all__ = [
12
+ "PLUGIN",
13
+ "PIPELINE_DATABASE",
14
+ "INPUT_DATETIME_STRFTIME",
15
+ "TIME_ISO_STRFORMAT",
16
+ "TIME_DAILY_STRFORMAT",
17
+ "CDF_TRANGE_STRFORMAT",
18
+ "TIME_GEN_STRFORMAT",
19
+ "TIME_JSON_STRFORMAT",
20
+ "TIME_L0_STRFORMAT",
21
+ "TIME_DOY1_STRFORMAT",
22
+ "TIME_DOY2_STRFORMAT",
23
+ "SCOS_HEADER_BYTES",
24
+ "DATA_VERSION",
25
+ "UNKNOWN_IDB",
26
+ "CHUNK_SIZE",
27
+ "TC_ACK_ALLOWED_STATUS",
28
+ "TEMP_DIR",
29
+ "ARCHIVE_DAILY_DIR",
30
+ "TMRAW_PREFIX_BASENAME",
31
+ "TCREPORT_PREFIX_BASENAME",
32
+ "TC_ACK_ALLOWED_STATUS",
33
+ "ANT_1_FLAG",
34
+ "ANT_2_FLAG",
35
+ "ANT_3_FLAG",
36
+ "TM_PACKET_CATEG",
37
+ "MIN_DATETIME",
38
+ "MAX_DATETIME",
39
+ "PACKET_TYPE",
40
+ "CDFCONVERT_PATH",
41
+ "TIMEOUT",
42
+ "CDF_POST_PRO_OPTS_ARGS",
43
+ "BIA_SWEEP_TABLE_NR",
44
+ "CP_START_TIME",
45
+ "SOLO_START_TIME",
46
+ "SOLO_END_TIME",
47
+ "NAIF_SPICE_ID",
48
+ "TRYOUTS",
49
+ "TIME_WAIT_SEC",
50
+ "SQL_LIMIT",
51
+ "BIA_SWEEP_TABLE_PACKETS",
52
+ ]
44
53
 
45
54
  # root directory of the module
46
55
  _ROOT_DIRECTORY = osp.abspath(
@@ -50,52 +59,59 @@ _ROOT_DIRECTORY = osp.abspath(
50
59
  )
51
60
 
52
61
  # Name of the plugin
53
- PLUGIN = 'roc.film'
62
+ PLUGIN = "roc.film"
54
63
 
55
64
  # Load pipeline database identifier
56
65
  try:
57
66
  PIPELINE_DATABASE = settings.PIPELINE_DATABASE
58
- except:
59
- PIPELINE_DATABASE = 'PIPELINE_DATABASE'
60
- logger.warning(f'settings.PIPELINE_DATABASE not defined for {__file__}, use "{PIPELINE_DATABASE}" by default!')
61
-
67
+ except AttributeError:
68
+ PIPELINE_DATABASE = "PIPELINE_DATABASE"
69
+ logger.warning(
70
+ f'settings.PIPELINE_DATABASE not defined for {__file__}, use "{PIPELINE_DATABASE}" by default!'
71
+ )
62
72
 
63
73
  # STRING format for time
64
- INPUT_DATETIME_STRFTIME = '%Y-%m-%dT%H:%M:%S'
65
- TIME_ISO_STRFORMAT = '%Y-%m-%dT%H:%M:%S.%fZ'
66
- TIME_DAILY_STRFORMAT = '%Y%m%d'
67
- CDF_TRANGE_STRFORMAT = '%Y%m%dT%H%M%S'
68
- TIME_GEN_STRFORMAT = '%Y-%m-%dT%H:%M:%S.%f'
69
- TIME_JSON_STRFORMAT = '%Y-%m-%dT%H:%M:%SZ'
70
- TIME_L0_STRFORMAT = '%Y-%m-%dT%H:%M:%S.%f000Z'
71
- TIME_DOY1_STRFORMAT = '%Y-%jT%H:%M:%S.%fZ'
72
- TIME_DOY2_STRFORMAT = '%Y-%jT%H:%M:%SZ'
74
+ INPUT_DATETIME_STRFTIME = "%Y-%m-%dT%H:%M:%S"
75
+ TIME_ISO_STRFORMAT = "%Y-%m-%dT%H:%M:%S.%fZ"
76
+ TIME_DAILY_STRFORMAT = "%Y%m%d"
77
+ CDF_TRANGE_STRFORMAT = "%Y%m%dT%H%M%S"
78
+ TIME_GEN_STRFORMAT = "%Y-%m-%dT%H:%M:%S.%f"
79
+ TIME_JSON_STRFORMAT = "%Y-%m-%dT%H:%M:%SZ"
80
+ TIME_L0_STRFORMAT = "%Y-%m-%dT%H:%M:%S.%f000Z"
81
+ TIME_DOY1_STRFORMAT = "%Y-%jT%H:%M:%S.%fZ"
82
+ TIME_DOY2_STRFORMAT = "%Y-%jT%H:%M:%SZ"
73
83
 
74
84
  # Datetime values min/max range
75
85
  MIN_DATETIME = datetime(1999, 1, 1)
76
86
  MAX_DATETIME = datetime(2100, 12, 31)
77
87
 
88
+ # SolO mission start/end time
89
+ SOLO_START_TIME = datetime(2020, 2, 10)
90
+ SOLO_END_TIME = datetime(2029, 6, 1)
91
+
92
+ # Cruise Phase start time
93
+ CP_START_TIME = datetime(2020, 6, 15)
94
+
78
95
  # Relative output directory path of the RPW file local archive
79
- ARCHIVE_DAILY_DIR = '%Y/%m/%d'
96
+ ARCHIVE_DAILY_DIR = "%Y/%m/%d"
80
97
 
81
98
  # TmRaw prefix basename
82
- TMRAW_PREFIX_BASENAME = 'solo_TM_rpw'
99
+ TMRAW_PREFIX_BASENAME = "solo_TM_rpw"
83
100
 
84
101
  # TcReport prefix basename
85
- TCREPORT_PREFIX_BASENAME = 'solo_TC_rpw'
102
+ TCREPORT_PREFIX_BASENAME = "solo_TC_rpw"
86
103
 
87
104
  # SOLO HK prefix basename
88
- SOLOHK_PREFIX_BASENAME = 'solo_HK_platform'
105
+ SOLOHK_PREFIX_BASENAME = "solo_HK_platform"
89
106
 
90
107
  # DDS TmRaw SCOS header length in bytes
91
108
  SCOS_HEADER_BYTES = 76
92
109
 
93
-
94
110
  # Default value for data_version
95
- DATA_VERSION = '01'
111
+ DATA_VERSION = "01"
96
112
 
97
113
  # Default IDB source/version values
98
- UNKNOWN_IDB = 'UNKNOWN'
114
+ UNKNOWN_IDB = "UNKNOWN"
99
115
 
100
116
  # Temporary dir
101
117
  TEMP_DIR = tempfile.gettempdir()
@@ -104,7 +120,7 @@ TEMP_DIR = tempfile.gettempdir()
104
120
  CHUNK_SIZE = 10000
105
121
 
106
122
  # TC Packet ack possible status in L0 files
107
- TC_ACK_ALLOWED_STATUS = ['PASSED', 'FAILED']
123
+ TC_ACK_ALLOWED_STATUS = ["PASSED", "FAILED"]
108
124
 
109
125
  # Antenna flags
110
126
  ANT_1_FLAG = 1
@@ -112,24 +128,44 @@ ANT_2_FLAG = 2
112
128
  ANT_3_FLAG = 3
113
129
 
114
130
  # Packet category list
115
- TM_PACKET_CATEG = ['ev', 'hk', 'oth', 'll', 'sci', 'sbm']
131
+ TM_PACKET_CATEG = ["ev", "hk", "oth", "ll", "sci", "sbm"]
116
132
 
117
133
  # Packet type list
118
- PACKET_TYPE = ['TM', 'TC']
134
+ PACKET_TYPE = ["TM", "TC"]
119
135
 
120
- # Path to the cdfexport executable (default)
121
- CDFEXPORT_PATH = '/pipeline/lib/cdf/current/bin/cdfexport'
136
+ # Path to the cdfconvert executable (default)
137
+ CDFCONVERT_PATH = "/pipeline/lib/cdf/current/bin/cdfconvert"
122
138
 
123
139
  # Max process timeout
124
140
  TIMEOUT = 14400
125
141
 
126
142
  # Allowed values for keyword --options in l1_post_pro command
127
- CDF_POST_PRO_OPTS_ARGS = ['soop_type',
128
- 'obs_id',
129
- 'resize_wf',
130
- 'cdf_export',
131
- 'update_cdf',
132
- 'quality_bitmask']
143
+ CDF_POST_PRO_OPTS_ARGS = [
144
+ "soop_type",
145
+ "obs_id",
146
+ "resize_wf",
147
+ "update_cdf",
148
+ "quality_bitmask",
149
+ "cdf_convert",
150
+ ]
133
151
 
134
152
  # Number of max. values that can be stored in the bias sweep table
135
153
  BIA_SWEEP_TABLE_NR = 256
154
+
155
+ # List of NAIF SPICE IDs
156
+ NAIF_SPICE_ID = {
157
+ "SUN": 10,
158
+ "SOLAR_ORBITER": -144,
159
+ }
160
+
161
+ # Number of database connexion tryouts
162
+ TRYOUTS = 3
163
+
164
+ # Time to wait in seconds between two database connection tryouts
165
+ TIME_WAIT_SEC = 3
166
+
167
+ # Limit of rows to be returned by the database
168
+ SQL_LIMIT = 1000000000
169
+
170
+ # Names of TC handling Bias sweep table
171
+ BIA_SWEEP_TABLE_PACKETS = ["TC_DPU_LOAD_BIAS_SWEEP", "TC_DPU_CLEAR_BIAS_SWEEP"]