imap-processing 0.7.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 (172) hide show
  1. imap_processing/__init__.py +1 -1
  2. imap_processing/_version.py +2 -2
  3. imap_processing/ccsds/excel_to_xtce.py +36 -2
  4. imap_processing/cdf/config/imap_codice_global_cdf_attrs.yaml +1 -1
  5. imap_processing/cdf/config/imap_codice_l1a_variable_attrs.yaml +145 -30
  6. imap_processing/cdf/config/imap_glows_l1b_variable_attrs.yaml +36 -36
  7. imap_processing/cdf/config/imap_hi_variable_attrs.yaml +136 -9
  8. imap_processing/cdf/config/imap_hit_global_cdf_attrs.yaml +14 -0
  9. imap_processing/cdf/config/imap_hit_l1a_variable_attrs.yaml +63 -1
  10. imap_processing/cdf/config/imap_hit_l1b_variable_attrs.yaml +9 -0
  11. imap_processing/cdf/config/imap_idex_global_cdf_attrs.yaml +14 -7
  12. imap_processing/cdf/config/imap_idex_l1a_variable_attrs.yaml +577 -235
  13. imap_processing/cdf/config/imap_idex_l1b_variable_attrs.yaml +326 -0
  14. imap_processing/cdf/config/imap_lo_l1a_variable_attrs.yaml +33 -23
  15. imap_processing/cdf/config/imap_mag_l1_variable_attrs.yaml +24 -28
  16. imap_processing/cdf/config/imap_ultra_l1a_variable_attrs.yaml +1 -0
  17. imap_processing/cdf/config/imap_ultra_l1b_variable_attrs.yaml +137 -79
  18. imap_processing/cdf/config/imap_variable_schema.yaml +13 -0
  19. imap_processing/cdf/imap_cdf_manager.py +31 -27
  20. imap_processing/cdf/utils.py +3 -5
  21. imap_processing/cli.py +25 -14
  22. imap_processing/codice/codice_l1a.py +153 -63
  23. imap_processing/codice/constants.py +10 -10
  24. imap_processing/codice/decompress.py +10 -11
  25. imap_processing/codice/utils.py +1 -0
  26. imap_processing/glows/l1a/glows_l1a.py +1 -2
  27. imap_processing/glows/l1b/glows_l1b.py +3 -3
  28. imap_processing/glows/l1b/glows_l1b_data.py +59 -37
  29. imap_processing/glows/l2/glows_l2_data.py +123 -0
  30. imap_processing/hi/l1a/hi_l1a.py +4 -4
  31. imap_processing/hi/l1a/histogram.py +107 -109
  32. imap_processing/hi/l1a/science_direct_event.py +92 -225
  33. imap_processing/hi/l1b/hi_l1b.py +85 -11
  34. imap_processing/hi/l1c/hi_l1c.py +23 -1
  35. imap_processing/hi/packet_definitions/TLM_HI_COMBINED_SCI.xml +3994 -0
  36. imap_processing/hi/utils.py +1 -1
  37. imap_processing/hit/hit_utils.py +221 -0
  38. imap_processing/hit/l0/constants.py +118 -0
  39. imap_processing/hit/l0/decom_hit.py +100 -156
  40. imap_processing/hit/l1a/hit_l1a.py +170 -184
  41. imap_processing/hit/l1b/hit_l1b.py +33 -153
  42. imap_processing/ialirt/l0/process_codicelo.py +153 -0
  43. imap_processing/ialirt/l0/process_hit.py +5 -5
  44. imap_processing/ialirt/packet_definitions/ialirt_codicelo.xml +281 -0
  45. imap_processing/ialirt/process_ephemeris.py +212 -0
  46. imap_processing/idex/idex_l1a.py +65 -84
  47. imap_processing/idex/idex_l1b.py +192 -0
  48. imap_processing/idex/idex_variable_unpacking_and_eu_conversion.csv +33 -0
  49. imap_processing/idex/packet_definitions/idex_packet_definition.xml +97 -595
  50. imap_processing/lo/l0/decompression_tables/decompression_tables.py +17 -1
  51. imap_processing/lo/l0/lo_science.py +45 -13
  52. imap_processing/lo/l1a/lo_l1a.py +76 -8
  53. imap_processing/lo/packet_definitions/lo_xtce.xml +8344 -1849
  54. imap_processing/mag/l0/decom_mag.py +4 -3
  55. imap_processing/mag/l1a/mag_l1a.py +12 -13
  56. imap_processing/mag/l1a/mag_l1a_data.py +1 -2
  57. imap_processing/mag/l1b/mag_l1b.py +90 -7
  58. imap_processing/spice/geometry.py +156 -16
  59. imap_processing/spice/time.py +144 -2
  60. imap_processing/swapi/l1/swapi_l1.py +4 -4
  61. imap_processing/swapi/l2/swapi_l2.py +1 -1
  62. imap_processing/swapi/packet_definitions/swapi_packet_definition.xml +1535 -446
  63. imap_processing/swe/l1b/swe_l1b_science.py +8 -8
  64. imap_processing/swe/l2/swe_l2.py +134 -17
  65. imap_processing/tests/ccsds/test_data/expected_output.xml +2 -1
  66. imap_processing/tests/ccsds/test_excel_to_xtce.py +4 -4
  67. imap_processing/tests/cdf/test_imap_cdf_manager.py +0 -10
  68. imap_processing/tests/codice/conftest.py +1 -17
  69. imap_processing/tests/codice/data/imap_codice_l0_raw_20241110_v001.pkts +0 -0
  70. imap_processing/tests/codice/test_codice_l0.py +8 -2
  71. imap_processing/tests/codice/test_codice_l1a.py +127 -107
  72. imap_processing/tests/codice/test_codice_l1b.py +1 -0
  73. imap_processing/tests/codice/test_decompress.py +7 -7
  74. imap_processing/tests/conftest.py +100 -58
  75. imap_processing/tests/glows/conftest.py +6 -0
  76. imap_processing/tests/glows/test_glows_l1b.py +9 -9
  77. imap_processing/tests/glows/test_glows_l1b_data.py +9 -9
  78. imap_processing/tests/hi/test_data/l0/H90_NHK_20241104.bin +0 -0
  79. imap_processing/tests/hi/test_data/l0/H90_sci_cnt_20241104.bin +0 -0
  80. imap_processing/tests/hi/test_data/l0/H90_sci_de_20241104.bin +0 -0
  81. imap_processing/tests/hi/test_data/l1a/imap_hi_l1a_45sensor-de_20250415_v000.cdf +0 -0
  82. imap_processing/tests/hi/test_hi_l1b.py +73 -3
  83. imap_processing/tests/hi/test_hi_l1c.py +10 -2
  84. imap_processing/tests/hi/test_l1a.py +31 -58
  85. imap_processing/tests/hi/test_science_direct_event.py +58 -0
  86. imap_processing/tests/hi/test_utils.py +4 -3
  87. imap_processing/tests/hit/test_data/sci_sample1.ccsds +0 -0
  88. imap_processing/tests/hit/{test_hit_decom.py → test_decom_hit.py} +95 -36
  89. imap_processing/tests/hit/test_hit_l1a.py +299 -179
  90. imap_processing/tests/hit/test_hit_l1b.py +231 -24
  91. imap_processing/tests/hit/test_hit_utils.py +218 -0
  92. imap_processing/tests/hit/validation_data/hskp_sample_eu.csv +89 -0
  93. imap_processing/tests/hit/validation_data/sci_sample_raw1.csv +29 -0
  94. imap_processing/tests/ialirt/test_data/l0/apid01152.tlm +0 -0
  95. imap_processing/tests/ialirt/test_data/l0/imap_codice_l1a_lo-ialirt_20241110193700_v0.0.0.cdf +0 -0
  96. imap_processing/tests/ialirt/unit/test_process_codicelo.py +106 -0
  97. imap_processing/tests/ialirt/unit/test_process_ephemeris.py +109 -0
  98. imap_processing/tests/ialirt/unit/test_process_hit.py +9 -6
  99. imap_processing/tests/idex/conftest.py +2 -2
  100. imap_processing/tests/idex/imap_idex_l0_raw_20231214_v001.pkts +0 -0
  101. imap_processing/tests/idex/impact_14_tof_high_data.txt +4444 -4444
  102. imap_processing/tests/idex/test_idex_l0.py +4 -4
  103. imap_processing/tests/idex/test_idex_l1a.py +8 -2
  104. imap_processing/tests/idex/test_idex_l1b.py +126 -0
  105. imap_processing/tests/lo/test_lo_l1a.py +7 -16
  106. imap_processing/tests/lo/test_lo_science.py +69 -5
  107. imap_processing/tests/lo/test_pkts/imap_lo_l0_raw_20240803_v002.pkts +0 -0
  108. imap_processing/tests/lo/validation_data/Instrument_FM1_T104_R129_20240803_ILO_SCI_DE_dec_DN_with_fills.csv +1999 -0
  109. imap_processing/tests/mag/imap_mag_l1a_norm-magi_20251017_v001.cdf +0 -0
  110. imap_processing/tests/mag/test_mag_l1b.py +97 -7
  111. imap_processing/tests/spice/test_data/imap_ena_sim_metakernel.template +3 -1
  112. imap_processing/tests/spice/test_geometry.py +115 -9
  113. imap_processing/tests/spice/test_time.py +135 -6
  114. imap_processing/tests/swapi/test_swapi_decom.py +75 -69
  115. imap_processing/tests/swapi/test_swapi_l1.py +4 -4
  116. imap_processing/tests/swe/conftest.py +33 -0
  117. imap_processing/tests/swe/l1_validation/swe_l0_unpacked-data_20240510_v001_VALIDATION_L1B_v3.dat +4332 -0
  118. imap_processing/tests/swe/test_swe_l1b.py +29 -8
  119. imap_processing/tests/swe/test_swe_l2.py +64 -8
  120. imap_processing/tests/test_utils.py +2 -2
  121. imap_processing/tests/ultra/test_data/l0/ultra45_raw_sc_ultrarawimg_withFSWcalcs_FM45_40P_Phi28p5_BeamCal_LinearScan_phi2850_theta-000_20240207T102740.csv +3314 -3314
  122. imap_processing/tests/ultra/test_data/l1/dps_exposure_helio_45_E12.cdf +0 -0
  123. imap_processing/tests/ultra/test_data/l1/dps_exposure_helio_45_E24.cdf +0 -0
  124. imap_processing/tests/ultra/unit/test_de.py +113 -0
  125. imap_processing/tests/ultra/unit/test_spatial_utils.py +125 -0
  126. imap_processing/tests/ultra/unit/test_ultra_l1b.py +27 -3
  127. imap_processing/tests/ultra/unit/test_ultra_l1b_annotated.py +31 -10
  128. imap_processing/tests/ultra/unit/test_ultra_l1b_extended.py +55 -35
  129. imap_processing/tests/ultra/unit/test_ultra_l1c_pset_bins.py +10 -68
  130. imap_processing/ultra/constants.py +12 -3
  131. imap_processing/ultra/l1b/de.py +168 -30
  132. imap_processing/ultra/l1b/ultra_l1b_annotated.py +24 -10
  133. imap_processing/ultra/l1b/ultra_l1b_extended.py +46 -80
  134. imap_processing/ultra/l1c/ultra_l1c_pset_bins.py +60 -144
  135. imap_processing/ultra/utils/spatial_utils.py +221 -0
  136. {imap_processing-0.7.0.dist-info → imap_processing-0.9.0.dist-info}/METADATA +15 -14
  137. {imap_processing-0.7.0.dist-info → imap_processing-0.9.0.dist-info}/RECORD +142 -139
  138. imap_processing/cdf/cdf_attribute_manager.py +0 -322
  139. imap_processing/cdf/config/shared/default_global_cdf_attrs_schema.yaml +0 -246
  140. imap_processing/cdf/config/shared/default_variable_cdf_attrs_schema.yaml +0 -466
  141. imap_processing/hi/l0/decom_hi.py +0 -24
  142. imap_processing/hi/packet_definitions/hi_packet_definition.xml +0 -482
  143. imap_processing/hit/l0/data_classes/housekeeping.py +0 -240
  144. imap_processing/hit/l0/data_classes/science_packet.py +0 -259
  145. imap_processing/hit/l0/utils/hit_base.py +0 -57
  146. imap_processing/tests/cdf/shared/default_global_cdf_attrs_schema.yaml +0 -246
  147. imap_processing/tests/cdf/shared/default_variable_cdf_attrs_schema.yaml +0 -466
  148. imap_processing/tests/cdf/test_cdf_attribute_manager.py +0 -353
  149. imap_processing/tests/codice/data/imap_codice_l0_hi-counters-aggregated_20240429_v001.pkts +0 -0
  150. imap_processing/tests/codice/data/imap_codice_l0_hi-counters-singles_20240429_v001.pkts +0 -0
  151. imap_processing/tests/codice/data/imap_codice_l0_hi-omni_20240429_v001.pkts +0 -0
  152. imap_processing/tests/codice/data/imap_codice_l0_hi-pha_20240429_v001.pkts +0 -0
  153. imap_processing/tests/codice/data/imap_codice_l0_hi-sectored_20240429_v001.pkts +0 -0
  154. imap_processing/tests/codice/data/imap_codice_l0_hskp_20100101_v001.pkts +0 -0
  155. imap_processing/tests/codice/data/imap_codice_l0_lo-counters-aggregated_20240429_v001.pkts +0 -0
  156. imap_processing/tests/codice/data/imap_codice_l0_lo-counters-singles_20240429_v001.pkts +0 -0
  157. imap_processing/tests/codice/data/imap_codice_l0_lo-nsw-angular_20240429_v001.pkts +0 -0
  158. imap_processing/tests/codice/data/imap_codice_l0_lo-nsw-priority_20240429_v001.pkts +0 -0
  159. imap_processing/tests/codice/data/imap_codice_l0_lo-nsw-species_20240429_v001.pkts +0 -0
  160. imap_processing/tests/codice/data/imap_codice_l0_lo-pha_20240429_v001.pkts +0 -0
  161. imap_processing/tests/codice/data/imap_codice_l0_lo-sw-angular_20240429_v001.pkts +0 -0
  162. imap_processing/tests/codice/data/imap_codice_l0_lo-sw-priority_20240429_v001.pkts +0 -0
  163. imap_processing/tests/codice/data/imap_codice_l0_lo-sw-species_20240429_v001.pkts +0 -0
  164. imap_processing/tests/hi/test_decom.py +0 -55
  165. imap_processing/tests/hi/test_l1a_sci_de.py +0 -72
  166. imap_processing/tests/idex/imap_idex_l0_raw_20230725_v001.pkts +0 -0
  167. imap_processing/tests/mag/imap_mag_l1a_burst-magi_20231025_v001.cdf +0 -0
  168. /imap_processing/{hi/l0/__init__.py → tests/glows/test_glows_l2_data.py} +0 -0
  169. /imap_processing/tests/hit/test_data/{imap_hit_l0_hk_20100105_v001.pkts → imap_hit_l0_raw_20100105_v001.pkts} +0 -0
  170. {imap_processing-0.7.0.dist-info → imap_processing-0.9.0.dist-info}/LICENSE +0 -0
  171. {imap_processing-0.7.0.dist-info → imap_processing-0.9.0.dist-info}/WHEEL +0 -0
  172. {imap_processing-0.7.0.dist-info → imap_processing-0.9.0.dist-info}/entry_points.txt +0 -0
@@ -3,210 +3,268 @@ default_attrs: &default
3
3
  DEPEND_0: epoch
4
4
  DISPLAY_TYPE: time_series
5
5
  FILLVAL: -9223372036854775808
6
- FORMAT: I19
7
- VALIDMIN: 0
6
+ FORMAT: I12
7
+ VALIDMIN: -9223372036854775808
8
8
  VALIDMAX: 9223372036854775807
9
9
  VAR_TYPE: data
10
+ UNITS: " "
10
11
 
11
- x_front:
12
+ default_uint8_attrs: &default_uint8
13
+ <<: *default
14
+ FILLVAL: 255
15
+ FORMAT: I3
16
+ VALIDMIN: 0
17
+ VALIDMAX: 255
18
+ dtype: uint8
19
+
20
+ default_uint16_attrs: &default_uint16
21
+ <<: *default
22
+ FILLVAL: 65535
23
+ FORMAT: I5
24
+ VALIDMIN: 0
25
+ VALIDMAX: 65535
26
+ dtype: uint16
27
+
28
+ default_uint32_attrs: &default_uint32
29
+ <<: *default
30
+ FILLVAL: 4294967295
31
+ FORMAT: I10
32
+ VALIDMIN: 0
33
+ VALIDMAX: 4294967295
34
+ dtype: uint32
35
+
36
+ default_int64_attrs: &default_int64
37
+ <<: *default
38
+ FILLVAL: -9223372036854775808
39
+ FORMAT: I20
40
+ VALIDMIN: -9223372036854775808
41
+ VALIDMAX: 9223372036854775807
42
+ dtype: int64
43
+
44
+ default_int32_attrs: &default_int32
45
+ <<: *default
46
+ FILLVAL: -2147483648
47
+ FORMAT: I10
48
+ VALIDMIN: -2147483648
49
+ VALIDMAX: 2147483647
50
+ dtype: int32
51
+
52
+ default_float32_attrs: &default_float32
12
53
  <<: *default
54
+ FILLVAL: .NAN
55
+ FORMAT: F12.6
56
+ VALIDMIN: -3.4028235e+38
57
+ VALIDMAX: 3.4028235e+38
58
+ dtype: float32
59
+
60
+ x_front:
61
+ <<: *default_float32
13
62
  CATDESC: x front position
14
63
  FIELDNAM: Event x-position on front foil
15
64
  LABLAXIS: x front position
16
- # TODO: come back to format
17
- UNITS: mm
65
+ UNITS: mm / 100
18
66
 
19
67
  y_front:
20
- <<: *default
68
+ <<: *default_float32
21
69
  CATDESC: y front position
22
70
  FIELDNAM: Event y-position on front foil
23
71
  LABLAXIS: y front position
24
- # TODO: come back to format
25
- UNITS: mm
72
+ UNITS: mm / 100
26
73
 
27
74
  x_back:
28
- <<: *default
75
+ <<: *default_float32
29
76
  CATDESC: x back position
30
77
  FIELDNAM: x_back
31
78
  LABLAXIS: x back position
32
- # TODO: come back to format
33
- UNITS: mm
79
+ UNITS: mm / 100
34
80
 
35
81
  y_back:
36
- <<: *default
82
+ <<: *default_float32
37
83
  CATDESC: y back position
38
84
  FIELDNAM: y_back
39
85
  LABLAXIS: y back position
40
- # TODO: come back to format
41
- UNITS: mm
86
+ UNITS: mm / 100
42
87
 
43
88
  x_coin:
44
- <<: *default
89
+ <<: *default_float32
45
90
  CATDESC: x coincidence position
46
91
  FIELDNAM: x_coin
47
92
  LABLAXIS: x coincidence position
48
- # TODO: come back to format
49
- UNITS: mm
93
+ UNITS: mm / 100
50
94
 
51
95
  tof_start_stop:
52
- <<: *default
96
+ <<: *default_float32
53
97
  CATDESC: Particle time of flight from start to stop
54
98
  FIELDNAM: tof_start_stop
55
99
  LABLAXIS: tof start stop
56
- # TODO: come back to format
57
- UNITS: ns
100
+ UNITS: nanosecond / 10
58
101
 
59
102
  tof_stop_coin:
60
- <<: *default
103
+ <<: *default_float32
61
104
  CATDESC: Particle time of flight from stop to coincidence
62
105
  FIELDNAM: tof_stop_coin
63
106
  LABLAXIS: tof stop coin
64
- # TODO: come back to format
65
- UNITS: ns
107
+ UNITS: nanosecond / 10
66
108
 
67
109
  tof_corrected:
68
- <<: *default
110
+ <<: *default_float32
69
111
  CATDESC: Corrected time of flight
70
112
  FIELDNAM: tof_corrected
71
113
  LABLAXIS: tof corrected
72
- # TODO: come back to format
73
- UNITS: ns
114
+ UNITS: nanosecond / 10
74
115
 
75
- eventtype:
76
- <<: *default
116
+ event_type:
117
+ <<: *default_uint8
77
118
  CATDESC: Eventtype (1-2 top and bottom stop types; 8-15 ssd stop types)
78
- FIELDNAM: eventtype
79
- LABLAXIS: eventtype
80
- # TODO: come back to format
119
+ FIELDNAM: Event type
120
+ LABLAXIS: event type
121
+ UNITS: " "
122
+
123
+ coincidence_type:
124
+ <<: *default_uint8
125
+ CATDESC: Coincidence type for the direct event (1-2 top and bottom)
126
+ FIELDNAM: Coincidence type
127
+ LABLAXIS: coincidence type
128
+ UNITS: " "
129
+
130
+ start_type:
131
+ <<: *default_uint8
132
+ CATDESC: Start type for the direct event (1-2 left and right)
133
+ FIELDNAM: Start type
134
+ LABLAXIS: start type
81
135
  UNITS: " "
82
136
 
83
137
  vx_ultra:
84
- <<: *default
138
+ <<: *default_float32
85
139
  CATDESC: Normalized component of the velocity vector in x direction in the instrument frame.
86
140
  FIELDNAM: vx_ultra
87
141
  LABLAXIS: vx ultra
88
- # TODO: come back to format
89
142
  UNITS: " "
90
143
 
91
144
  vy_ultra:
92
- <<: *default
145
+ <<: *default_float32
93
146
  CATDESC: Normalized component of the velocity vector in y direction in the instrument frame.
94
147
  FIELDNAM: vy_ultra
95
148
  LABLAXIS: vy ultra
96
- # TODO: come back to format
97
149
  UNITS: " "
98
150
 
99
151
  vz_ultra:
100
- <<: *default
152
+ <<: *default_float32
101
153
  CATDESC: Normalized component of the velocity vector in z direction in the instrument frame.
102
154
  FIELDNAM: vz_ultra
103
155
  LABLAXIS: vz ultra
104
- # TODO: come back to format
105
156
  UNITS: " "
106
157
 
107
158
  energy:
108
- <<: *default
159
+ <<: *default_float32
109
160
  CATDESC: Energy measured using the pulse height from the stop anode (DN) or Energy measured using the SSD (keV) depending on eventtype.
110
161
  FIELDNAM: energy
111
162
  LABLAXIS: energy
112
- # TODO: come back to format
113
163
  UNITS: keV
114
164
 
115
165
  species:
116
166
  <<: *default
117
- CATDESC: Species bin.
118
- FIELDNAM: species
119
- LABLAXIS: species
120
- # TODO: come back to format
167
+ DISPLAY_TYPE: no_plot
168
+ CATDESC: Label species type.
169
+ FIELDNAM: Label species type.
170
+ FILLVAL: "UNKNOWN"
171
+ FORMAT: A8
172
+ dtype: str
121
173
  UNITS: " "
122
174
 
175
+ front_back_distance:
176
+ <<: *default_float32
177
+ CATDESC: Distance front to back.
178
+ FIELDNAM: front_back_distance
179
+ LABLAXIS: front_back_distance
180
+ UNITS: mm / 100
181
+
182
+ path_length:
183
+ <<: *default_float32
184
+ CATDESC: Path length.
185
+ FIELDNAM: path_length
186
+ LABLAXIS: path_length
187
+ UNITS: mm / 100
188
+
123
189
  event_efficiency:
124
- <<: *default
190
+ <<: *default_float32
125
191
  CATDESC: Estimated event efficiency for this path through the instrument.
126
192
  FIELDNAM: event_efficiency
127
193
  LABLAXIS: event efficiency
128
- # TODO: come back to format
129
194
  UNITS: " "
130
195
 
131
196
  vx_sc:
132
- <<: *default
133
- CATDESC: Normalized component of the velocity vector in x direction in the spacecraft frame.
197
+ <<: *default_float32
198
+ CATDESC: x-component of the velocity vector of the ena in the spacecraft frame.
134
199
  FIELDNAM: vx_sc
135
200
  LABLAXIS: vx sc
136
- # TODO: come back to format
137
201
  UNITS: " "
138
202
 
139
203
  vy_sc:
140
- <<: *default
141
- CATDESC: Normalized component of the velocity vector in y direction in the spacecraft frame.
204
+ <<: *default_float32
205
+ CATDESC: y-component of the velocity vector of the ena in the spacecraft frame.
142
206
  FIELDNAM: vy_sc
143
207
  LABLAXIS: vy sc
144
- # TODO: come back to format
145
208
  UNITS: " "
146
209
 
147
210
  vz_sc:
148
- <<: *default
149
- CATDESC: Normalized component of the velocity vector in z direction in the spacecraft frame.
211
+ <<: *default_float32
212
+ CATDESC: z-component of the velocity vector of the ena in the spacecraft frame.
150
213
  FIELDNAM: vz_sc
151
214
  LABLAXIS: vz sc
152
- # TODO: come back to format
153
215
  UNITS: " "
154
216
 
155
217
  vx_dps_sc:
156
- <<: *default
157
- CATDESC: Normalized component of the velocity vector in x direction in the DPS frame at rest WRT spacecraft (velocity w/ spacecraft frame subtracted)
218
+ <<: *default_float32
219
+ CATDESC: x-component of the velocity vector of the ena in the DPS frame at rest WRT spacecraft.
158
220
  FIELDNAM: vx_dps_sc
159
221
  LABLAXIS: vx dps sc
160
- # TODO: come back to format
161
222
  UNITS: " "
162
223
 
163
224
  vy_dps_sc:
164
- <<: *default
165
- CATDESC: Normalized component of the velocity vector in y direction in the DPS frame at rest WRT spacecraft (velocity w/ spacecraft frame subtracted)
225
+ <<: *default_float32
226
+ CATDESC: y-component of the velocity vector of the ena in the DPS frame at rest WRT spacecraft.
166
227
  FIELDNAM: vy_dps_sc
167
228
  LABLAXIS: vy dps sc
168
- # TODO: come back to format
169
229
  UNITS: " "
170
230
 
171
231
  vz_dps_sc:
172
- <<: *default
173
- CATDESC: Normalized component of the velocity vector in z direction in the DPS frame at rest WRT spacecraft (velocity w/ spacecraft frame subtracted)
232
+ <<: *default_float32
233
+ CATDESC: z-component of the velocity vector of the ena in the DPS frame at rest WRT spacecraft.
174
234
  FIELDNAM: vz_dps_sc
175
235
  LABLAXIS: vz dps sc
176
- # TODO: come back to format
177
236
  UNITS: " "
178
237
 
179
238
  vx_dps_helio:
180
- <<: *default
181
- CATDESC: Normalized component of the velocity vector in x direction in the DPS frame at rest WRT heliosphere.
239
+ <<: *default_float32
240
+ CATDESC: x-component of the velocity vector of the ena in the DPS frame at rest WRT heliosphere.
182
241
  FIELDNAM: vx_dps_helio
183
242
  LABLAXIS: vx dps helio
184
- # TODO: come back to format
185
243
  UNITS: " "
186
244
 
187
245
  vy_dps_helio:
188
- <<: *default
189
- CATDESC: Normalized component of the velocity vector in y direction in the DPS frame at rest WRT heliosphere.
246
+ <<: *default_float32
247
+ CATDESC: y-component of the velocity vector of the ena in the DPS frame at rest WRT heliosphere.
190
248
  FIELDNAM: vy_dps_helio
191
249
  LABLAXIS: vy dps helio
192
- # TODO: come back to format
193
250
  UNITS: " "
194
251
 
195
252
  vz_dps_helio:
196
- <<: *default
197
- CATDESC: Normalized component of the velocity vector in z direction in the DPS frame at rest WRT heliosphere.
253
+ <<: *default_float32
254
+ CATDESC: z-component of the velocity vector of the ena in the DPS frame at rest WRT heliosphere.
198
255
  FIELDNAM: vz_dps_helio
199
256
  LABLAXIS: vz dps helio
200
- # TODO: come back to format
201
257
  UNITS: " "
202
258
 
203
- eventtimes:
204
- <<: *default
205
- CATDESC: Event times calculated from event and universal spin table.
206
- FIELDNAM: eventtimes
207
- LABLAXIS: event times
208
- # TODO: come back to format
209
- UNITS: " "
259
+ de_event_met:
260
+ <<: *default_int64
261
+ CATDESC: Mission Elapsed Time (MET) of Direct Event
262
+ DISPLAY_TYPE: no_plot
263
+ FIELDNAM: Mission Elapsed Time
264
+ LABLAXIS: DE MET
265
+ UNITS: ns
266
+ VAR_TYPE: support_data
267
+ SCALE_TYP: linear
210
268
 
211
269
  spin_number:
212
270
  <<: *default
@@ -0,0 +1,13 @@
1
+ # This file acts as an overwrite option for the variable schema described by SAMMI.
2
+ # SAMMI generally has good defaults and its schema should be used, but this is a place
3
+ # to override those defaults if necessary.
4
+
5
+ # This is only required while issue #7 is incomplete.
6
+ attribute_key:
7
+ LABLAXIS:
8
+ description: >
9
+ should be a short character string (approximately 10 characters, but preferably 6 characters - more only if absolutely required for clarity) which can be used to label a y-axis for a plot or to provide a heading for a data listing.
10
+ Only one of LABLAXIS or LABL_PTR_i should be present.
11
+ required: false # not required if using LABL_PTR_i
12
+ valid_values: null
13
+ alternate: LABL_PTR_1
@@ -5,38 +5,31 @@ This class should be used in all cases, and should contain any IMAP specific ass
5
5
  or code.
6
6
  """
7
7
 
8
- from pathlib import Path
9
- from typing import Optional
8
+ from __future__ import annotations
10
9
 
11
- from imap_processing.cdf.cdf_attribute_manager import CdfAttributeManager
10
+ from pathlib import Path
12
11
 
12
+ from sammi.cdf_attribute_manager import CdfAttributeManager
13
13
 
14
- class ImapCdfAttributes(CdfAttributeManager):
15
- """
16
- Contains IMAP specific tools and settings for CDF management.
17
14
 
18
- Parameters
19
- ----------
20
- source_dir : pathlib.Path or None
21
- Source directory.
22
- """
15
+ class ImapCdfAttributes(CdfAttributeManager): # type: ignore [misc]
16
+ """Contains IMAP specific tools and settings for CDF management."""
23
17
 
24
- def __init__(self, source_dir: Optional[Path] = None):
25
- """
26
- Set the path to the config directory.
18
+ def __init__(self) -> None:
19
+ """Set the path to the config directory."""
20
+ self.source_dir = Path(__file__).parent / "config"
27
21
 
28
- Parameters
29
- ----------
30
- source_dir : pathlib.Path or None
31
- Source directory.
32
- """
33
- if source_dir is None:
34
- super().__init__(Path(__file__).parent / "config")
35
- else:
36
- super().__init__(source_dir)
22
+ # TODO: Overwriting schema is not working.
23
+ super().__init__(
24
+ variable_schema_layers=[self.source_dir / "imap_variable_schema.yaml"],
25
+ use_defaults=True,
26
+ )
37
27
 
38
28
  # Load constants attrs that everyone uses
39
- self.load_variable_attributes("imap_constant_attrs.yaml")
29
+ self.load_variable_attributes(self.source_dir / "imap_constant_attrs.yaml")
30
+ self.load_global_attributes(
31
+ self.source_dir / "imap_default_global_cdf_attrs.yaml"
32
+ )
40
33
 
41
34
  def add_instrument_global_attrs(self, instrument: str) -> None:
42
35
  """
@@ -48,9 +41,13 @@ class ImapCdfAttributes(CdfAttributeManager):
48
41
  Instrument name.
49
42
  """
50
43
  # Looks for file named "imap_{instrument}_global_cdf_attrs.yaml"
51
- self.load_global_attributes(f"imap_{instrument}_global_cdf_attrs.yaml")
44
+ self.load_global_attributes(
45
+ self.source_dir / f"imap_{instrument}_global_cdf_attrs.yaml"
46
+ )
52
47
 
53
- def add_instrument_variable_attrs(self, instrument: str, level: str) -> None:
48
+ def add_instrument_variable_attrs(
49
+ self, instrument: str, level: str | None = None
50
+ ) -> None:
54
51
  """
55
52
  Add instrument specific variable attributes.
56
53
 
@@ -61,4 +58,11 @@ class ImapCdfAttributes(CdfAttributeManager):
61
58
  level : str
62
59
  Data level.
63
60
  """
64
- self.load_variable_attributes(f"imap_{instrument}_{level}_variable_attrs.yaml")
61
+ if level is None:
62
+ self.load_variable_attributes(
63
+ self.source_dir / f"imap_{instrument}_variable_attrs.yaml"
64
+ )
65
+ else:
66
+ self.load_variable_attributes(
67
+ self.source_dir / f"imap_{instrument}_{level}_variable_attrs.yaml"
68
+ )
@@ -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
@@ -551,19 +552,21 @@ class Hit(ProcessInstrument):
551
552
  f"Unexpected dependencies found for HIT L1A:"
552
553
  f"{dependencies}. Expected only one dependency."
553
554
  )
554
- # process data and write all processed data to CDF files
555
+ # process data to L1A products
555
556
  datasets = hit_l1a(dependencies[0], self.version)
556
557
 
557
558
  elif self.data_level == "l1b":
558
- if len(dependencies) > 1:
559
- raise ValueError(
560
- f"Unexpected dependencies found for HIT L1B:"
561
- f"{dependencies}. Expected only one dependency."
562
- )
563
- # process data and write all processed data to CDF files
564
- l1a_dataset = load_cdf(dependencies[0])
565
-
566
- datasets = hit_l1b(l1a_dataset, self.version)
559
+ data_dict = {}
560
+ for i, dependency in enumerate(dependencies):
561
+ if self.dependencies[i]["data_level"] == "l0":
562
+ # Add path to CCSDS file to process housekeeping
563
+ data_dict["imap_hit_l0_raw"] = dependency
564
+ else:
565
+ # Add L1A datasets to process science data
566
+ dataset = load_cdf(dependency)
567
+ data_dict[dataset.attrs["Logical_source"]] = dataset
568
+ # process data to L1B products
569
+ datasets = hit_l1b(data_dict, self.version)
567
570
 
568
571
  return datasets
569
572
 
@@ -588,15 +591,23 @@ class Idex(ProcessInstrument):
588
591
  print(f"Processing IDEX {self.data_level}")
589
592
  datasets: list[xr.Dataset] = []
590
593
 
591
- if self.data_level == "l1":
594
+ if self.data_level == "l1a":
592
595
  if len(dependencies) > 1:
593
596
  raise ValueError(
594
- f"Unexpected dependencies found for IDEX L1:"
597
+ f"Unexpected dependencies found for IDEX L1a:"
595
598
  f"{dependencies}. Expected only one dependency."
596
599
  )
597
600
  # read CDF file
598
-
599
- 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)]
600
611
  return datasets
601
612
 
602
613