imap-processing 0.9.0__py3-none-any.whl → 0.11.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 (243) hide show
  1. imap_processing/_version.py +2 -2
  2. imap_processing/cdf/config/imap_codice_l1a_variable_attrs.yaml +749 -442
  3. imap_processing/cdf/config/imap_glows_global_cdf_attrs.yaml +7 -0
  4. imap_processing/cdf/config/imap_glows_l1a_variable_attrs.yaml +8 -2
  5. imap_processing/cdf/config/imap_glows_l1b_variable_attrs.yaml +0 -1
  6. imap_processing/cdf/config/imap_glows_l2_variable_attrs.yaml +358 -0
  7. imap_processing/cdf/config/imap_hi_variable_attrs.yaml +59 -25
  8. imap_processing/cdf/config/imap_hit_global_cdf_attrs.yaml +22 -0
  9. imap_processing/cdf/config/imap_idex_l1a_variable_attrs.yaml +32 -8
  10. imap_processing/cdf/config/imap_idex_l1b_variable_attrs.yaml +94 -5
  11. imap_processing/cdf/config/imap_lo_l1a_variable_attrs.yaml +65 -37
  12. imap_processing/cdf/config/imap_swapi_variable_attrs.yaml +16 -1
  13. imap_processing/cdf/config/imap_swe_global_cdf_attrs.yaml +7 -0
  14. imap_processing/cdf/config/imap_swe_l1a_variable_attrs.yaml +14 -14
  15. imap_processing/cdf/config/imap_swe_l1b_variable_attrs.yaml +25 -24
  16. imap_processing/cdf/config/imap_swe_l2_variable_attrs.yaml +238 -0
  17. imap_processing/cdf/config/imap_ultra_l1b_variable_attrs.yaml +100 -92
  18. imap_processing/cdf/utils.py +2 -2
  19. imap_processing/cli.py +45 -9
  20. imap_processing/codice/codice_l1a.py +104 -58
  21. imap_processing/codice/constants.py +111 -155
  22. imap_processing/codice/data/esa_sweep_values.csv +256 -256
  23. imap_processing/codice/data/lo_stepping_values.csv +128 -128
  24. imap_processing/ena_maps/ena_maps.py +519 -0
  25. imap_processing/ena_maps/utils/map_utils.py +145 -0
  26. imap_processing/ena_maps/utils/spatial_utils.py +226 -0
  27. imap_processing/glows/__init__.py +3 -0
  28. imap_processing/glows/ancillary/imap_glows_pipeline_settings_v001.json +52 -0
  29. imap_processing/glows/l1a/glows_l1a.py +72 -14
  30. imap_processing/glows/l1b/glows_l1b.py +2 -1
  31. imap_processing/glows/l1b/glows_l1b_data.py +25 -1
  32. imap_processing/glows/l2/glows_l2.py +324 -0
  33. imap_processing/glows/l2/glows_l2_data.py +156 -51
  34. imap_processing/hi/l1a/science_direct_event.py +57 -51
  35. imap_processing/hi/l1b/hi_l1b.py +43 -28
  36. imap_processing/hi/l1c/hi_l1c.py +225 -42
  37. imap_processing/hi/utils.py +20 -3
  38. imap_processing/hit/l0/constants.py +2 -2
  39. imap_processing/hit/l0/decom_hit.py +1 -1
  40. imap_processing/hit/l1a/hit_l1a.py +94 -13
  41. imap_processing/hit/l1b/hit_l1b.py +158 -9
  42. imap_processing/ialirt/l0/process_codicehi.py +156 -0
  43. imap_processing/ialirt/l0/process_codicelo.py +5 -2
  44. imap_processing/ialirt/packet_definitions/ialirt.xml +28 -20
  45. imap_processing/ialirt/packet_definitions/ialirt_codicehi.xml +241 -0
  46. imap_processing/ialirt/packet_definitions/ialirt_swapi.xml +170 -0
  47. imap_processing/ialirt/packet_definitions/ialirt_swe.xml +258 -0
  48. imap_processing/ialirt/process_ephemeris.py +72 -40
  49. imap_processing/idex/decode.py +241 -0
  50. imap_processing/idex/idex_l1a.py +143 -81
  51. imap_processing/idex/idex_l1b.py +244 -10
  52. imap_processing/lo/l0/lo_science.py +61 -0
  53. imap_processing/lo/l1a/lo_l1a.py +98 -10
  54. imap_processing/lo/l1b/lo_l1b.py +2 -2
  55. imap_processing/lo/l1c/lo_l1c.py +2 -2
  56. imap_processing/lo/packet_definitions/lo_xtce.xml +1082 -9178
  57. imap_processing/mag/l0/decom_mag.py +2 -2
  58. imap_processing/mag/l1a/mag_l1a.py +7 -7
  59. imap_processing/mag/l1a/mag_l1a_data.py +62 -30
  60. imap_processing/mag/l1b/mag_l1b.py +11 -6
  61. imap_processing/quality_flags.py +18 -3
  62. imap_processing/spice/geometry.py +149 -177
  63. imap_processing/spice/kernels.py +26 -26
  64. imap_processing/spice/spin.py +233 -0
  65. imap_processing/spice/time.py +96 -31
  66. imap_processing/swapi/l1/swapi_l1.py +60 -31
  67. imap_processing/swapi/packet_definitions/swapi_packet_definition.xml +363 -384
  68. imap_processing/swe/l1a/swe_l1a.py +8 -3
  69. imap_processing/swe/l1a/swe_science.py +24 -24
  70. imap_processing/swe/l1b/swe_l1b.py +2 -1
  71. imap_processing/swe/l1b/swe_l1b_science.py +181 -122
  72. imap_processing/swe/l2/swe_l2.py +337 -70
  73. imap_processing/swe/utils/swe_utils.py +28 -0
  74. imap_processing/tests/cdf/test_utils.py +2 -2
  75. imap_processing/tests/codice/conftest.py +20 -17
  76. imap_processing/tests/codice/data/validation/imap_codice_l1a_hskp_20241110193622_v0.0.0.cdf +0 -0
  77. imap_processing/tests/codice/data/validation/imap_codice_l1a_lo-counters-aggregated_20241110193700_v0.0.0.cdf +0 -0
  78. imap_processing/tests/codice/data/validation/imap_codice_l1a_lo-counters-singles_20241110193700_v0.0.0.cdf +0 -0
  79. imap_processing/tests/codice/data/validation/imap_codice_l1a_lo-nsw-angular_20241110193700_v0.0.0.cdf +0 -0
  80. imap_processing/tests/codice/data/validation/imap_codice_l1a_lo-nsw-priority_20241110193700_v0.0.0.cdf +0 -0
  81. imap_processing/tests/codice/data/validation/imap_codice_l1a_lo-nsw-species_20241110193700_v0.0.0.cdf +0 -0
  82. imap_processing/tests/codice/data/validation/imap_codice_l1a_lo-sw-angular_20241110193700_v0.0.0.cdf +0 -0
  83. imap_processing/tests/codice/data/validation/imap_codice_l1a_lo-sw-priority_20241110193700_v0.0.0.cdf +0 -0
  84. imap_processing/tests/codice/data/validation/imap_codice_l1a_lo-sw-species_20241110193700_v0.0.0.cdf +0 -0
  85. imap_processing/tests/codice/test_codice_l0.py +55 -121
  86. imap_processing/tests/codice/test_codice_l1a.py +147 -59
  87. imap_processing/tests/conftest.py +81 -22
  88. imap_processing/tests/ena_maps/test_ena_maps.py +309 -0
  89. imap_processing/tests/ena_maps/test_map_utils.py +286 -0
  90. imap_processing/tests/ena_maps/test_spatial_utils.py +161 -0
  91. imap_processing/tests/glows/conftest.py +7 -1
  92. imap_processing/tests/glows/test_glows_l1a_cdf.py +3 -7
  93. imap_processing/tests/glows/test_glows_l1a_data.py +34 -6
  94. imap_processing/tests/glows/test_glows_l1b_data.py +29 -17
  95. imap_processing/tests/glows/test_glows_l2.py +101 -0
  96. imap_processing/tests/hi/conftest.py +3 -3
  97. imap_processing/tests/hi/data/l1/imap_hi_l1b_45sensor-de_20250415_v999.cdf +0 -0
  98. imap_processing/tests/hi/data/l1/imap_his_pset-calibration-prod-config_20240101_v001.csv +31 -0
  99. imap_processing/tests/hi/test_hi_l1b.py +14 -9
  100. imap_processing/tests/hi/test_hi_l1c.py +136 -36
  101. imap_processing/tests/hi/test_l1a.py +0 -2
  102. imap_processing/tests/hi/test_science_direct_event.py +18 -14
  103. imap_processing/tests/hi/test_utils.py +16 -11
  104. imap_processing/tests/hit/helpers/__init__.py +0 -0
  105. imap_processing/tests/hit/helpers/l1_validation.py +405 -0
  106. imap_processing/tests/hit/test_data/sci_sample.ccsds +0 -0
  107. imap_processing/tests/hit/test_decom_hit.py +8 -10
  108. imap_processing/tests/hit/test_hit_l1a.py +117 -180
  109. imap_processing/tests/hit/test_hit_l1b.py +149 -55
  110. imap_processing/tests/hit/validation_data/hit_l1b_standard_sample2_nsrl_v4_3decimals.csv +62 -0
  111. imap_processing/tests/hit/validation_data/sci_sample_raw.csv +62 -0
  112. imap_processing/tests/ialirt/test_data/l0/20240827095047_SWE_IALIRT_packet.bin +0 -0
  113. imap_processing/tests/ialirt/test_data/l0/BinLog CCSDS_FRAG_TLM_20240826_152323Z_IALIRT_data_for_SDC.bin +0 -0
  114. imap_processing/tests/ialirt/test_data/l0/eu_SWP_IAL_20240826_152033.csv +644 -0
  115. imap_processing/tests/ialirt/test_data/l0/hi_fsw_view_1_ccsds.bin +0 -0
  116. imap_processing/tests/ialirt/test_data/l0/idle_export_eu.SWE_IALIRT_20240827_093852.csv +914 -0
  117. imap_processing/tests/ialirt/test_data/l0/imap_codice_l1a_hi-ialirt_20240523200000_v0.0.0.cdf +0 -0
  118. imap_processing/tests/ialirt/unit/test_process_codicehi.py +106 -0
  119. imap_processing/tests/ialirt/unit/test_process_ephemeris.py +33 -5
  120. imap_processing/tests/ialirt/unit/test_process_swapi.py +85 -0
  121. imap_processing/tests/ialirt/unit/test_process_swe.py +106 -0
  122. imap_processing/tests/idex/conftest.py +29 -1
  123. imap_processing/tests/idex/test_data/compressed_2023_102_14_24_55.pkts +0 -0
  124. imap_processing/tests/idex/test_data/non_compressed_2023_102_14_22_26.pkts +0 -0
  125. imap_processing/tests/idex/test_idex_l0.py +6 -3
  126. imap_processing/tests/idex/test_idex_l1a.py +151 -1
  127. imap_processing/tests/idex/test_idex_l1b.py +124 -2
  128. imap_processing/tests/lo/test_lo_l1a.py +62 -2
  129. imap_processing/tests/lo/test_lo_science.py +85 -0
  130. imap_processing/tests/lo/validation_data/Instrument_FM1_T104_R129_20240803_ILO_SPIN_EU.csv +2 -0
  131. imap_processing/tests/mag/conftest.py +16 -0
  132. imap_processing/tests/mag/test_mag_decom.py +6 -4
  133. imap_processing/tests/mag/test_mag_l1a.py +36 -7
  134. imap_processing/tests/mag/test_mag_l1b.py +55 -4
  135. imap_processing/tests/mag/test_mag_validation.py +148 -0
  136. imap_processing/tests/mag/validation/L1a/T001/all_p_ones.txt +19200 -0
  137. imap_processing/tests/mag/validation/L1a/T001/mag-l0-l1a-t001-in.bin +0 -0
  138. imap_processing/tests/mag/validation/L1a/T001/mag-l0-l1a-t001-out.csv +17 -0
  139. imap_processing/tests/mag/validation/L1a/T002/all_n_ones.txt +19200 -0
  140. imap_processing/tests/mag/validation/L1a/T002/mag-l0-l1a-t002-in.bin +0 -0
  141. imap_processing/tests/mag/validation/L1a/T002/mag-l0-l1a-t002-out.csv +17 -0
  142. imap_processing/tests/mag/validation/L1a/T003/field_like.txt +19200 -0
  143. imap_processing/tests/mag/validation/L1a/T003/mag-l0-l1a-t003-in.bin +0 -0
  144. imap_processing/tests/mag/validation/L1a/T003/mag-l0-l1a-t003-out.csv +17 -0
  145. imap_processing/tests/mag/validation/L1a/T004/field_like.txt +19200 -0
  146. imap_processing/tests/mag/validation/L1a/T004/mag-l0-l1a-t004-in.bin +0 -0
  147. imap_processing/tests/mag/validation/L1a/T004/mag-l0-l1a-t004-out.csv +17 -0
  148. imap_processing/tests/mag/validation/L1a/T005/field_like_range_change.txt +19200 -0
  149. imap_processing/tests/mag/validation/L1a/T005/mag-l0-l1a-t005-in.bin +0 -0
  150. imap_processing/tests/mag/validation/L1a/T005/mag-l0-l1a-t005-out.csv +17 -0
  151. imap_processing/tests/mag/validation/L1a/T006/hdr_field.txt +19200 -0
  152. imap_processing/tests/mag/validation/L1a/T006/mag-l0-l1a-t006-in.bin +0 -0
  153. imap_processing/tests/mag/validation/L1a/T006/mag-l0-l1a-t006-out.csv +17 -0
  154. imap_processing/tests/mag/validation/L1a/T007/hdr_field_and_range_change.txt +19200 -0
  155. imap_processing/tests/mag/validation/L1a/T007/mag-l0-l1a-t007-in.bin +0 -0
  156. imap_processing/tests/mag/validation/L1a/T007/mag-l0-l1a-t007-out.csv +17 -0
  157. imap_processing/tests/mag/validation/L1a/T008/field_like_range_change.txt +19200 -0
  158. imap_processing/tests/mag/validation/L1a/T008/mag-l0-l1a-t008-in.bin +0 -0
  159. imap_processing/tests/mag/validation/L1a/T008/mag-l0-l1a-t008-out.csv +17 -0
  160. imap_processing/tests/mag/validation/L1b/T009/data.bin +0 -0
  161. imap_processing/tests/mag/validation/L1b/T009/field_like_all_ranges.txt +19200 -0
  162. imap_processing/tests/mag/validation/L1b/T009/mag-l1a-l1b-t009-in.csv +17 -0
  163. imap_processing/tests/mag/validation/L1b/T009/mag-l1a-l1b-t009-magi-out.csv +17 -0
  164. imap_processing/tests/mag/validation/L1b/T009/mag-l1a-l1b-t009-mago-out.csv +17 -0
  165. imap_processing/tests/mag/validation/L1b/T010/data.bin +0 -0
  166. imap_processing/tests/mag/validation/L1b/T010/field_like_all_ranges.txt +19200 -0
  167. imap_processing/tests/mag/validation/L1b/T010/mag-l1a-l1b-t010-in.csv +17 -0
  168. imap_processing/tests/mag/validation/L1b/T010/mag-l1a-l1b-t010-magi-out.csv +17 -0
  169. imap_processing/tests/mag/validation/L1b/T010/mag-l1a-l1b-t010-mago-out.csv +17 -0
  170. imap_processing/tests/mag/validation/L1b/T011/data.bin +0 -0
  171. imap_processing/tests/mag/validation/L1b/T011/field_like_all_ranges.txt +19200 -0
  172. imap_processing/tests/mag/validation/L1b/T011/mag-l1a-l1b-t011-in.csv +17 -0
  173. imap_processing/tests/mag/validation/L1b/T011/mag-l1a-l1b-t011-magi-out.csv +17 -0
  174. imap_processing/tests/mag/validation/L1b/T011/mag-l1a-l1b-t011-mago-out.csv +17 -0
  175. imap_processing/tests/spice/test_geometry.py +128 -133
  176. imap_processing/tests/spice/test_kernels.py +37 -37
  177. imap_processing/tests/spice/test_spin.py +184 -0
  178. imap_processing/tests/spice/test_time.py +43 -20
  179. imap_processing/tests/swapi/test_swapi_l1.py +11 -10
  180. imap_processing/tests/swapi/test_swapi_l2.py +13 -3
  181. imap_processing/tests/swe/test_swe_l1a.py +1 -1
  182. imap_processing/tests/swe/test_swe_l1b.py +20 -3
  183. imap_processing/tests/swe/test_swe_l1b_science.py +54 -35
  184. imap_processing/tests/swe/test_swe_l2.py +148 -5
  185. imap_processing/tests/test_cli.py +39 -7
  186. imap_processing/tests/test_quality_flags.py +19 -19
  187. imap_processing/tests/test_utils.py +3 -2
  188. imap_processing/tests/ultra/test_data/l0/ultra45_raw_sc_ultrarawimg_withFSWcalcs_FM45_40P_Phi28p5_BeamCal_LinearScan_phi2850_theta-000_20240207T102740.csv +3314 -3314
  189. imap_processing/tests/ultra/test_data/mock_data.py +161 -0
  190. imap_processing/tests/ultra/unit/conftest.py +73 -0
  191. imap_processing/tests/ultra/unit/test_badtimes.py +58 -0
  192. imap_processing/tests/ultra/unit/test_cullingmask.py +87 -0
  193. imap_processing/tests/ultra/unit/test_de.py +61 -60
  194. imap_processing/tests/ultra/unit/test_ultra_l1a.py +3 -3
  195. imap_processing/tests/ultra/unit/test_ultra_l1b.py +51 -77
  196. imap_processing/tests/ultra/unit/test_ultra_l1b_annotated.py +5 -5
  197. imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py +114 -0
  198. imap_processing/tests/ultra/unit/test_ultra_l1b_extended.py +86 -26
  199. imap_processing/tests/ultra/unit/test_ultra_l1c.py +1 -1
  200. imap_processing/tests/ultra/unit/test_ultra_l1c_pset_bins.py +3 -3
  201. imap_processing/ultra/constants.py +11 -1
  202. imap_processing/ultra/l1a/ultra_l1a.py +2 -2
  203. imap_processing/ultra/l1b/badtimes.py +22 -5
  204. imap_processing/ultra/l1b/cullingmask.py +31 -5
  205. imap_processing/ultra/l1b/de.py +32 -37
  206. imap_processing/ultra/l1b/extendedspin.py +44 -20
  207. imap_processing/ultra/l1b/ultra_l1b.py +21 -22
  208. imap_processing/ultra/l1b/ultra_l1b_culling.py +190 -0
  209. imap_processing/ultra/l1b/ultra_l1b_extended.py +81 -30
  210. imap_processing/ultra/l1c/histogram.py +6 -2
  211. imap_processing/ultra/l1c/pset.py +6 -2
  212. imap_processing/ultra/l1c/ultra_l1c.py +2 -3
  213. imap_processing/ultra/l1c/ultra_l1c_pset_bins.py +4 -3
  214. imap_processing/ultra/utils/ultra_l1_utils.py +70 -14
  215. imap_processing/utils.py +2 -2
  216. {imap_processing-0.9.0.dist-info → imap_processing-0.11.0.dist-info}/METADATA +7 -2
  217. {imap_processing-0.9.0.dist-info → imap_processing-0.11.0.dist-info}/RECORD +235 -152
  218. imap_processing/tests/codice/data/eu_unit_lookup_table.csv +0 -101
  219. imap_processing/tests/codice/data/idle_export_eu.COD_NHK_20230822_122700 2.csv +0 -100
  220. imap_processing/tests/codice/data/idle_export_raw.COD_NHK_20230822_122700.csv +0 -100
  221. imap_processing/tests/codice/data/imap_codice_l0_raw_20241110_v001.pkts +0 -0
  222. imap_processing/tests/hi/test_data/l1a/imap_hi_l1a_45sensor-de_20250415_v000.cdf +0 -0
  223. imap_processing/tests/hit/test_data/sci_sample1.ccsds +0 -0
  224. imap_processing/tests/ultra/unit/test_spatial_utils.py +0 -125
  225. imap_processing/ultra/utils/spatial_utils.py +0 -221
  226. /imap_processing/tests/hi/{test_data → data}/l0/20231030_H45_APP_NHK.bin +0 -0
  227. /imap_processing/tests/hi/{test_data → data}/l0/20231030_H45_APP_NHK.csv +0 -0
  228. /imap_processing/tests/hi/{test_data → data}/l0/20231030_H45_SCI_CNT.bin +0 -0
  229. /imap_processing/tests/hi/{test_data → data}/l0/20231030_H45_SCI_DE.bin +0 -0
  230. /imap_processing/tests/hi/{test_data → data}/l0/H90_NHK_20241104.bin +0 -0
  231. /imap_processing/tests/hi/{test_data → data}/l0/H90_sci_cnt_20241104.bin +0 -0
  232. /imap_processing/tests/hi/{test_data → data}/l0/H90_sci_de_20241104.bin +0 -0
  233. /imap_processing/tests/hi/{test_data → data}/l0/README.txt +0 -0
  234. /imap_processing/tests/idex/{imap_idex_l0_raw_20231214_v001.pkts → test_data/imap_idex_l0_raw_20231214_v001.pkts} +0 -0
  235. /imap_processing/tests/idex/{impact_14_tof_high_data.txt → test_data/impact_14_tof_high_data.txt} +0 -0
  236. /imap_processing/tests/mag/{imap_mag_l1a_norm-magi_20251017_v001.cdf → validation/imap_mag_l1a_norm-magi_20251017_v001.cdf} +0 -0
  237. /imap_processing/tests/mag/{mag_l0_test_data.pkts → validation/mag_l0_test_data.pkts} +0 -0
  238. /imap_processing/tests/mag/{mag_l0_test_output.csv → validation/mag_l0_test_output.csv} +0 -0
  239. /imap_processing/tests/mag/{mag_l1_test_data.pkts → validation/mag_l1_test_data.pkts} +0 -0
  240. /imap_processing/tests/mag/{mag_l1a_test_output.csv → validation/mag_l1a_test_output.csv} +0 -0
  241. {imap_processing-0.9.0.dist-info → imap_processing-0.11.0.dist-info}/LICENSE +0 -0
  242. {imap_processing-0.9.0.dist-info → imap_processing-0.11.0.dist-info}/WHEEL +0 -0
  243. {imap_processing-0.9.0.dist-info → imap_processing-0.11.0.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,238 @@
1
+ # <=== Coordinates ===>
2
+ esa_step:
3
+ CATDESC: Energy step id in lookup table
4
+ FIELDNAM: energy step
5
+ FILLVAL: -9223370000000000000
6
+ FORMAT: I2
7
+ LABLAXIS: Energy Step
8
+ SCALE_TYP: linear
9
+ UNITS: " "
10
+ VALIDMAX: 23
11
+ VALIDMIN: 0
12
+ VAR_TYPE: support_data
13
+
14
+ energy:
15
+ CATDESC: Energy of the particle in eV
16
+ FIELDNAM: Energy (eV)
17
+ FILLVAL: -9223370000000000000
18
+ FORMAT: E5.4
19
+ LABLAXIS: Energy
20
+ SCALE_TYP: linear
21
+ UNITS: eV
22
+ VALIDMAX: 2000.0
23
+ VALIDMIN: 0.0
24
+ VAR_TYPE: support_data
25
+
26
+ spin_sector:
27
+ CATDESC: Spin sector. 30 measurements nominally
28
+ FIELDNAM: Spin Sector
29
+ FILLVAL: -9223370000000000000
30
+ FORMAT: I2
31
+ LABLAXIS: Spin Sector
32
+ SCALE_TYP: linear
33
+ UNITS: " "
34
+ VALIDMAX: 29
35
+ VALIDMIN: 0
36
+ VAR_TYPE: support_data
37
+
38
+ inst_az:
39
+ CATDESC: Spin angle bins in instrument frame. Angle resolution is 12 degree nominally
40
+ FIELDNAM: spin angle
41
+ FILLVAL: -9223370000000000000
42
+ FORMAT: E5.4
43
+ LABLAXIS: Angle
44
+ SCALE_TYP: linear
45
+ UNITS: "Degree"
46
+ VALIDMAX: 359.999
47
+ VALIDMIN: 0.00
48
+ VAR_TYPE: support_data
49
+ VAR_NOTES: >
50
+ Bin CENTERS - Assuming 0.5 sec measurements and a spin starting
51
+ at Angle=0, these are the angles at the middle of each measurement
52
+ bin.
53
+
54
+ cem_id:
55
+ CATDESC: Data of each CEM detector
56
+ FIELDNAM: CEM data
57
+ FILLVAL: -9223370000000000000
58
+ FORMAT: E14.7
59
+ LABLAXIS: Rates
60
+ SCALE_TYP: linear
61
+ UNITS: " "
62
+ VALIDMAX: 0.000015514
63
+ VALIDMIN: 0.0
64
+ VAR_NOTES: " "
65
+ VAR_TYPE: support_data
66
+
67
+ inst_el:
68
+ CATDESC: Angle of each CEM detector
69
+ FIELDNAM: CEM Angle
70
+ FILLVAL: -9223370000000000000
71
+ FORMAT: I2
72
+ LABLAXIS: Angle
73
+ SCALE_TYP: linear
74
+ UNITS: Degree
75
+ VALIDMAX: 63
76
+ VALIDMIN: -63
77
+ VAR_TYPE: support_data
78
+
79
+ cycle:
80
+ CATDESC: Full cycle data takes 4 spins' data
81
+ FIELDNAM: quarter cycle
82
+ FILLVAL: -9223370000000000000
83
+ FORMAT: I2
84
+ LABLAXIS: Cycle
85
+ SCALE_TYP: linear
86
+ UNITS: " "
87
+ VALIDMAX: 3
88
+ VALIDMIN: 0
89
+ VAR_TYPE: support_data
90
+
91
+ # <=== Label Attributes ===>
92
+ # LABL_PTR_i expects VAR_TYPE of metadata with char data type
93
+ esa_step_label:
94
+ CATDESC: Energy step id in lookup table
95
+ FIELDNAM: Energy Step ID
96
+ FORMAT: A2
97
+ VAR_TYPE: metadata
98
+
99
+ spin_sector_label:
100
+ CATDESC: Spin sector. 30 measurements nominally
101
+ FIELDNAM: Measurement
102
+ FORMAT: A2
103
+ VAR_TYPE: metadata
104
+
105
+ cem_id_label:
106
+ CATDESC: Data rates of each CEM detector
107
+ FIELDNAM: CEM Rates
108
+ FORMAT: A1
109
+ VAR_TYPE: metadata
110
+
111
+ energy_label:
112
+ CATDESC: Energy of the particle in eV
113
+ FIELDNAM: Energy
114
+ FORMAT: A5
115
+ VAR_TYPE: metadata
116
+
117
+ inst_az_label:
118
+ CATDESC: Spin angle bins in instrument frame. Angle resolution is 12 degree nominally
119
+ FIELDNAM: Spin Angle
120
+ FORMAT: A3
121
+ VAR_TYPE: metadata
122
+
123
+ inst_el_label:
124
+ CATDESC: Angle of each CEM detector
125
+ FIELDNAM: CEM Angle
126
+ FORMAT: A3
127
+ VAR_TYPE: metadata
128
+
129
+ # <=== Data Variables ===>
130
+
131
+ inst_az_spin_sector:
132
+ CATDESC: Spin angle organized by voltage step and spin sector
133
+ DEPEND_0: epoch
134
+ DEPEND_1: esa_step
135
+ DEPEND_2: spin_sector
136
+ LABL_PTR_1: esa_step_label
137
+ LABL_PTR_2: spin_sector_label
138
+ DISPLAY_TYPE: spectrogram
139
+ FIELDNAM: Spin Angle
140
+ FILLVAL: -1.0000000E+31
141
+ FORMAT: E4.5
142
+ UNITS: Degree
143
+ VALIDMAX: 359.99
144
+ VALIDMIN: 0.0
145
+ VAR_TYPE: data
146
+
147
+ phase_space_density_spin_sector:
148
+ CATDESC: Phase space density organized by voltage step and spin sector and CEM
149
+ DEPEND_0: epoch
150
+ DEPEND_1: esa_step
151
+ DEPEND_2: spin_sector
152
+ DEPEND_3: cem_id
153
+ LABL_PTR_1: esa_step_label
154
+ LABL_PTR_2: spin_sector_label
155
+ LABL_PTR_3: cem_id_label
156
+ DISPLAY_TYPE: spectrogram
157
+ FIELDNAM: Phase Space Density
158
+ FILLVAL: -1.0000000E+31
159
+ UNITS: s^3 / (cm^6 * ster)
160
+ FORMAT: E14.7
161
+ VALIDMAX: 0.000015514
162
+ VALIDMIN: 0
163
+ VAR_TYPE: data
164
+
165
+ phase_space_density:
166
+ CATDESC: Phase space density organized by energy (eV), spin angle, CEM angle
167
+ DEPEND_0: epoch
168
+ DEPEND_1: energy
169
+ DEPEND_2: inst_az
170
+ DEPEND_3: inst_el
171
+ LABL_PTR_1: energy_label
172
+ LABL_PTR_2: inst_az_label
173
+ LABL_PTR_3: inst_el_label
174
+ DISPLAY_TYPE: spectrogram
175
+ FIELDNAM: Phase Space Density
176
+ FILLVAL: -1.0000000E+31
177
+ UNITS: s^3 / (cm^6 * ster)
178
+ FORMAT: E14.7
179
+ VALIDMAX: 0.000015514
180
+ VALIDMIN: 0
181
+ VAR_TYPE: data
182
+
183
+ flux_spin_sector:
184
+ CATDESC: Flux organized by voltage step and spin sector and CEM
185
+ DEPEND_0: epoch
186
+ DEPEND_1: esa_step
187
+ DEPEND_2: spin_sector
188
+ DEPEND_3: cem_id
189
+ LABL_PTR_1: esa_step_label
190
+ LABL_PTR_2: spin_sector_label
191
+ LABL_PTR_3: cem_id_label
192
+ DISPLAY_TYPE: spectrogram
193
+ FIELDNAM: Flux
194
+ FILLVAL: -1.0000000E+31
195
+ UNITS: 1 / (2 * eV * cm^2 * s * ster)
196
+ FORMAT: E14.7
197
+ VALIDMAX: 0.000015514
198
+ VALIDMIN: 0
199
+ VAR_TYPE: data
200
+
201
+ flux:
202
+ CATDESC: Flux organized by energy (eV), spin angle, CEM angle
203
+ DEPEND_0: epoch
204
+ DEPEND_1: energy
205
+ DEPEND_2: inst_az
206
+ DEPEND_3: inst_el
207
+ LABL_PTR_1: energy_label
208
+ LABL_PTR_2: inst_az_label
209
+ LABL_PTR_3: inst_el_label
210
+ DISPLAY_TYPE: spectrogram
211
+ FIELDNAM: Flux
212
+ FILLVAL: -1.0000000E+31
213
+ UNITS: 1 / (2 * eV * cm^2 * s * ster)
214
+ FORMAT: E14.7
215
+ VALIDMAX: 0.000015514
216
+ VALIDMIN: 0
217
+ VAR_TYPE: data
218
+
219
+ acquisition_time:
220
+ CATDESC: Acquisition time organized by voltage step and spin sector
221
+ DEPEND_0: epoch
222
+ DEPEND_1: esa_step
223
+ DEPEND_2: spin_sector
224
+ LABL_PTR_1: esa_step_label
225
+ LABL_PTR_2: spin_sector_label
226
+ DISPLAY_TYPE: spectrogram
227
+ FIELDNAM: Acquisition time by volt step and spin sector
228
+ FILLVAL: -1.0000000E+31
229
+ FORMAT: I20
230
+ VALIDMAX: 9223372036854775807
231
+ VALIDMIN: 0
232
+ UNITS: sec
233
+ VAR_TYPE: support_data
234
+ VAR_NOTES: >
235
+ This stores the acquisition times of each measurement. This time is
236
+ calculated by combining ACQ_START_COARSE, ACQ_START_FINE,
237
+ acquisition duration and settle duration. It is time of each energy
238
+ step and each science measurement.
@@ -9,6 +9,13 @@ default_attrs: &default
9
9
  VAR_TYPE: data
10
10
  UNITS: " "
11
11
 
12
+ component:
13
+ CATDESC: Velocity components (vx, vy, vz)
14
+ FIELDNAM: component
15
+ LABLAXIS: component
16
+ FORMAT: A3
17
+ VAR_TYPE: metadata
18
+
12
19
  default_uint8_attrs: &default_uint8
13
20
  <<: *default
14
21
  FILLVAL: 255
@@ -92,6 +99,13 @@ x_coin:
92
99
  LABLAXIS: x coincidence position
93
100
  UNITS: mm / 100
94
101
 
102
+ event_times:
103
+ <<: *default_float32
104
+ CATDESC: time of event as calculated using aux and de l1a packets
105
+ FIELDNAM: event_times
106
+ LABLAXIS: event times
107
+ UNITS: seconds
108
+
95
109
  tof_start_stop:
96
110
  <<: *default_float32
97
111
  CATDESC: Particle time of flight from start to stop
@@ -134,26 +148,20 @@ start_type:
134
148
  LABLAXIS: start type
135
149
  UNITS: " "
136
150
 
137
- vx_ultra:
151
+ direct_event_velocity:
138
152
  <<: *default_float32
139
- CATDESC: Normalized component of the velocity vector in x direction in the instrument frame.
140
- FIELDNAM: vx_ultra
141
- LABLAXIS: vx ultra
142
- UNITS: " "
153
+ CATDESC: Direct event velocity vector in x, y, and z directions in the instrument frame.
154
+ DEPEND_1: component
155
+ FIELDNAM: v_ultra
156
+ LABLAXIS: v ultra
157
+ UNITS: "km/s"
143
158
 
144
- vy_ultra:
159
+ velocity_magnitude:
145
160
  <<: *default_float32
146
- CATDESC: Normalized component of the velocity vector in y direction in the instrument frame.
147
- FIELDNAM: vy_ultra
148
- LABLAXIS: vy ultra
149
- UNITS: " "
150
-
151
- vz_ultra:
152
- <<: *default_float32
153
- CATDESC: Normalized component of the velocity vector in z direction in the instrument frame.
154
- FIELDNAM: vz_ultra
155
- LABLAXIS: vz ultra
156
- UNITS: " "
161
+ CATDESC: Magnitude of the particle velocity.
162
+ FIELDNAM: vmag_ultra
163
+ LABLAXIS: vmag ultra
164
+ UNITS: "km/s"
157
165
 
158
166
  energy:
159
167
  <<: *default_float32
@@ -162,6 +170,13 @@ energy:
162
170
  LABLAXIS: energy
163
171
  UNITS: keV
164
172
 
173
+ tof_energy:
174
+ <<: *default_float32
175
+ CATDESC: Energy measured using kinetic energy equation.
176
+ FIELDNAM: energy
177
+ LABLAXIS: energy
178
+ UNITS: keV
179
+
165
180
  species:
166
181
  <<: *default
167
182
  DISPLAY_TYPE: no_plot
@@ -186,74 +201,49 @@ path_length:
186
201
  LABLAXIS: path_length
187
202
  UNITS: mm / 100
188
203
 
189
- event_efficiency:
190
- <<: *default_float32
191
- CATDESC: Estimated event efficiency for this path through the instrument.
192
- FIELDNAM: event_efficiency
193
- LABLAXIS: event efficiency
194
- UNITS: " "
195
-
196
- vx_sc:
197
- <<: *default_float32
198
- CATDESC: x-component of the velocity vector of the ena in the spacecraft frame.
199
- FIELDNAM: vx_sc
200
- LABLAXIS: vx sc
201
- UNITS: " "
202
-
203
- vy_sc:
204
- <<: *default_float32
205
- CATDESC: y-component of the velocity vector of the ena in the spacecraft frame.
206
- FIELDNAM: vy_sc
207
- LABLAXIS: vy sc
208
- UNITS: " "
209
-
210
- vz_sc:
204
+ azimuth:
211
205
  <<: *default_float32
212
- CATDESC: z-component of the velocity vector of the ena in the spacecraft frame.
213
- FIELDNAM: vz_sc
214
- LABLAXIS: vz sc
215
- UNITS: " "
206
+ CATDESC: Azimuth.
207
+ FIELDNAM: azimuth
208
+ LABLAXIS: azimuth
209
+ UNITS: radians
216
210
 
217
- vx_dps_sc:
211
+ elevation:
218
212
  <<: *default_float32
219
- CATDESC: x-component of the velocity vector of the ena in the DPS frame at rest WRT spacecraft.
220
- FIELDNAM: vx_dps_sc
221
- LABLAXIS: vx dps sc
222
- UNITS: " "
213
+ CATDESC: Elevation.
214
+ FIELDNAM: elevation
215
+ LABLAXIS: elevation
216
+ UNITS: radians
223
217
 
224
- vy_dps_sc:
225
- <<: *default_float32
226
- CATDESC: y-component of the velocity vector of the ena in the DPS frame at rest WRT spacecraft.
227
- FIELDNAM: vy_dps_sc
228
- LABLAXIS: vy dps sc
229
- UNITS: " "
230
-
231
- vz_dps_sc:
218
+ event_efficiency:
232
219
  <<: *default_float32
233
- CATDESC: z-component of the velocity vector of the ena in the DPS frame at rest WRT spacecraft.
234
- FIELDNAM: vz_dps_sc
235
- LABLAXIS: vz dps sc
220
+ CATDESC: Estimated event efficiency for this path through the instrument.
221
+ FIELDNAM: event_efficiency
222
+ LABLAXIS: event efficiency
236
223
  UNITS: " "
237
224
 
238
- vx_dps_helio:
225
+ velocity_sc:
239
226
  <<: *default_float32
240
- CATDESC: x-component of the velocity vector of the ena in the DPS frame at rest WRT heliosphere.
241
- FIELDNAM: vx_dps_helio
242
- LABLAXIS: vx dps helio
227
+ CATDESC: x,y,z-components of the velocity vector of the ena in the spacecraft frame.
228
+ DEPEND_1: component
229
+ FIELDNAM: v_sc
230
+ LABLAXIS: v sc
243
231
  UNITS: " "
244
232
 
245
- vy_dps_helio:
233
+ velocity_dps_sc:
246
234
  <<: *default_float32
247
- CATDESC: y-component of the velocity vector of the ena in the DPS frame at rest WRT heliosphere.
248
- FIELDNAM: vy_dps_helio
249
- LABLAXIS: vy dps helio
235
+ CATDESC: x,y,z-components of the velocity vector of the ena in the DPS frame at rest WRT spacecraft.
236
+ DEPEND_1: component
237
+ FIELDNAM: v_dps_sc
238
+ LABLAXIS: v dps sc
250
239
  UNITS: " "
251
240
 
252
- vz_dps_helio:
241
+ velocity_dps_helio:
253
242
  <<: *default_float32
254
- CATDESC: z-component of the velocity vector of the ena in the DPS frame at rest WRT heliosphere.
255
- FIELDNAM: vz_dps_helio
256
- LABLAXIS: vz dps helio
243
+ CATDESC: x,y,z-components of the velocity vector of the ena in the DPS frame at rest WRT heliosphere.
244
+ DEPEND_1: component
245
+ FIELDNAM: v_dps_helio
246
+ LABLAXIS: v dps helio
257
247
  UNITS: " "
258
248
 
259
249
  de_event_met:
@@ -266,14 +256,6 @@ de_event_met:
266
256
  VAR_TYPE: support_data
267
257
  SCALE_TYP: linear
268
258
 
269
- spin_number:
270
- <<: *default
271
- CATDESC: Spin number from Universal Spin Table.
272
- FIELDNAM: spin_number
273
- LABLAXIS: spin_number
274
- # TODO: come back to format
275
- UNITS: " "
276
-
277
259
  spin_start_time:
278
260
  <<: *default
279
261
  CATDESC: Spin start time from Universal Spin Table.
@@ -282,14 +264,20 @@ spin_start_time:
282
264
  # TODO: come back to format
283
265
  UNITS: s
284
266
 
285
- avg_spin_period:
267
+ spin_period:
286
268
  <<: *default
287
- CATDESC: Average spin period from Universal Spin Table.
288
- FIELDNAM: avg_spin_period
289
- LABLAXIS: avg_spin_period
290
- # TODO: come back to format
269
+ CATDESC: Spin period from Universal Spin Table.
270
+ FIELDNAM: spin_period
271
+ LABLAXIS: spin_period
291
272
  UNITS: s
292
273
 
274
+ spin_rate:
275
+ <<: *default
276
+ CATDESC: Spin rate from Universal Spin Table.
277
+ FIELDNAM: spin_rate
278
+ LABLAXIS: spin_rate
279
+ UNITS: rpm
280
+
293
281
  rate_start_pulses:
294
282
  <<: *default
295
283
  CATDESC: Rate of start pulses (/s).
@@ -330,16 +318,36 @@ rate_rejected_events:
330
318
  # TODO: come back to format
331
319
  UNITS: 1/s
332
320
 
333
- quality_hk:
334
- <<: *default
335
- CATDESC: Spin filter derived from Ultra housekeeping. Bitwise flagging used to filter the spin.
336
- FIELDNAM: quality_hk
337
- LABLAXIS: quality hk
338
- # TODO: come back to format
321
+ # Extendedspin attributes
322
+ ena_rates:
323
+ <<: *default_float32
324
+ CATDESC: Rates calculated from de packet.
325
+ FIELDNAM: ena_rates
326
+ LABLAXIS: ena_rates
327
+ DEPEND_0: spin_number
328
+ DEPEND_1: energy_bin_geometric_mean
329
+ UNITS: " "
330
+
331
+ ena_rates_threshold:
332
+ <<: *default_float32
333
+ CATDESC: Rates threshold used for flagging data.
334
+ FIELDNAM: ena_rates_threshold
335
+ LABLAXIS: ena_rates_threshold
336
+ DEPEND_0: spin_number
337
+ DEPEND_1: energy_bin_geometric_mean
338
+ UNITS: " "
339
+
340
+ quality_ena_rates:
341
+ <<: *default_uint16
342
+ CATDESC: Spin filter derived from Ultra ena rates. Bitwise flagging used to filter the spin.
343
+ FIELDNAM: quality_ena_rates
344
+ LABLAXIS: quality_ena_rates
345
+ DEPEND_0: spin_number
346
+ DEPEND_1: energy_bin_geometric_mean
339
347
  UNITS: " "
340
348
 
341
349
  quality_attitude:
342
- <<: *default
350
+ <<: *default_uint16
343
351
  CATDESC: Spin filter derived from IMAP attitude. Bitwise flagging used to filter the spin.
344
352
  FIELDNAM: quality_attitude
345
353
  LABLAXIS: quality attitude
@@ -347,7 +355,7 @@ quality_attitude:
347
355
  UNITS: " "
348
356
 
349
357
  quality_instruments:
350
- <<: *default
358
+ <<: *default_uint16
351
359
  CATDESC: Spin filter derived from instruments other than Ultra. Bitwise flagging used to filter the spin.
352
360
  FIELDNAM: quality_instruments
353
361
  LABLAXIS: quality instruments
@@ -13,7 +13,7 @@ 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
+ from imap_processing.spice.time import TTJ2000_EPOCH
17
17
 
18
18
  logger = logging.getLogger(__name__)
19
19
 
@@ -94,7 +94,7 @@ def write_cdf(
94
94
  # Convert J2000 epoch referenced data to datetime64
95
95
  # TODO: This implementation of epoch to time string results in an error of
96
96
  # 5 seconds due to 5 leap-second occurrences since the J2000 epoch.
97
- dt64 = J2000_EPOCH + dataset["epoch"].values[0].astype("timedelta64[ns]")
97
+ dt64 = TTJ2000_EPOCH + dataset["epoch"].values[0].astype("timedelta64[ns]")
98
98
  start_time = np.datetime_as_string(dt64, unit="D").replace("-", "")
99
99
 
100
100
  # Will now accept vXXX or XXX formats, as batch starter sends versions as vXXX.
imap_processing/cli.py CHANGED
@@ -38,6 +38,7 @@ from imap_processing.cdf.utils import load_cdf, write_cdf
38
38
  from imap_processing.codice import codice_l1a, codice_l1b
39
39
  from imap_processing.glows.l1a.glows_l1a import glows_l1a
40
40
  from imap_processing.glows.l1b.glows_l1b import glows_l1b
41
+ from imap_processing.glows.l2.glows_l2 import glows_l2
41
42
  from imap_processing.hi.l1a import hi_l1a
42
43
  from imap_processing.hi.l1b import hi_l1b
43
44
  from imap_processing.hi.l1c import hi_l1c
@@ -226,6 +227,8 @@ class ProcessInstrument(ABC):
226
227
  ----------
227
228
  data_level : str
228
229
  The data level to process (e.g. ``l1a``).
230
+ data_descriptor : str
231
+ The descriptor of the data to process (e.g. ``sci``).
229
232
  dependency_str : str
230
233
  A string representation of the dependencies for the instrument in the
231
234
  format: "[{
@@ -248,6 +251,7 @@ class ProcessInstrument(ABC):
248
251
  def __init__(
249
252
  self,
250
253
  data_level: str,
254
+ data_descriptor: str,
251
255
  dependency_str: str,
252
256
  start_date: str,
253
257
  end_date: str,
@@ -255,6 +259,7 @@ class ProcessInstrument(ABC):
255
259
  upload_to_sdc: bool,
256
260
  ) -> None:
257
261
  self.data_level = data_level
262
+ self.descriptor = data_descriptor
258
263
 
259
264
  # Convert string into a dictionary
260
265
  self.dependencies = loads(dependency_str.replace("'", '"'))
@@ -283,8 +288,8 @@ class ProcessInstrument(ABC):
283
288
  # TODO: Validate dep dict
284
289
  # TODO: determine what dependency information is optional
285
290
  return_query = imap_data_access.query(
286
- start_date=self.start_date,
287
- end_date=self.end_date,
291
+ start_date=dependency["start_date"],
292
+ end_date=dependency.get("end_date", None),
288
293
  instrument=dependency["instrument"],
289
294
  data_level=dependency["data_level"],
290
295
  version=dependency["version"],
@@ -395,7 +400,13 @@ class ProcessInstrument(ABC):
395
400
  datasets : list[xarray.Dataset]
396
401
  A list of datasets (products) produced by do_processing method.
397
402
  """
403
+ if len(datasets) == 0:
404
+ logger.info("No products to write to CDF file.")
405
+ return
406
+
398
407
  logger.info("Writing products to local storage")
408
+ logger.info("Parent files: %s", self._dependency_list)
409
+
399
410
  products = [
400
411
  write_cdf(dataset, parent_files=self._dependency_list)
401
412
  for dataset in datasets
@@ -482,6 +493,15 @@ class Glows(ProcessInstrument):
482
493
  input_dataset = load_cdf(dependencies[0])
483
494
  datasets = [glows_l1b(input_dataset, self.version)]
484
495
 
496
+ if self.data_level == "l2":
497
+ if len(dependencies) > 1:
498
+ raise ValueError(
499
+ f"Unexpected dependencies found for GLOWS L2:"
500
+ f"{dependencies}. Expected only one input dependency."
501
+ )
502
+ input_dataset = load_cdf(dependencies[0])
503
+ datasets = glows_l2(input_dataset, self.version)
504
+
485
505
  return datasets
486
506
 
487
507
 
@@ -517,7 +537,14 @@ class Hi(ProcessInstrument):
517
537
  dependencies = [load_cdf(dependency) for dependency in dependencies]
518
538
  datasets = [hi_l1b.hi_l1b(dependencies[0], self.version)]
519
539
  elif self.data_level == "l1c":
520
- dependencies = [load_cdf(dependency) for dependency in dependencies]
540
+ # TODO: Add PSET calibration product config file dependency and remove
541
+ # below injected dependency
542
+ dependencies.append(
543
+ Path(__file__).parent
544
+ / "tests/hi/test_data/l1"
545
+ / "imap_his_pset-calibration-prod-config_20240101_v001.csv"
546
+ )
547
+ dependencies[0] = load_cdf(dependencies[0])
521
548
  datasets = [hi_l1c.hi_l1c(dependencies, self.version)]
522
549
  else:
523
550
  raise NotImplementedError(
@@ -734,13 +761,20 @@ class Swapi(ProcessInstrument):
734
761
  datasets: list[xr.Dataset] = []
735
762
 
736
763
  if self.data_level == "l1":
737
- if len(dependencies) > 1:
764
+ # For science, we expect l0 raw file and L1 housekeeping file
765
+ if self.descriptor == "sci" and len(dependencies) != 2:
738
766
  raise ValueError(
739
- f"Unexpected dependencies found for SWAPI L1:"
767
+ f"Unexpected dependencies found for SWAPI L1 science:"
768
+ f"{dependencies}. Expected only two dependencies."
769
+ )
770
+ # For housekeeping, we expect only L0 raw file
771
+ if self.descriptor == "hk" and len(dependencies) != 1:
772
+ raise ValueError(
773
+ f"Unexpected dependencies found for SWAPI L1 housekeeping:"
740
774
  f"{dependencies}. Expected only one dependency."
741
775
  )
742
- # process data
743
- datasets = [swapi_l1(dependencies[0], self.version)]
776
+ # process science or housekeeping data
777
+ datasets = swapi_l1(dependencies, self.version)
744
778
  elif self.data_level == "l2":
745
779
  if len(dependencies) > 1:
746
780
  raise ValueError(
@@ -780,7 +814,7 @@ class Swe(ProcessInstrument):
780
814
  f"Unexpected dependencies found for SWE L1A:"
781
815
  f"{dependencies}. Expected only one dependency."
782
816
  )
783
- datasets = [swe_l1a(str(dependencies[0]), data_version=self.version)]
817
+ datasets = swe_l1a(str(dependencies[0]), data_version=self.version)
784
818
  # Right now, we only process science data. Therefore,
785
819
  # we expect only one dataset to be returned.
786
820
 
@@ -792,7 +826,8 @@ class Swe(ProcessInstrument):
792
826
  )
793
827
  # read CDF file
794
828
  l1a_dataset = load_cdf(dependencies[0])
795
- datasets = [swe_l1b(l1a_dataset, data_version=self.version)]
829
+ # TODO: read lookup table and in-flight calibration data here.
830
+ datasets = swe_l1b(l1a_dataset, data_version=self.version)
796
831
  else:
797
832
  print("Did not recognize data level. No processing done.")
798
833
 
@@ -861,6 +896,7 @@ def main() -> None:
861
896
  cls = getattr(sys.modules[__name__], args.instrument.capitalize())
862
897
  instrument = cls(
863
898
  args.data_level,
899
+ args.descriptor,
864
900
  args.dependency,
865
901
  args.start_date,
866
902
  args.end_date,