3
3
"""
4
4
5
5
import random
6
- import os .path
7
6
from pathlib import Path
8
7
9
8
import ccsdspy
@@ -31,13 +30,14 @@ def process_file(data_filename: Path) -> list:
31
30
32
31
Parameters
33
32
----------
34
- data_filename: str
35
- Fully specificied filename of an input file
33
+ data_filename: `pathlib.Path`
34
+ Fully specificied filename of an input file.
35
+ The file contents: Traditional binary packets in CCSDS format
36
36
37
37
Returns
38
38
-------
39
- output_filenames: list
40
- Fully specificied filenames for the output files.
39
+ output_filenames: ` list[pathlib.Path]`
40
+ Fully specificied filenames for the output CDF files.
41
41
"""
42
42
log .info (f"Processing file { data_filename } ." )
43
43
output_files = []
@@ -58,12 +58,12 @@ def calibrate_file(data_filename: Path) -> Path:
58
58
59
59
Parameters
60
60
----------
61
- data_filename: Path
61
+ data_filename: `pathlib. Path`
62
62
Fully specificied filename of the input data file.
63
63
64
64
Returns
65
65
-------
66
- output_filename: Path
66
+ output_filename: `pathlib. Path`
67
67
Fully specificied filename of the output file.
68
68
69
69
Examples
@@ -136,7 +136,7 @@ def parse_l0_sci_packets(data_filename: Path) -> dict:
136
136
137
137
Parameters
138
138
----------
139
- data_filename: str
139
+ data_filename: `pathlib.Path`
140
140
Fully specificied filename
141
141
142
142
Returns
@@ -151,11 +151,11 @@ def parse_l0_sci_packets(data_filename: Path) -> dict:
151
151
>>> data = calib.parse_spani_sci_packets(data_filename) # doctest: +SKIP
152
152
"""
153
153
log .info (f"Parsing packets from file:{ data_filename } ." )
154
- data = {}
155
- # pkt = ccsdspy.FixedLength.from_file(
156
- # os.path.join (hermes_spani._data_directory, "SPANI_sci_packet_def.csv")
157
- # )
158
- # data = pkt.load(data_filename)
154
+
155
+ pkt = ccsdspy .FixedLength .from_file (
156
+ Path (hermes_spani ._data_directory ) / "SPANI_sci_packet_def.csv"
157
+ )
158
+ data = pkt .load (data_filename )
159
159
return data
160
160
161
161
@@ -167,12 +167,12 @@ def l0_sci_data_to_cdf(data: dict, original_filename: Path) -> Path:
167
167
----------
168
168
data: dict
169
169
A dictionary of arrays which includes the ccsds header fields
170
- original_filename: Path
170
+ original_filename: `pathlib. Path`
171
171
The Path to the originating file.
172
172
173
173
Returns
174
174
-------
175
- output_filename: Path
175
+ output_filename: `pathlib. Path`
176
176
Fully specificied filename of cdf file
177
177
178
178
Examples
@@ -207,13 +207,13 @@ def get_calibration_file(data_filename: Path, time=None) -> Path:
207
207
208
208
Parameters
209
209
----------
210
- data_filename: str
210
+ data_filename: `pathlib.Path`
211
211
Fully specificied filename of the non-calibrated file (data level < 2)
212
212
time: ~astropy.time.Time
213
213
214
214
Returns
215
215
-------
216
- calib_filename: str
216
+ calib_filename: `pathlib.Path`
217
217
Fully specificied filename for the appropriate calibration file.
218
218
219
219
Examples
@@ -228,12 +228,12 @@ def read_calibration_file(calib_filename: Path):
228
228
229
229
Parameters
230
230
----------
231
- calib_filename: str
231
+ calib_filename: `pathlib.Path`
232
232
Fully specificied filename of the non-calibrated file (data level < 2)
233
233
234
234
Returns
235
235
-------
236
- output_filename: str
236
+ output_filename: `pathlib.Path`
237
237
Fully specificied filename of the appropriate calibration file.
238
238
239
239
Examples
0 commit comments