imap-processing 0.8.0__py3-none-any.whl → 0.9.0__py3-none-any.whl

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.

Potentially problematic release.


This version of imap-processing might be problematic. Click here for more details.

Files changed (99) hide show
  1. imap_processing/_version.py +2 -2
  2. imap_processing/ccsds/excel_to_xtce.py +2 -0
  3. imap_processing/cdf/config/imap_hi_variable_attrs.yaml +100 -1
  4. imap_processing/cdf/config/imap_hit_global_cdf_attrs.yaml +14 -0
  5. imap_processing/cdf/config/imap_hit_l1a_variable_attrs.yaml +63 -1
  6. imap_processing/cdf/config/imap_idex_global_cdf_attrs.yaml +7 -0
  7. imap_processing/cdf/config/imap_idex_l1a_variable_attrs.yaml +574 -231
  8. imap_processing/cdf/config/imap_idex_l1b_variable_attrs.yaml +326 -0
  9. imap_processing/cdf/config/imap_lo_l1a_variable_attrs.yaml +33 -23
  10. imap_processing/cdf/config/imap_ultra_l1b_variable_attrs.yaml +7 -4
  11. imap_processing/cdf/utils.py +3 -5
  12. imap_processing/cli.py +13 -4
  13. imap_processing/codice/codice_l1a.py +5 -5
  14. imap_processing/codice/constants.py +9 -9
  15. imap_processing/codice/decompress.py +6 -2
  16. imap_processing/glows/l1a/glows_l1a.py +1 -2
  17. imap_processing/hi/l1a/hi_l1a.py +4 -4
  18. imap_processing/hi/l1a/histogram.py +106 -108
  19. imap_processing/hi/l1a/science_direct_event.py +91 -224
  20. imap_processing/hi/packet_definitions/TLM_HI_COMBINED_SCI.xml +3994 -0
  21. imap_processing/hit/l0/constants.py +2 -2
  22. imap_processing/hit/l0/decom_hit.py +12 -101
  23. imap_processing/hit/l1a/hit_l1a.py +164 -23
  24. imap_processing/ialirt/l0/process_codicelo.py +153 -0
  25. imap_processing/ialirt/l0/process_hit.py +5 -5
  26. imap_processing/ialirt/packet_definitions/ialirt_codicelo.xml +281 -0
  27. imap_processing/ialirt/process_ephemeris.py +212 -0
  28. imap_processing/idex/idex_l1a.py +55 -75
  29. imap_processing/idex/idex_l1b.py +192 -0
  30. imap_processing/idex/idex_variable_unpacking_and_eu_conversion.csv +33 -0
  31. imap_processing/idex/packet_definitions/idex_packet_definition.xml +97 -595
  32. imap_processing/lo/l0/decompression_tables/decompression_tables.py +16 -0
  33. imap_processing/lo/l0/lo_science.py +44 -12
  34. imap_processing/lo/l1a/lo_l1a.py +76 -8
  35. imap_processing/lo/packet_definitions/lo_xtce.xml +9877 -87
  36. imap_processing/mag/l1a/mag_l1a.py +1 -2
  37. imap_processing/mag/l1a/mag_l1a_data.py +1 -2
  38. imap_processing/mag/l1b/mag_l1b.py +2 -1
  39. imap_processing/spice/geometry.py +37 -19
  40. imap_processing/spice/time.py +144 -2
  41. imap_processing/swapi/l1/swapi_l1.py +3 -3
  42. imap_processing/swapi/packet_definitions/swapi_packet_definition.xml +1535 -446
  43. imap_processing/swe/l2/swe_l2.py +134 -17
  44. imap_processing/tests/ccsds/test_data/expected_output.xml +1 -1
  45. imap_processing/tests/codice/test_codice_l1a.py +8 -8
  46. imap_processing/tests/codice/test_decompress.py +4 -4
  47. imap_processing/tests/conftest.py +46 -43
  48. imap_processing/tests/hi/test_data/l0/H90_NHK_20241104.bin +0 -0
  49. imap_processing/tests/hi/test_data/l0/H90_sci_cnt_20241104.bin +0 -0
  50. imap_processing/tests/hi/test_data/l0/H90_sci_de_20241104.bin +0 -0
  51. imap_processing/tests/hi/test_hi_l1b.py +2 -2
  52. imap_processing/tests/hi/test_l1a.py +31 -58
  53. imap_processing/tests/hi/test_science_direct_event.py +58 -0
  54. imap_processing/tests/hit/test_data/sci_sample1.ccsds +0 -0
  55. imap_processing/tests/hit/test_decom_hit.py +60 -50
  56. imap_processing/tests/hit/test_hit_l1a.py +327 -12
  57. imap_processing/tests/hit/test_hit_l1b.py +76 -0
  58. imap_processing/tests/hit/validation_data/hskp_sample_eu.csv +89 -0
  59. imap_processing/tests/hit/validation_data/sci_sample_raw1.csv +29 -0
  60. imap_processing/tests/ialirt/test_data/l0/apid01152.tlm +0 -0
  61. imap_processing/tests/ialirt/test_data/l0/imap_codice_l1a_lo-ialirt_20241110193700_v0.0.0.cdf +0 -0
  62. imap_processing/tests/ialirt/unit/test_process_codicelo.py +106 -0
  63. imap_processing/tests/ialirt/unit/test_process_ephemeris.py +109 -0
  64. imap_processing/tests/ialirt/unit/test_process_hit.py +9 -6
  65. imap_processing/tests/idex/conftest.py +1 -1
  66. imap_processing/tests/idex/test_idex_l0.py +1 -1
  67. imap_processing/tests/idex/test_idex_l1a.py +7 -1
  68. imap_processing/tests/idex/test_idex_l1b.py +126 -0
  69. imap_processing/tests/lo/test_lo_l1a.py +7 -16
  70. imap_processing/tests/lo/test_lo_science.py +67 -3
  71. imap_processing/tests/lo/test_pkts/imap_lo_l0_raw_20240803_v002.pkts +0 -0
  72. imap_processing/tests/lo/validation_data/Instrument_FM1_T104_R129_20240803_ILO_SCI_DE_dec_DN_with_fills.csv +1999 -0
  73. imap_processing/tests/mag/test_mag_l1b.py +39 -5
  74. imap_processing/tests/spice/test_geometry.py +32 -6
  75. imap_processing/tests/spice/test_time.py +135 -6
  76. imap_processing/tests/swapi/test_swapi_decom.py +75 -69
  77. imap_processing/tests/swapi/test_swapi_l1.py +4 -4
  78. imap_processing/tests/swe/test_swe_l2.py +64 -8
  79. imap_processing/tests/test_utils.py +1 -1
  80. imap_processing/tests/ultra/test_data/l0/ultra45_raw_sc_ultrarawimg_withFSWcalcs_FM45_40P_Phi28p5_BeamCal_LinearScan_phi2850_theta-000_20240207T102740.csv +3314 -3314
  81. imap_processing/tests/ultra/unit/test_de.py +8 -3
  82. imap_processing/tests/ultra/unit/test_spatial_utils.py +125 -0
  83. imap_processing/tests/ultra/unit/test_ultra_l1b_extended.py +39 -29
  84. imap_processing/tests/ultra/unit/test_ultra_l1c_pset_bins.py +2 -25
  85. imap_processing/ultra/constants.py +4 -0
  86. imap_processing/ultra/l1b/de.py +8 -14
  87. imap_processing/ultra/l1b/ultra_l1b_extended.py +29 -70
  88. imap_processing/ultra/l1c/ultra_l1c_pset_bins.py +1 -36
  89. imap_processing/ultra/utils/spatial_utils.py +221 -0
  90. {imap_processing-0.8.0.dist-info → imap_processing-0.9.0.dist-info}/METADATA +1 -1
  91. {imap_processing-0.8.0.dist-info → imap_processing-0.9.0.dist-info}/RECORD +94 -76
  92. imap_processing/hi/l0/__init__.py +0 -0
  93. imap_processing/hi/l0/decom_hi.py +0 -24
  94. imap_processing/hi/packet_definitions/hi_packet_definition.xml +0 -482
  95. imap_processing/tests/hi/test_decom.py +0 -55
  96. imap_processing/tests/hi/test_l1a_sci_de.py +0 -72
  97. {imap_processing-0.8.0.dist-info → imap_processing-0.9.0.dist-info}/LICENSE +0 -0
  98. {imap_processing-0.8.0.dist-info → imap_processing-0.9.0.dist-info}/WHEEL +0 -0
  99. {imap_processing-0.8.0.dist-info → imap_processing-0.9.0.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,326 @@
1
+ int_fillval: &int_fillval -9223372036854775808
2
+
3
+ max_uint16: &max_uint16 65535
4
+
5
+ data_min: &data_min 0
6
+ data_max: &data_max 4095
7
+
8
+ # <=== Base Attributes ===>
9
+ string_base_attrs: &string_base
10
+ CATDESC: " "
11
+ FIELDNAM: " "
12
+ FORMAT: A3
13
+ LABLAXIS: "none"
14
+ VAR_TYPE: metadata
15
+ DISPLAY_TYPE: no_plot
16
+ DEPEND_0: epoch
17
+ UNITS: " "
18
+
19
+ l1b_data_base: &l1b_data_base
20
+ VALIDMIN: *data_min
21
+ VALIDMAX: *data_max
22
+ DISPLAY_TYPE: spectrogram
23
+ DEPEND_0: epoch
24
+ FORMAT: I12
25
+ UNITS: pC
26
+ VAR_TYPE: data
27
+ CATDESC: ""
28
+ FIELDNAM: ""
29
+ FILLVAL: *max_uint16
30
+ LABLAXIS: ""
31
+
32
+ l1b_tof_base: &l1b_tof_base
33
+ <<: *l1b_data_base
34
+ DEPEND_1: time_high_sr
35
+ LABL_PTR_1: time_high_sr_label
36
+
37
+ l1b_target_base: &l1b_target_base
38
+ <<: *l1b_data_base
39
+ DEPEND_1: time_low_sr
40
+ LABL_PTR_1: time_low_sr_label
41
+
42
+ trigger_base: &trigger_base
43
+ <<: *l1b_data_base
44
+ DISPLAY_TYPE: no_plot
45
+ CATDESC: ""
46
+ UNITS: " "
47
+
48
+ # <=== Instrument Setting Attributes ===>
49
+ tof_high:
50
+ <<: *l1b_tof_base
51
+ CATDESC: Time of flight waveform on the high-gain channel
52
+ FIELDNAM: High Gain Time of Flight
53
+ LABLAXIS: TOF High Ampl
54
+ VAR_NOTES: High gain channel of the time-of-flight signal.
55
+ Sampled at 260 Megasamples per second, with a 10-bit resolution.
56
+ Data is used to quantify dust composition.
57
+
58
+ tof_mid:
59
+ <<: *l1b_tof_base
60
+ CATDESC: Time of flight waveform on the mid-gain channel
61
+ FIELDNAM: Mid Gain Time of Flight
62
+ LABLAXIS: TOF Mid Ampl
63
+ VAR_NOTES: Mid gain channel of the time-of-flight signal.
64
+ Sampled at 260 Megasamples per second, with a 10-bit resolution.
65
+ Data is used to quantify dust composition.
66
+
67
+ tof_low:
68
+ <<: *l1b_tof_base
69
+ CATDESC: Time of flight waveform on the low-gain channel
70
+ FIELDNAM: Low Gain Time of Flight
71
+ LABLAXIS: TOF Low Ampl
72
+ VAR_NOTES: Low gain channel of the time-of-flight signal.
73
+ Sampled at 260 Megasamples per second, with a 10-bit resolution.
74
+ Data is used to quantify dust composition.
75
+
76
+
77
+ target_low:
78
+ <<: *l1b_target_base
79
+ CATDESC: Target low charge sensitive amplifier waveform
80
+ FIELDNAM: Low Target Signal
81
+ LABLAXIS: Low Target Ampl
82
+ VAR_NOTES: Low gain channel of IDEX's target signal.
83
+ Sampled at 3.75 Msps with 12-bit resolution.
84
+ Data is used to quantify dust charge.
85
+
86
+ target_high:
87
+ <<: *l1b_target_base
88
+ CATDESC: Ion grid charge sensitive amplifier waveform
89
+ FIELDNAM: High Target Signal
90
+ LABLAXIS: High Target Ampl
91
+ VAR_NOTES: High gain channel of IDEX's target signal.
92
+ Sampled at 3.75 Msps with 12-bit resolution.
93
+ Data is used to quantify dust charge.
94
+
95
+ ion_grid:
96
+ <<: *l1b_target_base
97
+ CATDESC: Ion grid charge sensitive amplifier waveform data
98
+ FIELDNAM: Ion Grid Signal
99
+ LABLAXIS: Ion Grid Ampl
100
+ VAR_NOTES: This is the ion grid signal from IDEX.
101
+ Sampled at 3.75 Msps with 12-bit resolution.
102
+ Data is used to quantify dust charge.
103
+
104
+ detector_voltage:
105
+ <<: *trigger_base
106
+ FIELDNAM: Detector Voltage
107
+ CATDESC: Voltage reading of Detector on HVPS Board (ADC Channel 0)
108
+ LABLAXIS: Voltage
109
+ UNITS: V
110
+
111
+ sensor_voltage:
112
+ <<: *trigger_base
113
+ FIELDNAM: Sensor Voltage
114
+ CATDESC: Voltage reading of Detector on HVPS Board (ADC Channel 0)
115
+ LABLAXIS: Voltage
116
+ UNITS: V
117
+
118
+ target_voltage:
119
+ <<: *trigger_base
120
+ FIELDNAM: Target Voltage
121
+ CATDESC: Voltage reading of Target on HVPS Board (ADC Channel 2)
122
+ LABLAXIS: Voltage
123
+ UNITS: V
124
+
125
+ reflectron_voltage:
126
+ <<: *trigger_base
127
+ FIELDNAM: Reflectron Voltage
128
+ CATDESC: Voltage reading of Reflectron on HVPS Board (ADC Channel 3)
129
+ LABLAXIS: Voltage
130
+ UNITS: V
131
+
132
+ rejection_voltage:
133
+ <<: *trigger_base
134
+ FIELDNAM: Rejection Voltage
135
+ CATDESC: Voltage reading of Rejection on HVPS Board (ADC Channel 4)
136
+ LABLAXIS: Voltage
137
+ UNITS: V
138
+
139
+ current_hvps_sensor:
140
+ <<: *trigger_base
141
+ FIELDNAM: Detector Current
142
+ CATDESC: Reading of Detector current on HVPS Board (ADC Channel 5)
143
+ LABLAXIS: Current
144
+ UNITS: mA
145
+
146
+ current_1v_pol:
147
+ <<: *trigger_base
148
+ FIELDNAM: 1V POL Current
149
+ CATDESC: High side current reading on 1.0V bus on Processor Board (ADC channel 0)
150
+ LABLAXIS: Current
151
+ UNITS: mA
152
+
153
+ current_1p9v_pol:
154
+ <<: *trigger_base
155
+ FIELDNAM: 1.9V POL Current
156
+ CATDESC: High side current reading on 1.9V bus on Processor Board (ADC channel 1)
157
+ LABLAXIS: Current
158
+ UNITS: mA
159
+
160
+ temperature_1:
161
+ <<: *trigger_base
162
+ FIELDNAM: ProcBd Temp1
163
+ CATDESC: Temperature reading near high speed ADCs on Processor Board (ADC channel 2)
164
+ LABLAXIS: Temperature
165
+ UNITS: C
166
+
167
+ temperature_2:
168
+ <<: *trigger_base
169
+ FIELDNAM: ProcBd Temp2
170
+ CATDESC: Temperature reading near center of Processor Board (ADC channel 3)
171
+ LABLAXIS: Temperature
172
+ UNITS: C
173
+
174
+ voltage_1v_bus:
175
+ <<: *trigger_base
176
+ FIELDNAM: 1V Voltage
177
+ CATDESC: Voltage reading of 1.0V bus on Processor Board (ADC channel 4)
178
+ LABLAXIS: Voltage
179
+ UNITS: V
180
+
181
+ fpga_temperature:
182
+ <<: *trigger_base
183
+ FIELDNAM: FPGA Temp
184
+ CATDESC: Temperature reading on FPGA on Processor Board (ADC channel 5)
185
+ LABLAXIS: Temperature
186
+ UNITS: C
187
+
188
+ voltage_1p9v_bus:
189
+ <<: *trigger_base
190
+ FIELDNAM: 1.9V Voltage
191
+ CATDESC: Voltage reading of 1.9V bus on Processor Board (ADC channel 6)
192
+ LABLAXIS: Voltage
193
+ UNITS: V
194
+
195
+ voltage_3p3v_bus:
196
+ <<: *trigger_base
197
+ FIELDNAM: 3.3V Voltage
198
+ CATDESC: Voltage reading of 3.3V bus on Processor Board (ADC channel 7)
199
+ LABLAXIS: Voltage
200
+ UNITS: V
201
+
202
+ positive_current_hvps:
203
+ <<: *trigger_base
204
+ FIELDNAM: Sensor IP
205
+ CATDESC: Reading of HVPS Sensor positive current (ADC Channel 6)
206
+ LABLAXIS: Current
207
+ UNITS: mA
208
+
209
+ negative_current_hvps:
210
+ <<: *trigger_base
211
+ FIELDNAM: Sensor IN
212
+ CATDESC: Reading of HVPS Sensor negative current (ADC Channel 7)
213
+ LABLAXIS: Current
214
+ UNITS: mA
215
+
216
+ voltage_3p3_ref:
217
+ <<: *trigger_base
218
+ FIELDNAM: P3.3VREF_HK
219
+ CATDESC: Positive voltage reading on +3.3V bus Housekeeping reference on LVPS Board (ADC 0 channel 0)
220
+ LABLAXIS: Voltage
221
+ UNITS: V
222
+
223
+ voltage_3p3_op_ref:
224
+ <<: *trigger_base
225
+ FIELDNAM: P3.3VREF_OP
226
+ CATDESC: Positive voltage reading on +3.3V bus Operations reference on LVPS Board (ADC 0 channel 1)
227
+ LABLAXIS: Voltage
228
+ UNITS: V
229
+
230
+ voltage_neg6v_bus:
231
+ <<: *trigger_base
232
+ FIELDNAM: N6V
233
+ CATDESC: Negative voltage reading on -6V bus on LVPS Board (ADC 0 channel 2)
234
+ LABLAXIS: Voltage
235
+ UNITS: V
236
+
237
+ voltage_pos6v_bus:
238
+ <<: *trigger_base
239
+ FIELDNAM: P6V
240
+ CATDESC: Positive voltage reading on +6V bus on LVPS Board (ADC 0 channel 3)
241
+ LABLAXIS: Voltage
242
+ UNITS: V
243
+
244
+ voltage_pos16v_bus:
245
+ <<: *trigger_base
246
+ FIELDNAM: P16V
247
+ CATDESC: Positive voltage reading on +16V bus on LVPS Board (ADC 0 channel 4)
248
+ LABLAXIS: Voltage
249
+ UNITS: V
250
+
251
+ voltage_pos3p3v_bus:
252
+ <<: *trigger_base
253
+ FIELDNAM: P3.3V
254
+ CATDESC: Positive voltage reading on +3.3V bus on LVPS Board (ADC 0 channel 5)
255
+ LABLAXIS: Voltage
256
+ UNITS: V
257
+
258
+ voltage_neg5v_bus:
259
+ <<: *trigger_base
260
+ FIELDNAM: N5V
261
+ CATDESC: Negative voltage reading on -5V bus on LVPS Board (ADC 0 channel 6)
262
+ LABLAXIS: Voltage
263
+ UNITS: V
264
+
265
+ voltage_pos5v_bus:
266
+ <<: *trigger_base
267
+ FIELDNAM: P5V
268
+ CATDESC: Positive voltage reading on +5V bus on LVPS Board (ADC 0 channel 7)
269
+ LABLAXIS: Voltage
270
+ UNITS: V
271
+
272
+ current_3p3_bus:
273
+ <<: *trigger_base
274
+ FIELDNAM: P3.3_IMON
275
+ CATDESC: Positive current reading on +3.3V bus on LVPS Board (ADC 1 channel 0)
276
+ LABLAXIS: Current
277
+ UNITS: A
278
+
279
+ current_16v_bus:
280
+ <<: *trigger_base
281
+ FIELDNAM: P16V_IMON
282
+ CATDESC: Positive current reading on +16V bus on LVPS Board (ADC 1 channel 1)
283
+ LABLAXIS: Current
284
+ UNITS: A
285
+
286
+ current_6v_bus:
287
+ <<: *trigger_base
288
+ FIELDNAM: P6V_IMON
289
+ CATDESC: Positive current reading on +6V bus on LVPS Board (ADC 1 channel 2)
290
+ LABLAXIS: Current
291
+ UNITS: A
292
+
293
+ current_neg6v_bus:
294
+ <<: *trigger_base
295
+ FIELDNAM: N6V_IMON
296
+ CATDESC: Negative current reading on -6V bus on LVPS Board (ADC 1 channel 3)
297
+ LABLAXIS: Current
298
+ UNITS: A
299
+
300
+ current_5v_bus:
301
+ <<: *trigger_base
302
+ FIELDNAM: P5V_IMON
303
+ CATDESC: Positive current reading on +5V bus on LVPS Board (ADC 1 channel 4)
304
+ LABLAXIS: Current
305
+ UNITS: A
306
+
307
+ current_neg5v_bus:
308
+ <<: *trigger_base
309
+ FIELDNAM: N5V_IMON
310
+ CATDESC: Negative current reading on -5V bus on LVPS Board (ADC 1 channel 5)
311
+ LABLAXIS: Current
312
+ UNITS: A
313
+
314
+ current_2p5v_bus:
315
+ <<: *trigger_base
316
+ FIELDNAM: P2.5V_IMON
317
+ CATDESC: Positive current reading on +2.5V bus on LVPS Board (ADC 1 channel 6)
318
+ LABLAXIS: Current
319
+ UNITS: A
320
+
321
+ current_neg2p5v_bus:
322
+ <<: *trigger_base
323
+ FIELDNAM: N2.5V_IMON
324
+ CATDESC: Negative current reading on -2.5V bus on LVPS Board (ADC 1 channel 7)
325
+ LABLAXIS: Current
326
+ UNITS: A
@@ -51,6 +51,7 @@ de_default_attrs: &de_default
51
51
  <<: *default
52
52
  VAR_TYPE: support_data
53
53
  DEPEND_1: direct_events
54
+ LABL_PTR_1: direct_events_label
54
55
 
55
56
  hist_az_60_default: &hist_az_60_default
56
57
  <<: *default_uint32
@@ -58,6 +59,8 @@ hist_az_60_default: &hist_az_60_default
58
59
  DEPEND_0: epoch
59
60
  DEPEND_1: azimuth_60
60
61
  DEPEND_2: esa_step
62
+ LABL_PTR_1: azimuth_60_label
63
+ LABL_PTR_2: esa_step_label
61
64
 
62
65
  hist_az_6_default: &hist_az_6_default
63
66
  <<: *default_uint32
@@ -65,6 +68,8 @@ hist_az_6_default: &hist_az_6_default
65
68
  DEPEND_0: epoch
66
69
  DEPEND_1: azimuth_6
67
70
  DEPEND_2: esa_step
71
+ LABL_PTR_1: azimuth_6_label
72
+ LABL_PTR_2: esa_step_label
68
73
 
69
74
  spin_default_attrs: &spin_default
70
75
  <<: *default
@@ -88,7 +93,7 @@ esa_step_label:
88
93
  FORMAT: A1
89
94
  VAR_TYPE: metadata
90
95
 
91
- esa_step:
96
+ esa_step_coord:
92
97
  <<: *coord_default
93
98
  <<: *default_uint8
94
99
  VALIDMIN: 1
@@ -111,6 +116,12 @@ shcoarse:
111
116
 
112
117
  # Direct Events Attributes
113
118
  ## Coordinates
119
+ direct_events_label:
120
+ CATDESC: Direct Events
121
+ FIELDNAM: DE
122
+ FORMAT: A15
123
+ VAR_TYPE: metadata
124
+
114
125
  direct_events:
115
126
  <<: *de_default
116
127
  <<: *default_uint32
@@ -129,6 +140,16 @@ de_time:
129
140
  UNITS: microseconds
130
141
  LABLAXIS: DE time
131
142
 
143
+ esa_step:
144
+ <<: *de_default
145
+ <<: *default_uint8
146
+ VALIDMIN: 1
147
+ VALIDMAX: 7
148
+ FORMAT: I1
149
+ CATDESC: Energy Step
150
+ FIELDNAM: Energy Step
151
+ LABLAXIS: ESA
152
+
132
153
  mode:
133
154
  <<: *de_default
134
155
  <<: *default_uint8
@@ -204,11 +225,22 @@ coincidence_type:
204
225
  de_count:
205
226
  <<: *default
206
227
  <<: *default_uint16
228
+ VAR_TYPE: data
207
229
  VALIDMAX: 32767
208
230
  DEPEND_0: epoch
209
231
  CATDESC: Direct Event Counts
210
232
  FIELDNAM: Direct Event Count
211
233
  LABLAXIS: Direct Event Count
234
+
235
+ passes:
236
+ <<: *default
237
+ <<: *default_uint16
238
+ VAR_TYPE: data
239
+ VALIDMAX: 32767
240
+ DEPEND_0: epoch
241
+ CATDESC: Passes through raw data
242
+ FIELDNAM: Direct Event Passes
243
+ LABLAXIS: Direct Event Passes
212
244
  # Direct Events Attributes - END
213
245
 
214
246
  # Histogram Attributes
@@ -250,133 +282,111 @@ start_a:
250
282
  <<: *hist_az_60_default
251
283
  CATDESC: Anode A Singles count
252
284
  FIELDNAM: Anode A Singles Count
253
- LABLAXIS: anode A singles counts
254
285
 
255
286
  start_c:
256
287
  <<: *hist_az_60_default
257
288
  CATDESC: Anode C Singles count
258
289
  FIELDNAM: Anode C Singles count
259
- LABLAXIS: anode c singles count
260
290
 
261
291
  stop_b0:
262
292
  <<: *hist_az_60_default
263
293
  CATDESC: Ion B0 Singles count
264
294
  FIELDNAM: Ion B0 Singles count
265
- LABLAXIS: ion B0 singles count
266
295
 
267
296
  stop_b3:
268
297
  <<: *hist_az_60_default
269
298
  CATDESC: Ion B3 Singles count
270
299
  FIELDNAM: Ion B3 Singles count
271
- LABLAXIS: ion B3 singles count
272
300
 
273
301
  tof0_count:
274
302
  <<: *hist_az_60_default
275
303
  CATDESC: Time of Flight 0 count
276
304
  FIELDNAM: Time of Flight 0 count
277
- LABLAXIS: ToF 0 count
278
305
 
279
306
  tof1_count:
280
307
  <<: *hist_az_60_default
281
308
  CATDESC: Time of Flight 1 count
282
309
  FIELDNAM: Time of Flight 1 count
283
- LABLAXIS: ToF 1 count
284
310
 
285
311
  tof2_count:
286
312
  <<: *hist_az_60_default
287
313
  CATDESC: Time of Flight 2 count
288
314
  FIELDNAM: Time of Flight 2 count
289
- LABLAXIS: ToF 2 count
290
315
 
291
316
  tof3_count:
292
317
  <<: *hist_az_60_default
293
318
  CATDESC: Time of Flight 3 count
294
319
  FIELDNAM: Time of Flight 3 count
295
- LABLAXIS: ToF 3 count
296
320
 
297
321
  tof0_tof1:
298
322
  <<: *hist_az_6_default
299
323
  catdesc: Triple Coincidence 0/1 count
300
324
  FIELDNAM: Triple Coincidence 0/1 count
301
- LABLAXIS: triple coincidence 0/1 count
302
325
 
303
326
  tof0_tof2:
304
327
  <<: *hist_az_6_default
305
328
  CATDESC: Triple Coincidence 0/2 count
306
329
  FIELDNAM: Triple Coincidence 0/2 count
307
- LABLAXIS: triple coincidence 0/2 count
308
330
 
309
331
  tof1_tof2:
310
332
  <<: *hist_az_6_default
311
333
  catdesc: Triple Coincidence 1/2 count
312
334
  FIELDNAM: Triple Coincidence 1/2 count
313
- LABLAXIS: triple 1/2 coincidence count
314
335
 
315
336
  silver:
316
337
  <<: *hist_az_6_default
317
338
  CATDESC: Triple Coincidence silver count
318
339
  FIELDNAM: Triple Coincidence silver count
319
- LABLAXIS: triple coincidence silver count
320
340
 
321
341
  disc_tof0:
322
342
  <<: *hist_az_60_default
323
343
  CATDESC: Discarded Time of Flight 0 count
324
344
  FIELDNAM: Discarded Time of Flight 0 count
325
- LABLAXIS: discarded ToF 0 count
326
345
 
327
346
  disc_tof1:
328
347
  <<: *hist_az_60_default
329
348
  CATDESC: Discarded Time of Flight 1 count
330
349
  FIELDNAM: Discarded Time of Flight 1 count
331
- LABLAXIS: discarded ToF 1 count
332
350
 
333
351
  disc_tof2:
334
352
  <<: *hist_az_60_default
335
353
  CATDESC: Discarded Time of Flight 2 count
336
354
  FIELDNAM: Discarded Time of Flight 2 count
337
- LABLAXIS: discarded ToF 2 count
338
355
 
339
356
  disc_tof3:
340
357
  <<: *hist_az_60_default
341
358
  CATDESC: Discarded Time of Flight 3 count
342
359
  FIELDNAM: Discarded Time of Flight 3 count
343
- LABLAXIS: discarded ToF 3 count
344
360
 
345
361
  pos0:
346
362
  <<: *hist_az_60_default
347
363
  CATDESC: Position 0 count
348
364
  FIELDNAM: Position 0 count
349
- LABLAXIS: position 0 count
350
365
 
351
366
  pos1:
352
367
  <<: *hist_az_60_default
353
368
  CATDESC: Position 1 count
354
369
  FIELDNAM: Position 1 count
355
- LABLAXIS: position 1 count
356
370
 
357
371
  pos2:
358
372
  <<: *hist_az_60_default
359
373
  CATDESC: Position 2 count
360
374
  FIELDNAM: Position 2 count
361
- LABLAXIS: position 2 count
362
375
 
363
376
  pos3:
364
377
  <<: *hist_az_60_default
365
378
  CATDESC: Position 3 count
366
379
  FIELDNAM: Position 3 count
367
- LABLAXIS: position 3 count
368
380
 
369
381
  hydrogen:
370
382
  <<: *hist_az_6_default
371
383
  CATDESC: Hydrogen count
372
384
  FIELDNAM: Hydrogen count
373
- LABLAXIS: hydrogen count
374
385
 
375
386
  oxygen:
376
387
  <<: *hist_az_6_default
377
388
  CATDESC: Oxygen count
378
389
  FIELDNAM: Oxygen count
379
- LABLAXIS: oxygen count
380
390
  # Histogram Attributes - END
381
391
 
382
392
  # Star Sensor Attributes
@@ -163,10 +163,13 @@ energy:
163
163
  UNITS: keV
164
164
 
165
165
  species:
166
- <<: *default_uint8
167
- CATDESC: Species bin (0-255).
168
- FIELDNAM: species
169
- LABLAXIS: species
166
+ <<: *default
167
+ DISPLAY_TYPE: no_plot
168
+ CATDESC: Label species type.
169
+ FIELDNAM: Label species type.
170
+ FILLVAL: "UNKNOWN"
171
+ FORMAT: A8
172
+ dtype: str
170
173
  UNITS: " "
171
174
 
172
175
  front_back_distance:
@@ -13,15 +13,11 @@ from cdflib.xarray.cdf_to_xarray import ISTP_TO_XARRAY_ATTRS
13
13
 
14
14
  import imap_processing
15
15
  from imap_processing._version import __version__, __version_tuple__ # noqa: F401
16
+ from imap_processing.spice.time import J2000_EPOCH
16
17
 
17
18
  logger = logging.getLogger(__name__)
18
19
 
19
20
 
20
- # Reference start time (launch time or epoch)
21
- # DEFAULT_EPOCH = np.datetime64("2010-01-01T00:01:06.184", "ns")
22
- J2000_EPOCH = np.datetime64("2000-01-01T11:58:55.816", "ns")
23
-
24
-
25
21
  def load_cdf(
26
22
  file_path: Path, remove_xarray_attrs: bool = True, **kwargs: dict
27
23
  ) -> xr.Dataset:
@@ -96,6 +92,8 @@ def write_cdf(
96
92
  # Logical_source looks like "imap_swe_l2_counts-1min"
97
93
  instrument, data_level, descriptor = dataset.attrs["Logical_source"].split("_")[1:]
98
94
  # Convert J2000 epoch referenced data to datetime64
95
+ # TODO: This implementation of epoch to time string results in an error of
96
+ # 5 seconds due to 5 leap-second occurrences since the J2000 epoch.
99
97
  dt64 = J2000_EPOCH + dataset["epoch"].values[0].astype("timedelta64[ns]")
100
98
  start_time = np.datetime_as_string(dt64, unit="D").replace("-", "")
101
99
 
imap_processing/cli.py CHANGED
@@ -44,6 +44,7 @@ from imap_processing.hi.l1c import hi_l1c
44
44
  from imap_processing.hit.l1a.hit_l1a import hit_l1a
45
45
  from imap_processing.hit.l1b.hit_l1b import hit_l1b
46
46
  from imap_processing.idex.idex_l1a import PacketParser
47
+ from imap_processing.idex.idex_l1b import idex_l1b
47
48
  from imap_processing.lo.l1a import lo_l1a
48
49
  from imap_processing.lo.l1b import lo_l1b
49
50
  from imap_processing.lo.l1c import lo_l1c
@@ -590,15 +591,23 @@ class Idex(ProcessInstrument):
590
591
  print(f"Processing IDEX {self.data_level}")
591
592
  datasets: list[xr.Dataset] = []
592
593
 
593
- if self.data_level == "l1":
594
+ if self.data_level == "l1a":
594
595
  if len(dependencies) > 1:
595
596
  raise ValueError(
596
- f"Unexpected dependencies found for IDEX L1:"
597
+ f"Unexpected dependencies found for IDEX L1a:"
597
598
  f"{dependencies}. Expected only one dependency."
598
599
  )
599
600
  # read CDF file
600
-
601
- datasets = PacketParser(dependencies[0], self.version).data
601
+ datasets = [PacketParser(dependencies[0], self.version).data]
602
+ elif self.data_level == "l1b":
603
+ if len(dependencies) > 1:
604
+ raise ValueError(
605
+ f"Unexpected dependencies found for IDEX L1b:"
606
+ f"{dependencies}. Expected only one dependency."
607
+ )
608
+ # process data
609
+ dependency = load_cdf(dependencies[0])
610
+ datasets = [idex_l1b(dependency, self.version)]
602
611
  return datasets
603
612
 
604
613
 
@@ -129,12 +129,12 @@ class CoDICEL1aPipeline:
129
129
  for name in self.config["coords"]:
130
130
  if name == "epoch":
131
131
  values = self.dataset.epoch.data
132
+ elif name == "esa_step":
133
+ values = np.arange(self.config["num_energy_steps"])
132
134
  elif name == "inst_az":
133
135
  values = np.arange(self.config["num_positions"])
134
136
  elif name == "spin_sector":
135
137
  values = np.arange(self.config["num_spin_sectors"])
136
- elif name == "esa_step":
137
- values = np.arange(self.config["num_energy_steps"])
138
138
  else:
139
139
  # TODO: Need to implement other types of coords
140
140
  continue
@@ -170,8 +170,8 @@ class CoDICEL1aPipeline:
170
170
  # Stack the data so that it is easier to reshape and iterate over
171
171
  all_data = np.stack(self.data)
172
172
 
173
- # The dimension of all data is (epoch, num_counters, num_positions,
174
- # num_spin_sectors, num_energy_steps) (or may be slightly different
173
+ # The dimension of all data is (epoch, num_counters, num_energy_steps,
174
+ # num_positions, num_spin_sectors) (or may be slightly different
175
175
  # depending on the data product). In any case, iterate over the
176
176
  # num_counters dimension to isolate the data for each counter so
177
177
  # that it can be placed in a CDF data variable.
@@ -353,9 +353,9 @@ class CoDICEL1aPipeline:
353
353
  ).reshape(
354
354
  (
355
355
  self.config["num_counters"],
356
+ self.config["num_energy_steps"],
356
357
  self.config["num_positions"],
357
358
  self.config["num_spin_sectors"],
358
- self.config["num_energy_steps"],
359
359
  )
360
360
  )
361
361
  self.data.append(reshaped_packet_data)