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
@@ -27,6 +27,7 @@ from imap_processing.codice import constants
27
27
  from imap_processing.codice.codice_l0 import decom_packets
28
28
  from imap_processing.codice.decompress import decompress
29
29
  from imap_processing.codice.utils import CODICEAPID
30
+ from imap_processing.spice.time import met_to_ttj2000ns
30
31
 
31
32
  logger = logging.getLogger(__name__)
32
33
  logger.setLevel(logging.INFO)
@@ -57,6 +58,8 @@ class CoDICEL1aPipeline:
57
58
 
58
59
  Methods
59
60
  -------
61
+ calculate_epoch_values()
62
+ Calculate and return the values to be used for `epoch`.
60
63
  decompress_data(science_values)
61
64
  Perform decompression on the data.
62
65
  define_coordinates()
@@ -84,6 +87,26 @@ class CoDICEL1aPipeline:
84
87
  self.plan_step = plan_step
85
88
  self.view_id = view_id
86
89
 
90
+ def calculate_epoch_values(self) -> NDArray[int]:
91
+ """
92
+ Calculate and return the values to be used for `epoch`.
93
+
94
+ On CoDICE, the epoch values are derived from the `acq_start_seconds` and
95
+ `acq_start_subseconds` fields in the packet. Note that the
96
+ `acq_start_subseconds` field needs to be converted from microseconds to
97
+ seconds
98
+
99
+ Returns
100
+ -------
101
+ epoch : NDArray[int]
102
+ List of epoch values.
103
+ """
104
+ epoch = met_to_ttj2000ns(
105
+ self.dataset.acq_start_seconds + self.dataset.acq_start_subseconds / 1e6
106
+ )
107
+
108
+ return epoch
109
+
87
110
  def decompress_data(self, science_values: list[str]) -> None:
88
111
  """
89
112
  Perform decompression on the data.
@@ -126,17 +149,34 @@ class CoDICEL1aPipeline:
126
149
  """
127
150
  self.coords = {}
128
151
 
129
- for name in self.config["coords"]:
152
+ coord_names = ["epoch", *list(self.config["dims"].keys())]
153
+
154
+ # These are labels unique to lo-counters products coordinates
155
+ if self.config["dataset_name"] in [
156
+ "imap_codice_l1a_lo-counters-aggregated",
157
+ "imap_codice_l1a_lo-counters-singles",
158
+ ]:
159
+ coord_names.append("spin_sector_pairs_label")
160
+
161
+ for name in coord_names:
130
162
  if name == "epoch":
131
- values = self.dataset.epoch.data
132
- elif name == "esa_step":
133
- values = np.arange(self.config["num_energy_steps"])
134
- elif name == "inst_az":
135
- values = np.arange(self.config["num_positions"])
136
- elif name == "spin_sector":
137
- values = np.arange(self.config["num_spin_sectors"])
163
+ values = self.calculate_epoch_values()
164
+ elif name in ["esa_step", "inst_az", "spin_sector", "spin_sector_pairs"]:
165
+ values = np.arange(self.config["dims"][name])
166
+ elif name == "spin_sector_pairs_label":
167
+ values = np.array(
168
+ [
169
+ "0-30 deg",
170
+ "30-60 deg",
171
+ "60-90 deg",
172
+ "90-120 deg",
173
+ "120-150 deg",
174
+ "150-180 deg",
175
+ ]
176
+ )
138
177
  else:
139
- # TODO: Need to implement other types of coords
178
+ # TODO: May need to implement other types of coords for Hi
179
+ # and/or event data products
140
180
  continue
141
181
 
142
182
  coord = xr.DataArray(
@@ -170,26 +210,31 @@ class CoDICEL1aPipeline:
170
210
  # Stack the data so that it is easier to reshape and iterate over
171
211
  all_data = np.stack(self.data)
172
212
 
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
- # depending on the data product). In any case, iterate over the
176
- # num_counters dimension to isolate the data for each counter so
177
- # that it can be placed in a CDF data variable.
213
+ # The dimension of all_data is something like (epoch, num_counters,
214
+ # num_energy_steps, num_positions, num_spin_sectors) (or may be slightly
215
+ # different depending on the data product). In any case, iterate over
216
+ # the num_counters dimension to isolate the data for each counter so
217
+ # each counter's data can be placed in a separate CDF data variable.
178
218
  for counter, variable_name in zip(
179
219
  range(all_data.shape[1]), self.config["variable_names"]
180
220
  ):
181
- counter_data = all_data[:, counter, :, :, :]
221
+ # Extract the counter data
222
+ counter_data = all_data[:, counter, ...]
182
223
 
183
224
  # Get the CDF attributes
184
225
  descriptor = self.config["dataset_name"].split("imap_codice_l1a_")[-1]
185
226
  cdf_attrs_key = f"{descriptor}-{variable_name}"
186
227
  attrs = self.cdf_attrs.get_variable_attributes(cdf_attrs_key)
187
228
 
229
+ # The final CDF dimensions always has "epoch" as the first dimension,
230
+ # followed by the dimensions for the specific data product
231
+ dims = ["epoch", *list(self.config["dims"].keys())]
232
+
188
233
  # Create the CDF data variable
189
234
  dataset[variable_name] = xr.DataArray(
190
235
  counter_data,
191
236
  name=variable_name,
192
- dims=self.config["dims"],
237
+ dims=dims,
193
238
  attrs=attrs,
194
239
  )
195
240
 
@@ -216,11 +261,20 @@ class CoDICEL1aPipeline:
216
261
  dataset : xarray.Dataset
217
262
  ``xarray`` dataset for the data product, with added support variables.
218
263
  """
264
+ # These variables can be gathered from the packet data
265
+ packet_data_variables = [
266
+ "rgfo_half_spin",
267
+ "nso_half_spin",
268
+ "sw_bias_gain_mode",
269
+ "st_bias_gain_mode",
270
+ ]
271
+
219
272
  for variable_name in self.config["support_variables"]:
273
+ # These variables require reading in external tables
220
274
  if variable_name == "energy_table":
221
275
  variable_data = self.get_energy_table()
222
276
  dims = ["esa_step"]
223
- attrs = self.cdf_attrs.get_variable_attributes("esa_step")
277
+ attrs = self.cdf_attrs.get_variable_attributes("energy_table")
224
278
 
225
279
  elif variable_name == "acquisition_time_per_step":
226
280
  variable_data = self.get_acquisition_times()
@@ -229,10 +283,24 @@ class CoDICEL1aPipeline:
229
283
  "acquisition_time_per_step"
230
284
  )
231
285
 
232
- else:
233
- # TODO: Need to implement methods to gather and set other
234
- # support attributes
235
- continue
286
+ elif variable_name in packet_data_variables:
287
+ variable_data = self.dataset[variable_name].data
288
+ dims = ["epoch"]
289
+ attrs = self.cdf_attrs.get_variable_attributes(variable_name)
290
+
291
+ # Data quality is named differently in packet data and needs to be
292
+ # treated slightly differently
293
+ elif variable_name == "data_quality":
294
+ variable_data = self.dataset.suspect.data
295
+ dims = ["epoch"]
296
+ attrs = self.cdf_attrs.get_variable_attributes("data_quality")
297
+
298
+ # Spin period requires the application of a conversion factor
299
+ # See Table B.5 in the algorithm document
300
+ elif variable_name == "spin_period":
301
+ variable_data = self.dataset.spin_period.data * 0.00032
302
+ dims = ["epoch"]
303
+ attrs = self.cdf_attrs.get_variable_attributes("spin_period")
236
304
 
237
305
  # Add variable to the dataset
238
306
  dataset[variable_name] = xr.DataArray(
@@ -341,45 +409,23 @@ class CoDICEL1aPipeline:
341
409
  3D arrays representing dimensions such as spin sectors, positions, and
342
410
  energies (depending on the data product).
343
411
  """
412
+ # This will contain the reshaped data for all counters
344
413
  self.data = []
345
414
 
346
- # For CoDICE-lo, data are a 3D arrays with a shape representing
347
- # [<num_positions>,<num_spin_sectors>,<num_energy_steps>]
348
- if self.config["instrument"] == "lo":
349
- for packet_data in self.raw_data:
350
- if packet_data:
351
- reshaped_packet_data = np.array(
352
- packet_data, dtype=np.uint32
353
- ).reshape(
354
- (
355
- self.config["num_counters"],
356
- self.config["num_energy_steps"],
357
- self.config["num_positions"],
358
- self.config["num_spin_sectors"],
359
- )
360
- )
361
- self.data.append(reshaped_packet_data)
362
- else:
363
- self.data.append(None)
364
-
365
- # For CoDICE-hi, data are a 3D array with a shape representing
366
- # [<num_energy_steps>,<num_positions>,<num_spin_sectors>]
367
- elif self.config["instrument"] == "hi":
368
- for packet_data in self.raw_data:
369
- if packet_data:
370
- reshaped_packet_data = np.array(
371
- packet_data, dtype=np.uint32
372
- ).reshape(
373
- (
374
- self.config["num_counters"],
375
- self.config["num_energy_steps"],
376
- self.config["num_positions"],
377
- self.config["num_spin_sectors"],
378
- )
379
- )
380
- self.data.append(reshaped_packet_data)
381
- else:
382
- self.data.append(None)
415
+ # Typically, data are a 4D arrays with a shape representing some
416
+ # combination of <num_counters>, <num_positions>, <num_spin_sectors>,
417
+ # and <num_energy_steps>. However, the existence and order of these
418
+ # dimensions can vary depending on the specific data product, so we
419
+ # define this in the "dims" value configuration dictionary. The number
420
+ # of counters is the first dimension/axis.
421
+ reshape_dims = (self.config["num_counters"], *self.config["dims"].values())
422
+
423
+ # For each packet/epoch, reshape the data along these dimensions
424
+ for packet_data in self.raw_data:
425
+ reshaped_packet_data = np.array(packet_data, dtype=np.uint32).reshape(
426
+ reshape_dims
427
+ )
428
+ self.data.append(reshaped_packet_data)
383
429
 
384
430
  # No longer need to keep the raw data around
385
431
  del self.raw_data
@@ -12,9 +12,6 @@ PUI = PickUp Ion
12
12
  ESA = ElectroStatic Analyzer
13
13
  """
14
14
 
15
- # TODO: What to do in the case of a value of 255 in LOSSY_A and LOSSY_B
16
- # compression? (Joey uses 0x100000000)
17
-
18
15
  from imap_processing.codice.utils import CODICEAPID, CoDICECompression
19
16
 
20
17
  APIDS_FOR_SCIENCE_PROCESSING = [
@@ -34,8 +31,7 @@ APIDS_FOR_SCIENCE_PROCESSING = [
34
31
 
35
32
 
36
33
  # CDF-friendly names for lo data products
37
- LO_INST_COUNTS_AGGREGATED_VARIABLE_NAMES = ["aggregated"]
38
- LO_INST_COUNTS_SINGLES_VARIABLE_NAMES = ["apd_singles"]
34
+ LO_COUNTERS_SINGLES_VARIABLE_NAMES = ["apd_singles"]
39
35
  LO_SW_ANGULAR_VARIABLE_NAMES = ["hplus", "heplusplus", "oplus6", "fe_loq"]
40
36
  LO_NSW_ANGULAR_VARIABLE_NAMES = ["heplusplus"]
41
37
  LO_SW_PRIORITY_VARIABLE_NAMES = [
@@ -81,270 +77,230 @@ HI_INST_COUNTS_SINGLES_VARIABLE_NAMES = ["tcr", "ssdo", "stssd"]
81
77
  HI_OMNI_SPECIES_VARIABLE_NAMES = ["h", "he3", "he4", "c", "o", "ne_mg_si", "fe", "uh"]
82
78
  HI_SECT_SPECIES_VARIABLE_NAMES = ["h", "he3he4", "cno", "fe"]
83
79
 
84
- # TODO: Hi products shape should be energy x ssd index x spin sector (8*12*12)
80
+ # lo-counters-aggregated data product variables are dynamically determined
81
+ # based on the number of active counters
82
+ # TODO: Try to convince Joey to move to lower case variable names with
83
+ # underscores?
84
+ LO_COUNTERS_AGGREGATED_ACTIVE_VARIABLES = {
85
+ "TCR": True,
86
+ "DCR": True,
87
+ "TOFPlusAPD": False,
88
+ "TOFOnly": False,
89
+ "PositionPlusAPD": False,
90
+ "PositionOnly": False,
91
+ "STAorSTBPlusAPD": False,
92
+ "STAorSTBOnly": False,
93
+ "Reserved1": False,
94
+ "Reserved2": False,
95
+ "SPOnly": False,
96
+ "APDOnly": False,
97
+ "LowTOFCutoff": False,
98
+ "STA": True,
99
+ "STB": True,
100
+ "SP": True,
101
+ "TotalPositionCount": True,
102
+ "InvalidPositionCount": False,
103
+ "ASIC1FlagInvalid": False,
104
+ "ASIC2FlagInvalid": False,
105
+ "ASIC1ChannelInvalid": False,
106
+ "ASIC2ChannelInvalid": False,
107
+ "TEC4TimeoutTOFNoPos": False,
108
+ "TEC4TimeoutPosNoTOF": False,
109
+ "TEC4TimeoutNoPosTOF": False,
110
+ "TEC5TimeoutTOFNoPos": False,
111
+ "TEC5TimeoutPosNoTOF": False,
112
+ "TEC5TimeoutNoPosTOF": False,
113
+ }
114
+ LO_COUNTERS_AGGREGATED_VARIABLE_NAMES = [
115
+ name
116
+ for name, is_active in LO_COUNTERS_AGGREGATED_ACTIVE_VARIABLES.items()
117
+ if is_active
118
+ ]
119
+
120
+ # TODO: Possibly move to consistent order of dimensions with other instruments
121
+ # TBD after discussion with Joey and at the Science Team Meeting in Feb
85
122
  DATA_PRODUCT_CONFIGURATIONS = {
86
123
  CODICEAPID.COD_HI_INST_COUNTS_AGGREGATED: {
87
- "coords": [
88
- "epoch",
89
- "inst_az",
90
- "spin_sector",
91
- "esa_step",
92
- "energy_label",
93
- ], # TODO: These will likely change
94
124
  "dataset_name": "imap_codice_l1a_hi-counters-aggregated",
95
- "dims": [
96
- "epoch",
97
- "esa_step",
98
- "inst_az",
99
- "spin_sector",
100
- ], # TODO: These will likely change
125
+ "dims": {
126
+ "esa_step": 1,
127
+ "inst_az": 6,
128
+ "spin_sector": 1,
129
+ }, # TODO: Double check with Joey
101
130
  "instrument": "hi",
102
131
  "num_counters": 1,
103
- "num_energy_steps": 1, # TODO: Double check with Joey
104
- "num_positions": 6, # TODO: Double check with Joey
105
- "num_spin_sectors": 1,
106
132
  "support_variables": [], # TODO: Double check with Joey
107
133
  "variable_names": HI_INST_COUNTS_AGGREGATED_VARIABLE_NAMES,
108
134
  },
109
135
  CODICEAPID.COD_HI_INST_COUNTS_SINGLES: {
110
- "coords": [
111
- "epoch",
112
- "inst_az",
113
- "spin_sector",
114
- "esa_step",
115
- "energy_label",
116
- ], # TODO: These will likely change
117
136
  "dataset_name": "imap_codice_l1a_hi-counters-singles",
118
- "dims": [
119
- "epoch",
120
- "esa_step",
121
- "inst_az",
122
- "spin_sector",
123
- ], # TODO: These will likely change
137
+ "dims": {
138
+ "esa_step": 1,
139
+ "inst_az": 12,
140
+ "spin_sector": 1,
141
+ }, # TODO: Double check with Joey
124
142
  "instrument": "hi",
125
143
  "num_counters": 3,
126
- "num_energy_steps": 1, # TODO: Double check with Joey
127
- "num_positions": 12, # TODO: Double check with Joey
128
- "num_spin_sectors": 1,
129
144
  "support_variables": [], # No support variables for this one
130
145
  "variable_names": HI_INST_COUNTS_SINGLES_VARIABLE_NAMES,
131
146
  },
132
147
  CODICEAPID.COD_HI_OMNI_SPECIES_COUNTS: {
133
- "coords": [
134
- "epoch",
135
- "inst_az",
136
- "spin_sector",
137
- "esa_step",
138
- "energy_label",
139
- ], # TODO: These will likely change
140
148
  "dataset_name": "imap_codice_l1a_hi-omni",
141
- "dims": [
142
- "epoch",
143
- "esa_step",
144
- "inst_az",
145
- "spin_sector",
146
- ], # TODO: These will likely change
149
+ "dims": {
150
+ "esa_step": 15,
151
+ "inst_az": 4,
152
+ "spin_sector": 1,
153
+ }, # TODO: Double check with Joey
147
154
  "instrument": "hi",
148
155
  "num_counters": 8,
149
- "num_energy_steps": 15, # TODO: Double check with Joey
150
- "num_positions": 4, # TODO: Double check with Joey
151
- "num_spin_sectors": 1,
152
156
  "support_variables": ["data_quality", "spin_period"],
153
157
  "variable_names": HI_OMNI_SPECIES_VARIABLE_NAMES,
154
158
  },
155
159
  CODICEAPID.COD_HI_SECT_SPECIES_COUNTS: {
156
- "coords": [
157
- "epoch",
158
- "inst_az",
159
- "spin_sector",
160
- "esa_step",
161
- "energy_label",
162
- ], # TODO: These will likely change
163
160
  "dataset_name": "imap_codice_l1a_hi-sectored",
164
- "dims": [
165
- "epoch",
166
- "esa_step",
167
- "inst_az",
168
- "spin_sector",
169
- ], # TODO: These will likely change
161
+ "dims": {
162
+ "esa_step": 8,
163
+ "inst_az": 12,
164
+ "spin_sector": 12,
165
+ }, # TODO: Double check with Joey
170
166
  "instrument": "hi",
171
167
  "num_counters": 4,
172
- "num_energy_steps": 8,
173
- "num_positions": 12,
174
- "num_spin_sectors": 12,
175
168
  "support_variables": ["data_quality", "spin_period"],
176
169
  "variable_names": HI_SECT_SPECIES_VARIABLE_NAMES,
177
170
  },
178
171
  CODICEAPID.COD_LO_INST_COUNTS_AGGREGATED: {
179
- "coords": [
180
- "epoch",
181
- "inst_az",
182
- "spin_sector",
183
- "esa_step",
184
- "energy_label",
185
- ], # TODO: These will likely change
186
172
  "dataset_name": "imap_codice_l1a_lo-counters-aggregated",
187
- "dims": ["epoch", "esa_step", "inst_az", "spin_sector"],
173
+ "dims": {"spin_sector_pairs": 6, "esa_step": 128},
188
174
  "instrument": "lo",
189
- "num_counters": 1,
190
- "num_energy_steps": 128,
191
- "num_positions": 6,
192
- "num_spin_sectors": 6,
175
+ "num_counters": len(
176
+ LO_COUNTERS_AGGREGATED_VARIABLE_NAMES
177
+ ), # The number of counters depencds on the number of active counters
193
178
  "support_variables": [
194
179
  "energy_table",
195
180
  "acquisition_time_per_step",
196
- ], # TODO: Double check with Joey
197
- "variable_names": LO_INST_COUNTS_AGGREGATED_VARIABLE_NAMES,
181
+ "rgfo_half_spin",
182
+ "nso_half_spin",
183
+ "sw_bias_gain_mode",
184
+ "st_bias_gain_mode",
185
+ "data_quality",
186
+ "spin_period",
187
+ ],
188
+ "variable_names": LO_COUNTERS_AGGREGATED_VARIABLE_NAMES,
198
189
  },
199
190
  CODICEAPID.COD_LO_INST_COUNTS_SINGLES: {
200
- "coords": [
201
- "epoch",
202
- "inst_az",
203
- "spin_sector",
204
- "esa_step",
205
- "energy_label",
206
- ], # TODO: These will likely change
207
191
  "dataset_name": "imap_codice_l1a_lo-counters-singles",
208
- "dims": ["epoch", "esa_step", "inst_az", "spin_sector"],
192
+ "dims": {"inst_az": 24, "spin_sector_pairs": 6, "esa_step": 128},
209
193
  "instrument": "lo",
210
194
  "num_counters": 1,
211
- "num_energy_steps": 128,
212
- "num_positions": 24,
213
- "num_spin_sectors": 6,
214
195
  "support_variables": [
215
- "spin_sector_pairs",
216
196
  "energy_table",
217
197
  "acquisition_time_per_step",
218
- "RGFO_half_spin",
219
- "NGO_half_spin",
220
- "SW_bias_gain_mode",
221
- "ST_bias_gain_mode",
198
+ "rgfo_half_spin",
199
+ "nso_half_spin",
200
+ "sw_bias_gain_mode",
201
+ "st_bias_gain_mode",
222
202
  "data_quality",
223
203
  "spin_period",
224
204
  ],
225
- "variable_names": LO_INST_COUNTS_SINGLES_VARIABLE_NAMES,
205
+ "variable_names": LO_COUNTERS_SINGLES_VARIABLE_NAMES,
226
206
  },
227
207
  CODICEAPID.COD_LO_SW_ANGULAR_COUNTS: {
228
- "coords": ["epoch", "energy_label", "esa_step", "inst_az", "spin_sector"],
229
208
  "dataset_name": "imap_codice_l1a_lo-sw-angular",
230
- "dims": ["epoch", "esa_step", "inst_az", "spin_sector"],
209
+ "dims": {"inst_az": 5, "spin_sector": 12, "esa_step": 128},
231
210
  "instrument": "lo",
232
211
  "num_counters": 4,
233
- "num_energy_steps": 128,
234
- "num_positions": 5,
235
- "num_spin_sectors": 12,
236
212
  "support_variables": [
237
213
  "energy_table",
238
214
  "acquisition_time_per_step",
239
- "RGFO_half_spin",
240
- "NGO_half_spin",
241
- "SW_bias_gain_mode",
242
- "ST_bias_gain_mode",
215
+ "rgfo_half_spin",
216
+ "nso_half_spin",
217
+ "sw_bias_gain_mode",
218
+ "st_bias_gain_mode",
243
219
  "data_quality",
244
220
  "spin_period",
245
221
  ],
246
222
  "variable_names": LO_SW_ANGULAR_VARIABLE_NAMES,
247
223
  },
248
224
  CODICEAPID.COD_LO_NSW_ANGULAR_COUNTS: {
249
- "coords": ["epoch", "inst_az", "spin_sector", "esa_step", "energy_label"],
250
225
  "dataset_name": "imap_codice_l1a_lo-nsw-angular",
251
- "dims": ["epoch", "esa_step", "inst_az", "spin_sector"],
226
+ "dims": {"inst_az": 19, "spin_sector": 12, "esa_step": 128},
252
227
  "instrument": "lo",
253
228
  "num_counters": 1,
254
- "num_energy_steps": 128,
255
- "num_positions": 19,
256
- "num_spin_sectors": 12,
257
229
  "support_variables": [
258
230
  "energy_table",
259
231
  "acquisition_time_per_step",
260
- "RGFO_half_spin",
261
- "NGO_half_spin",
262
- "SW_bias_gain_mode",
263
- "ST_bias_gain_mode",
232
+ "rgfo_half_spin",
233
+ "nso_half_spin",
234
+ "sw_bias_gain_mode",
235
+ "st_bias_gain_mode",
264
236
  "data_quality",
265
237
  "spin_period",
266
238
  ],
267
239
  "variable_names": LO_NSW_ANGULAR_VARIABLE_NAMES,
268
240
  },
269
241
  CODICEAPID.COD_LO_SW_PRIORITY_COUNTS: {
270
- "coords": ["epoch", "inst_az", "spin_sector", "esa_step", "energy_label"],
271
242
  "dataset_name": "imap_codice_l1a_lo-sw-priority",
272
- "dims": ["epoch", "esa_step", "inst_az", "spin_sector"],
243
+ "dims": {"spin_sector": 12, "esa_step": 128},
273
244
  "instrument": "lo",
274
245
  "num_counters": 5,
275
- "num_energy_steps": 128,
276
- "num_positions": 1,
277
- "num_spin_sectors": 12,
278
246
  "support_variables": [
279
247
  "energy_table",
280
248
  "acquisition_time_per_step",
281
- "RGFO_half_spin",
282
- "NGO_half_spin",
283
- "SW_bias_gain_mode",
284
- "ST_bias_gain_mode",
249
+ "rgfo_half_spin",
250
+ "nso_half_spin",
251
+ "sw_bias_gain_mode",
252
+ "st_bias_gain_mode",
285
253
  "data_quality",
286
254
  "spin_period",
287
255
  ],
288
256
  "variable_names": LO_SW_PRIORITY_VARIABLE_NAMES,
289
257
  },
290
258
  CODICEAPID.COD_LO_NSW_PRIORITY_COUNTS: {
291
- "coords": ["epoch", "inst_az", "spin_sector", "esa_step", "energy_label"],
292
259
  "dataset_name": "imap_codice_l1a_lo-nsw-priority",
293
- "dims": ["epoch", "esa_step", "inst_az", "spin_sector"],
260
+ "dims": {"spin_sector": 12, "esa_step": 128},
294
261
  "instrument": "lo",
295
262
  "num_counters": 2,
296
- "num_energy_steps": 128,
297
- "num_positions": 1,
298
- "num_spin_sectors": 12,
299
263
  "support_variables": [
300
264
  "energy_table",
301
265
  "acquisition_time_per_step",
302
- "RGFO_half_spin",
303
- "NGO_half_spin",
304
- "SW_bias_gain_mode",
305
- "ST_bias_gain_mode",
266
+ "rgfo_half_spin",
267
+ "nso_half_spin",
268
+ "sw_bias_gain_mode",
269
+ "st_bias_gain_mode",
306
270
  "data_quality",
307
271
  "spin_period",
308
272
  ],
309
273
  "variable_names": LO_NSW_PRIORITY_VARIABLE_NAMES,
310
274
  },
311
275
  CODICEAPID.COD_LO_SW_SPECIES_COUNTS: {
312
- "coords": ["epoch", "inst_az", "spin_sector", "esa_step", "energy_label"],
313
276
  "dataset_name": "imap_codice_l1a_lo-sw-species",
314
- "dims": ["epoch", "esa_step", "inst_az", "spin_sector"],
277
+ "dims": {"spin_sector": 1, "esa_step": 128},
315
278
  "instrument": "lo",
316
279
  "num_counters": 16,
317
- "num_energy_steps": 128,
318
- "num_positions": 1,
319
- "num_spin_sectors": 1,
320
280
  "support_variables": [
321
281
  "energy_table",
322
282
  "acquisition_time_per_step",
323
- "RGFO_half_spin",
324
- "NGO_half_spin",
325
- "SW_bias_gain_mode",
326
- "ST_bias_gain_mode",
283
+ "rgfo_half_spin",
284
+ "nso_half_spin",
285
+ "sw_bias_gain_mode",
286
+ "st_bias_gain_mode",
327
287
  "data_quality",
328
288
  "spin_period",
329
289
  ],
330
290
  "variable_names": LO_SW_SPECIES_VARIABLE_NAMES,
331
291
  },
332
292
  CODICEAPID.COD_LO_NSW_SPECIES_COUNTS: {
333
- "coords": ["epoch", "inst_az", "spin_sector", "esa_step", "energy_label"],
334
293
  "dataset_name": "imap_codice_l1a_lo-nsw-species",
335
- "dims": ["epoch", "esa_step", "inst_az", "spin_sector"],
294
+ "dims": {"spin_sector": 1, "esa_step": 128},
336
295
  "instrument": "lo",
337
296
  "num_counters": 8,
338
- "num_energy_steps": 128,
339
- "num_positions": 1,
340
- "num_spin_sectors": 1,
341
297
  "support_variables": [
342
298
  "energy_table",
343
299
  "acquisition_time_per_step",
344
- "RGFO_half_spin",
345
- "NGO_half_spin",
346
- "SW_bias_gain_mode",
347
- "ST_bias_gain_mode",
300
+ "rgfo_half_spin",
301
+ "nso_half_spin",
302
+ "sw_bias_gain_mode",
303
+ "st_bias_gain_mode",
348
304
  "data_quality",
349
305
  "spin_period",
350
306
  ],