imap-processing 0.11.0__py3-none-any.whl → 0.13.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.
- imap_processing/__init__.py +11 -11
- imap_processing/_version.py +2 -2
- imap_processing/ccsds/ccsds_data.py +1 -2
- imap_processing/ccsds/excel_to_xtce.py +66 -18
- imap_processing/cdf/config/imap_codice_global_cdf_attrs.yaml +24 -40
- imap_processing/cdf/config/imap_codice_l1a_variable_attrs.yaml +934 -42
- imap_processing/cdf/config/imap_codice_l1b_variable_attrs.yaml +1846 -128
- imap_processing/cdf/config/imap_glows_global_cdf_attrs.yaml +0 -5
- imap_processing/cdf/config/imap_hi_global_cdf_attrs.yaml +10 -11
- imap_processing/cdf/config/imap_hi_variable_attrs.yaml +17 -19
- imap_processing/cdf/config/imap_hit_global_cdf_attrs.yaml +27 -14
- imap_processing/cdf/config/imap_hit_l1a_variable_attrs.yaml +106 -116
- imap_processing/cdf/config/imap_hit_l1b_variable_attrs.yaml +120 -145
- imap_processing/cdf/config/imap_hit_l2_variable_attrs.yaml +14 -0
- imap_processing/cdf/config/imap_idex_global_cdf_attrs.yaml +25 -9
- imap_processing/cdf/config/imap_idex_l1a_variable_attrs.yaml +6 -4
- imap_processing/cdf/config/imap_idex_l1b_variable_attrs.yaml +3 -3
- imap_processing/cdf/config/imap_lo_global_cdf_attrs.yaml +0 -12
- imap_processing/cdf/config/imap_lo_l1a_variable_attrs.yaml +1 -1
- imap_processing/cdf/config/imap_mag_global_cdf_attrs.yaml +23 -20
- imap_processing/cdf/config/imap_mag_l1a_variable_attrs.yaml +361 -0
- imap_processing/cdf/config/imap_mag_l1b_variable_attrs.yaml +160 -0
- imap_processing/cdf/config/imap_mag_l1c_variable_attrs.yaml +160 -0
- imap_processing/cdf/config/imap_spacecraft_global_cdf_attrs.yaml +18 -0
- imap_processing/cdf/config/imap_spacecraft_variable_attrs.yaml +40 -0
- imap_processing/cdf/config/imap_swapi_global_cdf_attrs.yaml +1 -5
- imap_processing/cdf/config/imap_swapi_variable_attrs.yaml +22 -0
- imap_processing/cdf/config/imap_swe_global_cdf_attrs.yaml +12 -4
- imap_processing/cdf/config/imap_swe_l1a_variable_attrs.yaml +16 -2
- imap_processing/cdf/config/imap_swe_l1b_variable_attrs.yaml +64 -52
- imap_processing/cdf/config/imap_swe_l2_variable_attrs.yaml +71 -47
- imap_processing/cdf/config/imap_ultra_global_cdf_attrs.yaml +180 -19
- imap_processing/cdf/config/imap_ultra_l1a_variable_attrs.yaml +5045 -41
- imap_processing/cdf/config/imap_ultra_l1b_variable_attrs.yaml +80 -17
- imap_processing/cdf/config/imap_ultra_l1c_variable_attrs.yaml +32 -57
- imap_processing/cdf/utils.py +52 -38
- imap_processing/cli.py +477 -233
- imap_processing/codice/codice_l1a.py +466 -131
- imap_processing/codice/codice_l1b.py +51 -152
- imap_processing/codice/constants.py +1360 -569
- imap_processing/codice/decompress.py +2 -6
- imap_processing/ena_maps/ena_maps.py +1103 -146
- imap_processing/ena_maps/utils/coordinates.py +19 -0
- imap_processing/ena_maps/utils/map_utils.py +14 -17
- imap_processing/ena_maps/utils/spatial_utils.py +55 -52
- imap_processing/glows/l1a/glows_l1a.py +28 -99
- imap_processing/glows/l1a/glows_l1a_data.py +2 -2
- imap_processing/glows/l1b/glows_l1b.py +1 -4
- imap_processing/glows/l1b/glows_l1b_data.py +1 -3
- imap_processing/glows/l2/glows_l2.py +2 -5
- imap_processing/hi/l1a/hi_l1a.py +54 -29
- imap_processing/hi/l1a/histogram.py +0 -1
- imap_processing/hi/l1a/science_direct_event.py +6 -8
- imap_processing/hi/l1b/hi_l1b.py +111 -82
- imap_processing/hi/l1c/hi_l1c.py +416 -32
- imap_processing/hi/utils.py +58 -12
- imap_processing/hit/ancillary/imap_hit_l1b-to-l2-sector-dt0-factors_20250219_v002.csv +81 -0
- imap_processing/hit/ancillary/imap_hit_l1b-to-l2-standard-dt0-factors_20250219_v002.csv +205 -0
- imap_processing/hit/ancillary/imap_hit_l1b-to-l2-standard-dt1-factors_20250219_v002.csv +205 -0
- imap_processing/hit/ancillary/imap_hit_l1b-to-l2-standard-dt2-factors_20250219_v002.csv +205 -0
- imap_processing/hit/ancillary/imap_hit_l1b-to-l2-standard-dt3-factors_20250219_v002.csv +205 -0
- imap_processing/hit/ancillary/imap_hit_l1b-to-l2-summed-dt0-factors_20250219_v002.csv +68 -0
- imap_processing/hit/hit_utils.py +235 -5
- imap_processing/hit/l0/constants.py +20 -11
- imap_processing/hit/l0/decom_hit.py +21 -5
- imap_processing/hit/l1a/hit_l1a.py +71 -75
- imap_processing/hit/l1b/constants.py +321 -0
- imap_processing/hit/l1b/hit_l1b.py +377 -67
- imap_processing/hit/l2/constants.py +318 -0
- imap_processing/hit/l2/hit_l2.py +723 -0
- imap_processing/hit/packet_definitions/hit_packet_definitions.xml +1323 -71
- imap_processing/ialirt/l0/mag_l0_ialirt_data.py +155 -0
- imap_processing/ialirt/l0/parse_mag.py +374 -0
- imap_processing/ialirt/l0/process_swapi.py +69 -0
- imap_processing/ialirt/l0/process_swe.py +548 -0
- imap_processing/ialirt/packet_definitions/ialirt.xml +216 -208
- imap_processing/ialirt/packet_definitions/ialirt_codicehi.xml +1 -1
- imap_processing/ialirt/packet_definitions/ialirt_codicelo.xml +1 -1
- imap_processing/ialirt/packet_definitions/ialirt_mag.xml +115 -0
- imap_processing/ialirt/packet_definitions/ialirt_swapi.xml +14 -14
- imap_processing/ialirt/utils/grouping.py +114 -0
- imap_processing/ialirt/utils/time.py +29 -0
- imap_processing/idex/atomic_masses.csv +22 -0
- imap_processing/idex/decode.py +2 -2
- imap_processing/idex/idex_constants.py +33 -0
- imap_processing/idex/idex_l0.py +22 -8
- imap_processing/idex/idex_l1a.py +81 -51
- imap_processing/idex/idex_l1b.py +13 -39
- imap_processing/idex/idex_l2a.py +823 -0
- imap_processing/idex/idex_l2b.py +120 -0
- imap_processing/idex/idex_variable_unpacking_and_eu_conversion.csv +11 -11
- imap_processing/idex/packet_definitions/idex_housekeeping_packet_definition.xml +9130 -0
- imap_processing/lo/l0/lo_science.py +7 -2
- imap_processing/lo/l1a/lo_l1a.py +1 -5
- imap_processing/lo/l1b/lo_l1b.py +702 -29
- imap_processing/lo/l1b/tof_conversions.py +11 -0
- imap_processing/lo/l1c/lo_l1c.py +1 -4
- imap_processing/mag/constants.py +51 -0
- imap_processing/mag/imap_mag_sdc_configuration_v001.py +8 -0
- imap_processing/mag/l0/decom_mag.py +10 -3
- imap_processing/mag/l1a/mag_l1a.py +23 -19
- imap_processing/mag/l1a/mag_l1a_data.py +35 -10
- imap_processing/mag/l1b/mag_l1b.py +259 -50
- imap_processing/mag/l1c/interpolation_methods.py +388 -0
- imap_processing/mag/l1c/mag_l1c.py +621 -17
- imap_processing/mag/l2/mag_l2.py +140 -0
- imap_processing/mag/l2/mag_l2_data.py +288 -0
- imap_processing/quality_flags.py +1 -0
- imap_processing/spacecraft/packet_definitions/scid_x252.xml +538 -0
- imap_processing/spacecraft/quaternions.py +121 -0
- imap_processing/spice/geometry.py +19 -22
- imap_processing/spice/kernels.py +0 -276
- imap_processing/spice/pointing_frame.py +257 -0
- imap_processing/spice/repoint.py +149 -0
- imap_processing/spice/spin.py +38 -33
- imap_processing/spice/time.py +24 -0
- imap_processing/swapi/l1/swapi_l1.py +20 -12
- imap_processing/swapi/l2/swapi_l2.py +116 -5
- imap_processing/swapi/swapi_utils.py +32 -0
- imap_processing/swe/l1a/swe_l1a.py +44 -12
- imap_processing/swe/l1a/swe_science.py +13 -13
- imap_processing/swe/l1b/swe_l1b.py +898 -23
- imap_processing/swe/l2/swe_l2.py +75 -136
- imap_processing/swe/packet_definitions/swe_packet_definition.xml +1121 -1
- imap_processing/swe/utils/swe_constants.py +64 -0
- imap_processing/swe/utils/swe_utils.py +85 -28
- imap_processing/tests/ccsds/test_data/expected_output.xml +40 -1
- imap_processing/tests/ccsds/test_excel_to_xtce.py +24 -21
- imap_processing/tests/cdf/test_data/imap_instrument2_global_cdf_attrs.yaml +0 -2
- imap_processing/tests/cdf/test_utils.py +14 -16
- imap_processing/tests/codice/conftest.py +44 -33
- imap_processing/tests/codice/data/validation/imap_codice_l1a_hi-counters-aggregated_20241110193700_v0.0.0.cdf +0 -0
- imap_processing/tests/codice/data/validation/imap_codice_l1a_hi-counters-singles_20241110193700_v0.0.0.cdf +0 -0
- imap_processing/tests/codice/data/validation/imap_codice_l1a_hi-ialirt_20241110193700_v0.0.0.cdf +0 -0
- imap_processing/tests/codice/data/validation/imap_codice_l1a_hi-omni_20241110193700_v0.0.0.cdf +0 -0
- imap_processing/tests/codice/data/validation/imap_codice_l1a_hi-pha_20241110193700_v0.0.0.cdf +0 -0
- imap_processing/tests/codice/data/validation/imap_codice_l1a_hi-priorities_20241110193700_v0.0.0.cdf +0 -0
- imap_processing/tests/codice/data/validation/imap_codice_l1a_hi-sectored_20241110193700_v0.0.0.cdf +0 -0
- imap_processing/tests/codice/data/validation/imap_codice_l1a_lo-counters-aggregated_20241110193700_v0.0.0.cdf +0 -0
- imap_processing/tests/codice/data/validation/imap_codice_l1a_lo-counters-singles_20241110193700_v0.0.0.cdf +0 -0
- imap_processing/tests/codice/data/validation/imap_codice_l1a_lo-ialirt_20241110193700_v0.0.0.cdf +0 -0
- imap_processing/tests/codice/data/validation/imap_codice_l1a_lo-nsw-angular_20241110193700_v0.0.0.cdf +0 -0
- imap_processing/tests/codice/data/validation/imap_codice_l1a_lo-nsw-priority_20241110193700_v0.0.0.cdf +0 -0
- imap_processing/tests/codice/data/validation/imap_codice_l1a_lo-nsw-species_20241110193700_v0.0.0.cdf +0 -0
- imap_processing/tests/codice/data/validation/imap_codice_l1a_lo-pha_20241110193700_v0.0.0.cdf +0 -0
- imap_processing/tests/codice/data/validation/imap_codice_l1a_lo-sw-angular_20241110193700_v0.0.0.cdf +0 -0
- imap_processing/tests/codice/data/validation/imap_codice_l1a_lo-sw-priority_20241110193700_v0.0.0.cdf +0 -0
- imap_processing/tests/codice/data/validation/imap_codice_l1a_lo-sw-species_20241110193700_v0.0.0.cdf +0 -0
- imap_processing/tests/codice/test_codice_l1a.py +126 -53
- imap_processing/tests/codice/test_codice_l1b.py +6 -7
- imap_processing/tests/codice/test_decompress.py +4 -4
- imap_processing/tests/conftest.py +239 -27
- imap_processing/tests/ena_maps/conftest.py +51 -0
- imap_processing/tests/ena_maps/test_ena_maps.py +1068 -110
- imap_processing/tests/ena_maps/test_map_utils.py +66 -43
- imap_processing/tests/ena_maps/test_spatial_utils.py +17 -21
- imap_processing/tests/glows/conftest.py +10 -14
- imap_processing/tests/glows/test_glows_decom.py +4 -4
- imap_processing/tests/glows/test_glows_l1a_cdf.py +6 -27
- imap_processing/tests/glows/test_glows_l1a_data.py +6 -8
- imap_processing/tests/glows/test_glows_l1b.py +11 -11
- imap_processing/tests/glows/test_glows_l1b_data.py +5 -5
- imap_processing/tests/glows/test_glows_l2.py +2 -8
- imap_processing/tests/hi/conftest.py +1 -1
- imap_processing/tests/hi/data/l0/H45_diag_fee_20250208.bin +0 -0
- imap_processing/tests/hi/data/l0/H45_diag_fee_20250208_verify.csv +205 -0
- imap_processing/tests/hi/test_hi_l1b.py +22 -27
- imap_processing/tests/hi/test_hi_l1c.py +249 -18
- imap_processing/tests/hi/test_l1a.py +35 -7
- imap_processing/tests/hi/test_science_direct_event.py +3 -3
- imap_processing/tests/hi/test_utils.py +24 -2
- imap_processing/tests/hit/helpers/l1_validation.py +74 -73
- imap_processing/tests/hit/test_data/hskp_sample.ccsds +0 -0
- imap_processing/tests/hit/test_data/imap_hit_l0_raw_20100105_v001.pkts +0 -0
- imap_processing/tests/hit/test_decom_hit.py +5 -1
- imap_processing/tests/hit/test_hit_l1a.py +32 -36
- imap_processing/tests/hit/test_hit_l1b.py +300 -81
- imap_processing/tests/hit/test_hit_l2.py +716 -0
- imap_processing/tests/hit/test_hit_utils.py +184 -7
- imap_processing/tests/hit/validation_data/hit_l1b_standard_sample2_nsrl_v4_3decimals.csv +62 -62
- imap_processing/tests/hit/validation_data/hskp_sample_eu_3_6_2025.csv +89 -0
- imap_processing/tests/hit/validation_data/hskp_sample_raw.csv +89 -88
- imap_processing/tests/hit/validation_data/sci_sample_raw.csv +1 -1
- imap_processing/tests/ialirt/data/l0/461971383-404.bin +0 -0
- imap_processing/tests/ialirt/data/l0/461971384-405.bin +0 -0
- imap_processing/tests/ialirt/data/l0/461971385-406.bin +0 -0
- imap_processing/tests/ialirt/data/l0/461971386-407.bin +0 -0
- imap_processing/tests/ialirt/data/l0/461971387-408.bin +0 -0
- imap_processing/tests/ialirt/data/l0/461971388-409.bin +0 -0
- imap_processing/tests/ialirt/data/l0/461971389-410.bin +0 -0
- imap_processing/tests/ialirt/data/l0/461971390-411.bin +0 -0
- imap_processing/tests/ialirt/data/l0/461971391-412.bin +0 -0
- imap_processing/tests/ialirt/data/l0/sample_decoded_i-alirt_data.csv +383 -0
- imap_processing/tests/ialirt/unit/test_decom_ialirt.py +16 -81
- imap_processing/tests/ialirt/unit/test_grouping.py +81 -0
- imap_processing/tests/ialirt/unit/test_parse_mag.py +223 -0
- imap_processing/tests/ialirt/unit/test_process_codicehi.py +3 -3
- imap_processing/tests/ialirt/unit/test_process_codicelo.py +3 -10
- imap_processing/tests/ialirt/unit/test_process_ephemeris.py +4 -4
- imap_processing/tests/ialirt/unit/test_process_hit.py +3 -3
- imap_processing/tests/ialirt/unit/test_process_swapi.py +24 -16
- imap_processing/tests/ialirt/unit/test_process_swe.py +319 -6
- imap_processing/tests/ialirt/unit/test_time.py +16 -0
- imap_processing/tests/idex/conftest.py +127 -6
- imap_processing/tests/idex/test_data/imap_idex_l0_raw_20231218_v001.pkts +0 -0
- imap_processing/tests/idex/test_data/imap_idex_l0_raw_20241206_v001.pkts +0 -0
- imap_processing/tests/idex/test_data/imap_idex_l0_raw_20250108_v001.pkts +0 -0
- imap_processing/tests/idex/test_data/impact_14_tof_high_data.txt +4508 -4508
- imap_processing/tests/idex/test_idex_l0.py +33 -11
- imap_processing/tests/idex/test_idex_l1a.py +92 -21
- imap_processing/tests/idex/test_idex_l1b.py +106 -27
- imap_processing/tests/idex/test_idex_l2a.py +399 -0
- imap_processing/tests/idex/test_idex_l2b.py +93 -0
- imap_processing/tests/lo/test_cdfs/imap_lo_l1a_de_20241022_v002.cdf +0 -0
- imap_processing/tests/lo/test_cdfs/imap_lo_l1a_spin_20241022_v002.cdf +0 -0
- imap_processing/tests/lo/test_lo_l1a.py +3 -3
- imap_processing/tests/lo/test_lo_l1b.py +515 -6
- imap_processing/tests/lo/test_lo_l1c.py +1 -1
- imap_processing/tests/lo/test_lo_science.py +7 -7
- imap_processing/tests/lo/test_star_sensor.py +1 -1
- imap_processing/tests/mag/conftest.py +120 -2
- imap_processing/tests/mag/test_mag_decom.py +5 -4
- imap_processing/tests/mag/test_mag_l1a.py +51 -7
- imap_processing/tests/mag/test_mag_l1b.py +40 -59
- imap_processing/tests/mag/test_mag_l1c.py +354 -19
- imap_processing/tests/mag/test_mag_l2.py +130 -0
- imap_processing/tests/mag/test_mag_validation.py +247 -26
- imap_processing/tests/mag/validation/L1b/T009/MAGScience-normal-(2,2)-8s-20250204-16h39.csv +17 -0
- imap_processing/tests/mag/validation/L1b/T009/mag-l1a-l1b-t009-magi-out.csv +16 -16
- imap_processing/tests/mag/validation/L1b/T009/mag-l1a-l1b-t009-mago-out.csv +16 -16
- imap_processing/tests/mag/validation/L1b/T010/MAGScience-normal-(2,2)-8s-20250206-12h05.csv +17 -0
- imap_processing/tests/mag/validation/L1b/T011/MAGScience-normal-(2,2)-8s-20250204-16h08.csv +17 -0
- imap_processing/tests/mag/validation/L1b/T011/mag-l1a-l1b-t011-magi-out.csv +16 -16
- imap_processing/tests/mag/validation/L1b/T011/mag-l1a-l1b-t011-mago-out.csv +16 -16
- imap_processing/tests/mag/validation/L1b/T012/MAGScience-normal-(2,2)-8s-20250204-16h08.csv +17 -0
- imap_processing/tests/mag/validation/L1b/T012/data.bin +0 -0
- imap_processing/tests/mag/validation/L1b/T012/field_like_all_ranges.txt +19200 -0
- imap_processing/tests/mag/validation/L1b/T012/mag-l1a-l1b-t012-cal.cdf +0 -0
- imap_processing/tests/mag/validation/L1b/T012/mag-l1a-l1b-t012-in.csv +17 -0
- imap_processing/tests/mag/validation/L1b/T012/mag-l1a-l1b-t012-magi-out.csv +17 -0
- imap_processing/tests/mag/validation/L1b/T012/mag-l1a-l1b-t012-mago-out.csv +17 -0
- imap_processing/tests/mag/validation/L1c/T013/mag-l1b-l1c-t013-magi-normal-in.csv +1217 -0
- imap_processing/tests/mag/validation/L1c/T013/mag-l1b-l1c-t013-magi-normal-out.csv +1857 -0
- imap_processing/tests/mag/validation/L1c/T013/mag-l1b-l1c-t013-mago-normal-in.csv +1217 -0
- imap_processing/tests/mag/validation/L1c/T013/mag-l1b-l1c-t013-mago-normal-out.csv +1857 -0
- imap_processing/tests/mag/validation/L1c/T014/mag-l1b-l1c-t014-magi-normal-in.csv +1217 -0
- imap_processing/tests/mag/validation/L1c/T014/mag-l1b-l1c-t014-magi-normal-out.csv +1793 -0
- imap_processing/tests/mag/validation/L1c/T014/mag-l1b-l1c-t014-mago-normal-in.csv +1217 -0
- imap_processing/tests/mag/validation/L1c/T014/mag-l1b-l1c-t014-mago-normal-out.csv +1793 -0
- imap_processing/tests/mag/validation/L1c/T015/mag-l1b-l1c-t015-magi-burst-in.csv +2561 -0
- imap_processing/tests/mag/validation/L1c/T015/mag-l1b-l1c-t015-magi-normal-in.csv +961 -0
- imap_processing/tests/mag/validation/L1c/T015/mag-l1b-l1c-t015-magi-normal-out.csv +1539 -0
- imap_processing/tests/mag/validation/L1c/T015/mag-l1b-l1c-t015-mago-normal-in.csv +1921 -0
- imap_processing/tests/mag/validation/L1c/T015/mag-l1b-l1c-t015-mago-normal-out.csv +2499 -0
- imap_processing/tests/mag/validation/L1c/T016/mag-l1b-l1c-t016-magi-normal-in.csv +865 -0
- imap_processing/tests/mag/validation/L1c/T016/mag-l1b-l1c-t016-magi-normal-out.csv +1196 -0
- imap_processing/tests/mag/validation/L1c/T016/mag-l1b-l1c-t016-mago-normal-in.csv +1729 -0
- imap_processing/tests/mag/validation/L1c/T016/mag-l1b-l1c-t016-mago-normal-out.csv +3053 -0
- imap_processing/tests/mag/validation/L2/imap_mag_l1b_norm-mago_20251017_v002.cdf +0 -0
- imap_processing/tests/mag/validation/calibration/imap_mag_l1b-calibration_20240229_v001.cdf +0 -0
- imap_processing/tests/mag/validation/calibration/imap_mag_l2-calibration-matrices_20251017_v004.cdf +0 -0
- imap_processing/tests/mag/validation/calibration/imap_mag_l2-offsets-norm_20251017_20251017_v001.cdf +0 -0
- imap_processing/tests/spacecraft/data/SSR_2024_190_20_08_12_0483851794_2_DA_apid0594_1packet.pkts +0 -0
- imap_processing/tests/spacecraft/test_quaternions.py +71 -0
- imap_processing/tests/spice/test_data/fake_repoint_data.csv +5 -0
- imap_processing/tests/spice/test_data/fake_spin_data.csv +11 -11
- imap_processing/tests/spice/test_geometry.py +9 -12
- imap_processing/tests/spice/test_kernels.py +1 -200
- imap_processing/tests/spice/test_pointing_frame.py +185 -0
- imap_processing/tests/spice/test_repoint.py +121 -0
- imap_processing/tests/spice/test_spin.py +50 -9
- imap_processing/tests/spice/test_time.py +14 -0
- imap_processing/tests/swapi/lut/imap_swapi_esa-unit-conversion_20250211_v000.csv +73 -0
- imap_processing/tests/swapi/lut/imap_swapi_lut-notes_20250211_v000.csv +1025 -0
- imap_processing/tests/swapi/test_swapi_l1.py +13 -11
- imap_processing/tests/swapi/test_swapi_l2.py +180 -8
- imap_processing/tests/swe/l0_data/2024051010_SWE_HK_packet.bin +0 -0
- imap_processing/tests/swe/l0_data/2024051011_SWE_CEM_RAW_packet.bin +0 -0
- imap_processing/tests/swe/l0_validation_data/idle_export_eu.SWE_APP_HK_20240510_092742.csv +49 -0
- imap_processing/tests/swe/l0_validation_data/idle_export_eu.SWE_CEM_RAW_20240510_092742.csv +593 -0
- imap_processing/tests/swe/lut/checker-board-indices.csv +24 -0
- imap_processing/tests/swe/lut/imap_swe_esa-lut_20250301_v000.csv +385 -0
- imap_processing/tests/swe/lut/imap_swe_l1b-in-flight-cal_20240510_20260716_v000.csv +3 -0
- imap_processing/tests/swe/test_swe_l1a.py +20 -2
- imap_processing/tests/swe/test_swe_l1a_cem_raw.py +52 -0
- imap_processing/tests/swe/test_swe_l1a_hk.py +68 -0
- imap_processing/tests/swe/test_swe_l1a_science.py +3 -3
- imap_processing/tests/swe/test_swe_l1b.py +162 -24
- imap_processing/tests/swe/test_swe_l2.py +153 -91
- imap_processing/tests/test_cli.py +171 -88
- imap_processing/tests/test_utils.py +140 -17
- imap_processing/tests/ultra/data/l0/FM45_UltraFM45_Functional_2024-01-22T0105_20240122T010548.CCSDS +0 -0
- imap_processing/tests/ultra/data/l0/ultra45_raw_sc_ultraimgrates_20220530_00.csv +164 -0
- imap_processing/tests/ultra/{test_data → data}/l0/ultra45_raw_sc_ultrarawimg_withFSWcalcs_FM45_40P_Phi28p5_BeamCal_LinearScan_phi2850_theta-000_20240207T102740.csv +3243 -3243
- imap_processing/tests/ultra/data/mock_data.py +369 -0
- imap_processing/tests/ultra/unit/conftest.py +115 -89
- imap_processing/tests/ultra/unit/test_badtimes.py +4 -4
- imap_processing/tests/ultra/unit/test_cullingmask.py +8 -6
- imap_processing/tests/ultra/unit/test_de.py +14 -13
- imap_processing/tests/ultra/unit/test_decom_apid_880.py +27 -76
- imap_processing/tests/ultra/unit/test_decom_apid_881.py +54 -11
- imap_processing/tests/ultra/unit/test_decom_apid_883.py +12 -10
- imap_processing/tests/ultra/unit/test_decom_apid_896.py +202 -55
- imap_processing/tests/ultra/unit/test_lookup_utils.py +23 -1
- imap_processing/tests/ultra/unit/test_spacecraft_pset.py +77 -0
- imap_processing/tests/ultra/unit/test_ultra_l1a.py +98 -305
- imap_processing/tests/ultra/unit/test_ultra_l1b.py +60 -14
- imap_processing/tests/ultra/unit/test_ultra_l1b_annotated.py +2 -2
- imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py +26 -27
- imap_processing/tests/ultra/unit/test_ultra_l1b_extended.py +239 -70
- imap_processing/tests/ultra/unit/test_ultra_l1c.py +5 -5
- imap_processing/tests/ultra/unit/test_ultra_l1c_pset_bins.py +114 -83
- imap_processing/tests/ultra/unit/test_ultra_l2.py +230 -0
- imap_processing/ultra/constants.py +1 -1
- imap_processing/ultra/l0/decom_tools.py +27 -39
- imap_processing/ultra/l0/decom_ultra.py +168 -204
- imap_processing/ultra/l0/ultra_utils.py +152 -136
- imap_processing/ultra/l1a/ultra_l1a.py +55 -271
- imap_processing/ultra/l1b/badtimes.py +1 -4
- imap_processing/ultra/l1b/cullingmask.py +2 -6
- imap_processing/ultra/l1b/de.py +116 -57
- imap_processing/ultra/l1b/extendedspin.py +20 -18
- imap_processing/ultra/l1b/lookup_utils.py +72 -9
- imap_processing/ultra/l1b/ultra_l1b.py +36 -16
- imap_processing/ultra/l1b/ultra_l1b_culling.py +66 -30
- imap_processing/ultra/l1b/ultra_l1b_extended.py +297 -94
- imap_processing/ultra/l1c/histogram.py +2 -6
- imap_processing/ultra/l1c/spacecraft_pset.py +84 -0
- imap_processing/ultra/l1c/ultra_l1c.py +8 -9
- imap_processing/ultra/l1c/ultra_l1c_pset_bins.py +206 -108
- imap_processing/ultra/l2/ultra_l2.py +299 -0
- imap_processing/ultra/lookup_tables/Angular_Profiles_FM45_LeftSlit.csv +526 -0
- imap_processing/ultra/lookup_tables/Angular_Profiles_FM45_RightSlit.csv +526 -0
- imap_processing/ultra/lookup_tables/Angular_Profiles_FM90_LeftSlit.csv +526 -0
- imap_processing/ultra/lookup_tables/Angular_Profiles_FM90_RightSlit.csv +526 -0
- imap_processing/ultra/lookup_tables/FM45_Startup1_ULTRA_IMGPARAMS_20240719.csv +2 -2
- imap_processing/ultra/lookup_tables/FM90_Startup1_ULTRA_IMGPARAMS_20240719.csv +2 -0
- imap_processing/ultra/packet_definitions/README.md +38 -0
- imap_processing/ultra/packet_definitions/ULTRA_SCI_COMBINED.xml +15302 -482
- imap_processing/ultra/utils/ultra_l1_utils.py +31 -12
- imap_processing/utils.py +69 -29
- {imap_processing-0.11.0.dist-info → imap_processing-0.13.0.dist-info}/METADATA +10 -6
- imap_processing-0.13.0.dist-info/RECORD +578 -0
- imap_processing/cdf/config/imap_mag_l1_variable_attrs.yaml +0 -237
- imap_processing/hi/l1a/housekeeping.py +0 -27
- imap_processing/hi/l1b/hi_eng_unit_convert_table.csv +0 -154
- imap_processing/swe/l1b/swe_esa_lookup_table.csv +0 -1441
- imap_processing/swe/l1b/swe_l1b_science.py +0 -652
- imap_processing/tests/codice/data/imap_codice_l1a_hi-counters-aggregated_20240429_v001.cdf +0 -0
- imap_processing/tests/codice/data/imap_codice_l1a_hi-counters-singles_20240429_v001.cdf +0 -0
- imap_processing/tests/codice/data/imap_codice_l1a_hi-omni_20240429_v001.cdf +0 -0
- imap_processing/tests/codice/data/imap_codice_l1a_hi-sectored_20240429_v001.cdf +0 -0
- imap_processing/tests/codice/data/imap_codice_l1a_hskp_20100101_v001.cdf +0 -0
- imap_processing/tests/codice/data/imap_codice_l1a_lo-counters-aggregated_20240429_v001.cdf +0 -0
- imap_processing/tests/codice/data/imap_codice_l1a_lo-counters-singles_20240429_v001.cdf +0 -0
- imap_processing/tests/codice/data/imap_codice_l1a_lo-nsw-angular_20240429_v001.cdf +0 -0
- imap_processing/tests/codice/data/imap_codice_l1a_lo-nsw-priority_20240429_v001.cdf +0 -0
- imap_processing/tests/codice/data/imap_codice_l1a_lo-nsw-species_20240429_v001.cdf +0 -0
- imap_processing/tests/codice/data/imap_codice_l1a_lo-sw-angular_20240429_v001.cdf +0 -0
- imap_processing/tests/codice/data/imap_codice_l1a_lo-sw-priority_20240429_v001.cdf +0 -0
- imap_processing/tests/codice/data/imap_codice_l1a_lo-sw-species_20240429_v001.cdf +0 -0
- imap_processing/tests/codice/data/imap_codice_l1b_hi-counters-aggregated_20240429_v001.cdf +0 -0
- imap_processing/tests/codice/data/imap_codice_l1b_hi-counters-singles_20240429_v001.cdf +0 -0
- imap_processing/tests/codice/data/imap_codice_l1b_hi-omni_20240429_v001.cdf +0 -0
- imap_processing/tests/codice/data/imap_codice_l1b_hi-sectored_20240429_v001.cdf +0 -0
- imap_processing/tests/codice/data/imap_codice_l1b_hskp_20100101_v001.cdf +0 -0
- imap_processing/tests/codice/data/imap_codice_l1b_lo-counters-aggregated_20240429_v001.cdf +0 -0
- imap_processing/tests/codice/data/imap_codice_l1b_lo-counters-singles_20240429_v001.cdf +0 -0
- imap_processing/tests/codice/data/imap_codice_l1b_lo-nsw-angular_20240429_v001.cdf +0 -0
- imap_processing/tests/codice/data/imap_codice_l1b_lo-nsw-priority_20240429_v001.cdf +0 -0
- imap_processing/tests/codice/data/imap_codice_l1b_lo-nsw-species_20240429_v001.cdf +0 -0
- imap_processing/tests/codice/data/imap_codice_l1b_lo-sw-angular_20240429_v001.cdf +0 -0
- imap_processing/tests/codice/data/imap_codice_l1b_lo-sw-priority_20240429_v001.cdf +0 -0
- imap_processing/tests/codice/data/imap_codice_l1b_lo-sw-species_20240429_v001.cdf +0 -0
- imap_processing/tests/hi/data/l1/imap_hi_l1b_45sensor-de_20250415_v999.cdf +0 -0
- imap_processing/tests/hit/PREFLIGHT_raw_record_2023_256_15_59_04_apid1251.pkts +0 -0
- imap_processing/tests/hit/PREFLIGHT_raw_record_2023_256_15_59_04_apid1252.pkts +0 -0
- imap_processing/tests/hit/validation_data/hskp_sample_eu.csv +0 -89
- imap_processing/tests/hit/validation_data/sci_sample_raw1.csv +0 -29
- imap_processing/tests/idex/test_data/imap_idex_l0_raw_20231214_v001.pkts +0 -0
- imap_processing/tests/lo/test_cdfs/imap_lo_l1a_de_20100101_v001.cdf +0 -0
- imap_processing/tests/lo/test_cdfs/imap_lo_l1a_spin_20100101_v001.cdf +0 -0
- imap_processing/tests/swe/test_swe_l1b_science.py +0 -84
- imap_processing/tests/ultra/test_data/mock_data.py +0 -161
- imap_processing/ultra/l1c/pset.py +0 -40
- imap_processing/ultra/lookup_tables/dps_sensitivity45.cdf +0 -0
- imap_processing-0.11.0.dist-info/RECORD +0 -488
- /imap_processing/idex/packet_definitions/{idex_packet_definition.xml → idex_science_packet_definition.xml} +0 -0
- /imap_processing/tests/ialirt/{test_data → data}/l0/20240827095047_SWE_IALIRT_packet.bin +0 -0
- /imap_processing/tests/ialirt/{test_data → data}/l0/BinLog CCSDS_FRAG_TLM_20240826_152323Z_IALIRT_data_for_SDC.bin +0 -0
- /imap_processing/tests/ialirt/{test_data → data}/l0/IALiRT Raw Packet Telemetry.txt +0 -0
- /imap_processing/tests/ialirt/{test_data → data}/l0/apid01152.tlm +0 -0
- /imap_processing/tests/ialirt/{test_data → data}/l0/eu_SWP_IAL_20240826_152033.csv +0 -0
- /imap_processing/tests/ialirt/{test_data → data}/l0/hi_fsw_view_1_ccsds.bin +0 -0
- /imap_processing/tests/ialirt/{test_data → data}/l0/hit_ialirt_sample.ccsds +0 -0
- /imap_processing/tests/ialirt/{test_data → data}/l0/hit_ialirt_sample.csv +0 -0
- /imap_processing/tests/ialirt/{test_data → data}/l0/idle_export_eu.SWE_IALIRT_20240827_093852.csv +0 -0
- /imap_processing/tests/ialirt/{test_data → data}/l0/imap_codice_l1a_hi-ialirt_20240523200000_v0.0.0.cdf +0 -0
- /imap_processing/tests/ialirt/{test_data → data}/l0/imap_codice_l1a_lo-ialirt_20241110193700_v0.0.0.cdf +0 -0
- /imap_processing/{mag/l1b → tests/spacecraft}/__init__.py +0 -0
- /imap_processing/{swe/l1b/engineering_unit_convert_table.csv → tests/swe/lut/imap_swe_eu-conversion_20240510_v000.csv} +0 -0
- /imap_processing/tests/ultra/{test_data → data}/l0/FM45_40P_Phi28p5_BeamCal_LinearScan_phi28.50_theta-0.00_20240207T102740.CCSDS +0 -0
- /imap_processing/tests/ultra/{test_data → data}/l0/FM45_7P_Phi0.0_BeamCal_LinearScan_phi0.04_theta-0.01_20230821T121304.CCSDS +0 -0
- /imap_processing/tests/ultra/{test_data → data}/l0/FM45_TV_Cycle6_Hot_Ops_Front212_20240124T063837.CCSDS +0 -0
- /imap_processing/tests/ultra/{test_data → data}/l0/Ultra45_EM_SwRI_Cal_Run7_ThetaScan_20220530T225054.CCSDS +0 -0
- /imap_processing/tests/ultra/{test_data → data}/l0/ultra45_raw_sc_auxdata_Ultra45_EM_SwRI_Cal_Run7_ThetaScan_20220530T225054.csv +0 -0
- /imap_processing/tests/ultra/{test_data → data}/l0/ultra45_raw_sc_enaphxtofhangimg_FM45_TV_Cycle6_Hot_Ops_Front212_20240124T063837.csv +0 -0
- /imap_processing/tests/ultra/{test_data → data}/l0/ultra45_raw_sc_ultraimgrates_Ultra45_EM_SwRI_Cal_Run7_ThetaScan_20220530T225054.csv +0 -0
- /imap_processing/tests/ultra/{test_data → data}/l0/ultra45_raw_sc_ultrarawimgevent_FM45_7P_Phi00_BeamCal_LinearScan_phi004_theta-001_20230821T121304.csv +0 -0
- /imap_processing/tests/ultra/{test_data → data}/l1/dps_exposure_helio_45_E1.cdf +0 -0
- /imap_processing/tests/ultra/{test_data → data}/l1/dps_exposure_helio_45_E12.cdf +0 -0
- /imap_processing/tests/ultra/{test_data → data}/l1/dps_exposure_helio_45_E24.cdf +0 -0
- {imap_processing-0.11.0.dist-info → imap_processing-0.13.0.dist-info}/LICENSE +0 -0
- {imap_processing-0.11.0.dist-info → imap_processing-0.13.0.dist-info}/WHEEL +0 -0
- {imap_processing-0.11.0.dist-info → imap_processing-0.13.0.dist-info}/entry_points.txt +0 -0
|
@@ -1,338 +1,131 @@
|
|
|
1
|
-
|
|
1
|
+
"""Test ULTRA L1a CDFs."""
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import numpy as np
|
|
4
|
+
import xarray as xr
|
|
5
|
+
|
|
6
|
+
from imap_processing.cdf.utils import write_cdf
|
|
7
|
+
from imap_processing.ultra.l0.decom_ultra import get_event_id
|
|
6
8
|
from imap_processing.ultra.l0.ultra_utils import (
|
|
7
9
|
ULTRA_AUX,
|
|
8
10
|
ULTRA_EVENTS,
|
|
9
11
|
ULTRA_RATES,
|
|
10
12
|
ULTRA_TOF,
|
|
11
13
|
)
|
|
12
|
-
from imap_processing.ultra.l1a.ultra_l1a import
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
from imap_processing.ultra.l1a.ultra_l1a import (
|
|
15
|
+
ultra_l1a,
|
|
16
|
+
)
|
|
15
17
|
|
|
16
|
-
@pytest.fixture()
|
|
17
|
-
def decom_ultra_aux(ccsds_path_theta_0, xtce_path):
|
|
18
|
-
"""Data for decom_ultra_aux"""
|
|
19
|
-
packets = decom.decom_packets(ccsds_path_theta_0, xtce_path)
|
|
20
|
-
grouped_data = group_by_apid(packets)
|
|
21
18
|
|
|
22
|
-
|
|
23
|
-
grouped_data[ULTRA_AUX.apid[0]], ULTRA_AUX.apid[0]
|
|
24
|
-
)
|
|
25
|
-
return data_packet_list
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
@pytest.mark.parametrize(
|
|
29
|
-
"decom_test_data",
|
|
30
|
-
[
|
|
31
|
-
pytest.param(
|
|
32
|
-
{
|
|
33
|
-
"apid": ULTRA_AUX.apid[0],
|
|
34
|
-
"filename": "FM45_40P_Phi28p5_BeamCal_LinearScan_phi28.50"
|
|
35
|
-
"_theta-0.00_20240207T102740.CCSDS",
|
|
36
|
-
}
|
|
37
|
-
)
|
|
38
|
-
],
|
|
39
|
-
indirect=True,
|
|
40
|
-
)
|
|
41
|
-
@pytest.mark.xfail(reason="Fix CDF attrs")
|
|
42
|
-
def test_xarray_aux(decom_test_data):
|
|
19
|
+
def test_xarray_aux(ccsds_path_theta_0):
|
|
43
20
|
"""This function checks that a xarray was
|
|
44
21
|
successfully created from the decom_ultra_aux data."""
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
#
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
# assert spin_period_valid_list == decom_ultra_aux["SPINPERIODVALID"]
|
|
57
|
-
# assert spin_period_valid_attr == expected_spin_period_valid_attr.output()
|
|
58
|
-
|
|
59
|
-
# # Spot check support data and attributes
|
|
60
|
-
# version_list = dataset.variables["VERSION"].values.tolist()
|
|
61
|
-
# version_attr = dataset.variables["VERSION"].attrs
|
|
62
|
-
# expected_version_attr = dataclasses.replace(
|
|
63
|
-
# ultra_cdf_attrs.ultra_support_attrs,
|
|
64
|
-
# catdesc="version",
|
|
65
|
-
# fieldname="version",
|
|
66
|
-
# label_axis="version",
|
|
67
|
-
# ).output()
|
|
68
|
-
|
|
69
|
-
# assert version_list == decom_ultra_aux["VERSION"]
|
|
70
|
-
# assert version_attr == expected_version_attr
|
|
71
|
-
|
|
72
|
-
# # Spot check metadata data and attributes
|
|
73
|
-
# shcoarse_list = dataset.variables["SHCOARSE"].values.tolist()
|
|
74
|
-
# shcoarse_attr = dataset.variables["SHCOARSE"].attrs
|
|
75
|
-
|
|
76
|
-
# expected_shcoarse_attr = dataclasses.replace(
|
|
77
|
-
# ultra_cdf_attrs.ultra_support_attrs,
|
|
78
|
-
# catdesc="shcoarse",
|
|
79
|
-
# fieldname="shcoarse",
|
|
80
|
-
# label_axis="shcoarse",
|
|
81
|
-
# ).output()
|
|
82
|
-
|
|
83
|
-
# assert shcoarse_list == decom_ultra_aux["SHCOARSE"]
|
|
84
|
-
# assert shcoarse_attr == expected_shcoarse_attr
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
@pytest.mark.parametrize(
|
|
88
|
-
"decom_test_data",
|
|
89
|
-
[
|
|
90
|
-
pytest.param(
|
|
91
|
-
{
|
|
92
|
-
"apid": ULTRA_RATES.apid[0],
|
|
93
|
-
"filename": "FM45_40P_Phi28p5_BeamCal_LinearScan_phi28.50"
|
|
94
|
-
"_theta-0.00_20240207T102740.CCSDS",
|
|
95
|
-
}
|
|
96
|
-
)
|
|
97
|
-
],
|
|
98
|
-
indirect=True,
|
|
99
|
-
)
|
|
100
|
-
@pytest.mark.xfail(reason="Fix CDF attrs")
|
|
101
|
-
def test_xarray_rates(decom_test_data):
|
|
22
|
+
test_data = ultra_l1a(ccsds_path_theta_0, apid_input=ULTRA_AUX.apid[0])
|
|
23
|
+
|
|
24
|
+
# Spot check metadata data and attributes
|
|
25
|
+
specific_epoch_data = test_data[0].sel(epoch=test_data[0].epoch[0])[
|
|
26
|
+
"spinperiodvalid"
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
assert (specific_epoch_data == test_data[0]["spinperiodvalid"][0]).all()
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def test_xarray_rates(ccsds_path_theta_0):
|
|
102
33
|
"""This function checks that a xarray was
|
|
103
34
|
successfully created from the decom_ultra_rates data."""
|
|
104
|
-
|
|
105
|
-
#
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
# ).astype(np.int64)
|
|
112
|
-
# specific_epoch_data = dataset.sel(epoch=j2000_time)["START_RF"]
|
|
113
|
-
# startrf_list = specific_epoch_data.values.tolist()
|
|
114
|
-
# startrf_attr = dataset.variables["START_RF"].attrs
|
|
115
|
-
|
|
116
|
-
# expected_startrf_attr = dataclasses.replace(
|
|
117
|
-
# ultra_cdf_attrs.ultra_support_attrs,
|
|
118
|
-
# catdesc="start_rf",
|
|
119
|
-
# fieldname="start_rf",
|
|
120
|
-
# label_axis="start_rf",
|
|
121
|
-
# ).output()
|
|
122
|
-
|
|
123
|
-
# assert startrf_list == decom_ultra_rates["START_RF"][0]
|
|
124
|
-
# assert startrf_attr == expected_startrf_attr
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
@pytest.mark.parametrize(
|
|
128
|
-
"decom_test_data",
|
|
129
|
-
[
|
|
130
|
-
pytest.param(
|
|
131
|
-
{
|
|
132
|
-
"apid": ULTRA_TOF.apid[0],
|
|
133
|
-
"filename": "FM45_40P_Phi28p5_BeamCal_LinearScan_phi28.50"
|
|
134
|
-
"_theta-0.00_20240207T102740.CCSDS",
|
|
135
|
-
}
|
|
136
|
-
)
|
|
137
|
-
],
|
|
138
|
-
indirect=True,
|
|
139
|
-
)
|
|
140
|
-
@pytest.mark.xfail(reason="Fix CDF attrs")
|
|
141
|
-
def test_xarray_tof(decom_test_data):
|
|
35
|
+
test_data = ultra_l1a(ccsds_path_theta_0, apid_input=ULTRA_RATES.apid[0])
|
|
36
|
+
# Spot check metadata data and attributes
|
|
37
|
+
specific_epoch_data = test_data[0].sel(epoch=test_data[0].epoch[0])["start_rf"]
|
|
38
|
+
assert (specific_epoch_data == test_data[0]["start_rf"][0]).all()
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def test_xarray_tof(ccsds_path_theta_0):
|
|
142
42
|
"""This function checks that a xarray was
|
|
143
43
|
successfully created from the decom_ultra_tof data."""
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
#
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
# expected_packetdata_attr = dataclasses.replace(
|
|
156
|
-
# ultra_cdf_attrs.ultra_support_attrs,
|
|
157
|
-
# catdesc="packetdata",
|
|
158
|
-
# fieldname="packetdata",
|
|
159
|
-
# label_axis="packetdata",
|
|
160
|
-
# depend_1="sid",
|
|
161
|
-
# depend_2="row",
|
|
162
|
-
# depend_3="column",
|
|
163
|
-
# units="pixels",
|
|
164
|
-
# variable_purpose="primary_var",
|
|
165
|
-
# ).output()
|
|
166
|
-
|
|
167
|
-
# assert (specific_epoch_data == decom_ultra_tof["PACKETDATA"][0][0]).all()
|
|
168
|
-
# assert packetdata_attr == expected_packetdata_attr
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
@pytest.mark.parametrize(
|
|
172
|
-
"decom_test_data",
|
|
173
|
-
[
|
|
174
|
-
pytest.param(
|
|
175
|
-
{
|
|
176
|
-
"apid": ULTRA_EVENTS.apid[0],
|
|
177
|
-
"filename": "FM45_40P_Phi28p5_BeamCal_LinearScan_phi28.50"
|
|
178
|
-
"_theta-0.00_20240207T102740.CCSDS",
|
|
179
|
-
},
|
|
180
|
-
)
|
|
181
|
-
],
|
|
182
|
-
indirect=True,
|
|
183
|
-
)
|
|
184
|
-
@pytest.mark.xfail(reason="Fix CDF attrs")
|
|
185
|
-
def test_xarray_events(decom_test_data, decom_ultra_aux, events_test_path):
|
|
44
|
+
test_data = ultra_l1a(ccsds_path_theta_0, apid_input=ULTRA_TOF.apid[0])
|
|
45
|
+
|
|
46
|
+
# Spot check metadata data and attributes
|
|
47
|
+
specific_epoch_data = test_data[0].sel(epoch=test_data[0].epoch[0], sid=0)[
|
|
48
|
+
"packetdata"
|
|
49
|
+
]
|
|
50
|
+
assert (specific_epoch_data == test_data[0]["packetdata"][0][0]).all()
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def test_xarray_events(ccsds_path_theta_0):
|
|
186
54
|
"""This function checks that a xarray was
|
|
187
55
|
successfully created from the decom_ultra_events data."""
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
# expected_cointype_attr = dataclasses.replace(
|
|
206
|
-
# ultra_cdf_attrs.ultra_support_attrs,
|
|
207
|
-
# catdesc="coin_type",
|
|
208
|
-
# fieldname="coin_type",
|
|
209
|
-
# label_axis="coin_type",
|
|
210
|
-
# ).output()
|
|
211
|
-
|
|
212
|
-
# assert cointype_list == decom_ultra_events["COIN_TYPE"][0]
|
|
213
|
-
# assert cointype_attr == expected_cointype_attr
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
def test_cdf_aux(
|
|
217
|
-
ccsds_path_theta_0,
|
|
218
|
-
decom_ultra_aux,
|
|
219
|
-
):
|
|
220
|
-
"""Tests that CDF file is created and contains same attributes as xarray."""
|
|
221
|
-
|
|
222
|
-
test_data = ultra_l1a(
|
|
223
|
-
ccsds_path_theta_0, data_version="001", apid=ULTRA_AUX.apid[0]
|
|
224
|
-
)
|
|
56
|
+
test_data = ultra_l1a(ccsds_path_theta_0, apid_input=ULTRA_EVENTS.apid[0])
|
|
57
|
+
specific_epoch_data = test_data[0].sel(epoch=test_data[0].epoch[0])["coin_type"]
|
|
58
|
+
assert (specific_epoch_data == test_data[0]["coin_type"][0]).all()
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def test_xarray_hk(ccsds_path_theta_0):
|
|
62
|
+
"""This function checks that a xarray was
|
|
63
|
+
successfully created from the decom_ultra_hk data."""
|
|
64
|
+
test_data = ultra_l1a(ccsds_path_theta_0, apid_input=869)
|
|
65
|
+
|
|
66
|
+
assert isinstance(test_data[0], xr.Dataset)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def test_cdf_aux(ccsds_path_theta_0):
|
|
70
|
+
"""Tests that CDF file can be created."""
|
|
71
|
+
|
|
72
|
+
test_data = ultra_l1a(ccsds_path_theta_0, apid_input=ULTRA_AUX.apid[0])
|
|
225
73
|
test_data_path = write_cdf(test_data[0])
|
|
226
74
|
|
|
227
75
|
assert test_data_path.exists()
|
|
228
|
-
assert test_data_path.name == "imap_ultra_l1a_45sensor-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
@pytest.mark.parametrize(
|
|
238
|
-
"decom_test_data",
|
|
239
|
-
[
|
|
240
|
-
pytest.param(
|
|
241
|
-
{
|
|
242
|
-
"apid": ULTRA_RATES.apid[0],
|
|
243
|
-
"filename": "FM45_40P_Phi28p5_BeamCal_LinearScan_phi28.50"
|
|
244
|
-
"_theta-0.00_20240207T102740.CCSDS",
|
|
245
|
-
},
|
|
246
|
-
)
|
|
247
|
-
],
|
|
248
|
-
indirect=True,
|
|
249
|
-
)
|
|
250
|
-
def test_cdf_rates(ccsds_path_theta_0, decom_test_data):
|
|
251
|
-
"""Tests that CDF file is created and contains same attributes as xarray."""
|
|
252
|
-
decom_ultra_rates, _ = decom_test_data
|
|
253
|
-
test_data = ultra_l1a(
|
|
254
|
-
ccsds_path_theta_0, data_version="001", apid=ULTRA_RATES.apid[0]
|
|
255
|
-
)
|
|
256
|
-
# TODO: Dropping duplicates to ignore ISTP for now. Need to update test data
|
|
257
|
-
# or wait for an update to cdflib
|
|
258
|
-
test_data[0] = test_data[0].sortby("epoch").groupby("epoch").first()
|
|
259
|
-
test_data_path = write_cdf(test_data[0])
|
|
76
|
+
assert test_data_path.name == "imap_ultra_l1a_45sensor-aux_20240207_v999.cdf"
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def test_cdf_rates(ccsds_path_theta_0):
|
|
80
|
+
"""Tests that CDF file can be created."""
|
|
81
|
+
test_data = ultra_l1a(ccsds_path_theta_0, apid_input=ULTRA_RATES.apid[0])
|
|
82
|
+
test_data_path = write_cdf(test_data[0], istp=False)
|
|
260
83
|
|
|
261
84
|
assert test_data_path.exists()
|
|
262
|
-
assert test_data_path.name == "imap_ultra_l1a_45sensor-
|
|
85
|
+
assert test_data_path.name == "imap_ultra_l1a_45sensor-rates_20240207_v999.cdf"
|
|
263
86
|
|
|
264
|
-
dataset_rates = create_dataset({ULTRA_RATES.apid[0]: decom_ultra_rates})
|
|
265
|
-
input_xarray_rates = load_cdf(test_data_path)
|
|
266
87
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
88
|
+
def test_cdf_tof(ccsds_path_theta_0):
|
|
89
|
+
"""Tests that CDF file can be created."""
|
|
90
|
+
test_data = ultra_l1a(ccsds_path_theta_0, apid_input=ULTRA_TOF.apid[0])
|
|
91
|
+
test_data_path = write_cdf(test_data[0])
|
|
92
|
+
assert test_data_path.exists()
|
|
93
|
+
assert (
|
|
94
|
+
test_data_path.name
|
|
95
|
+
== "imap_ultra_l1a_45sensor-histogram-ena-phxtof-hi-ang_20240207_v999.cdf"
|
|
270
96
|
)
|
|
271
97
|
|
|
272
98
|
|
|
273
|
-
|
|
274
|
-
"
|
|
275
|
-
[
|
|
276
|
-
|
|
277
|
-
{
|
|
278
|
-
"apid": ULTRA_TOF.apid[0],
|
|
279
|
-
"filename": "FM45_40P_Phi28p5_BeamCal_LinearScan_phi28.50"
|
|
280
|
-
"_theta-0.00_20240207T102740.CCSDS",
|
|
281
|
-
},
|
|
282
|
-
)
|
|
283
|
-
],
|
|
284
|
-
indirect=True,
|
|
285
|
-
)
|
|
286
|
-
def test_cdf_tof(ccsds_path_theta_0, decom_test_data):
|
|
287
|
-
"""Tests that CDF file is created and contains same attributes as xarray."""
|
|
288
|
-
decom_ultra_tof, _ = decom_test_data
|
|
289
|
-
test_data = ultra_l1a(
|
|
290
|
-
ccsds_path_theta_0, data_version="001", apid=ULTRA_TOF.apid[0]
|
|
291
|
-
)
|
|
292
|
-
test_data_path = write_cdf(test_data[0])
|
|
99
|
+
def test_cdf_events(ccsds_path_theta_0):
|
|
100
|
+
"""Tests that CDF file can be created."""
|
|
101
|
+
test_data = ultra_l1a(ccsds_path_theta_0, apid_input=ULTRA_EVENTS.apid[0])
|
|
102
|
+
test_data_path = write_cdf(test_data[0], istp=False)
|
|
293
103
|
|
|
294
104
|
assert test_data_path.exists()
|
|
295
|
-
assert test_data_path.name == "imap_ultra_l1a_45sensor-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
"decom_test_data",
|
|
305
|
-
[
|
|
306
|
-
pytest.param(
|
|
307
|
-
{
|
|
308
|
-
"apid": ULTRA_EVENTS.apid[0],
|
|
309
|
-
"filename": "FM45_40P_Phi28p5_BeamCal_LinearScan_phi28.50"
|
|
310
|
-
"_theta-0.00_20240207T102740.CCSDS",
|
|
311
|
-
},
|
|
312
|
-
)
|
|
313
|
-
],
|
|
314
|
-
indirect=True,
|
|
315
|
-
)
|
|
316
|
-
def test_cdf_events(ccsds_path_theta_0, decom_ultra_aux, decom_test_data):
|
|
317
|
-
"""Tests that CDF file is created and contains same attributes as xarray."""
|
|
318
|
-
decom_ultra_events, _ = decom_test_data
|
|
319
|
-
test_data = ultra_l1a(
|
|
320
|
-
ccsds_path_theta_0, data_version="001", apid=ULTRA_EVENTS.apid[0]
|
|
321
|
-
)
|
|
322
|
-
# TODO: Dropping duplicates to ignore ISTP for now. Need to update test data
|
|
323
|
-
# or wait for an update to cdflib
|
|
324
|
-
test_data[0] = test_data[0].sortby("epoch").groupby("epoch").first()
|
|
325
|
-
test_data_path = write_cdf(test_data[0])
|
|
105
|
+
assert test_data_path.name == "imap_ultra_l1a_45sensor-de_20240207_v999.cdf"
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def test_cdf_hk(ccsds_path_theta_0):
|
|
109
|
+
"""Tests that CDF file can be created."""
|
|
110
|
+
test_data = ultra_l1a(ccsds_path_theta_0, apid_input=869)
|
|
111
|
+
data = test_data[0]
|
|
112
|
+
data.attrs["Data_version"] = "v999"
|
|
113
|
+
test_data_path = write_cdf(data, istp=True)
|
|
326
114
|
|
|
327
115
|
assert test_data_path.exists()
|
|
328
|
-
assert test_data_path.name == "imap_ultra_l1a_45sensor-
|
|
116
|
+
assert test_data_path.name == "imap_ultra_l1a_45sensor-status_20240207_v999.cdf"
|
|
329
117
|
|
|
330
|
-
dataset_events = create_dataset(
|
|
331
|
-
{ULTRA_EVENTS.apid[0]: decom_ultra_events, ULTRA_AUX.apid[0]: decom_ultra_aux}
|
|
332
|
-
)
|
|
333
|
-
input_xarray_events = load_cdf(test_data_path)
|
|
334
118
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
)
|
|
119
|
+
def test_get_event_id():
|
|
120
|
+
"""Test get_event_id"""
|
|
121
|
+
data = np.array([445015662, 445015663, 445015664, 445015664])
|
|
122
|
+
decom_events = get_event_id(data)
|
|
123
|
+
counters_for_met = []
|
|
124
|
+
for i in range(len(decom_events)):
|
|
125
|
+
event_id = decom_events[i]
|
|
126
|
+
met_extracted = event_id >> np.int64(31)
|
|
127
|
+
|
|
128
|
+
assert met_extracted == np.int64(data[i])
|
|
129
|
+
counters_for_met.append(event_id & np.int64(0x7FFFFFFF))
|
|
130
|
+
|
|
131
|
+
assert counters_for_met == [0, 0, 0, 1]
|
|
@@ -2,11 +2,12 @@ import numpy as np
|
|
|
2
2
|
import pytest
|
|
3
3
|
import xarray as xr
|
|
4
4
|
|
|
5
|
+
from imap_processing.cdf.utils import write_cdf
|
|
5
6
|
from imap_processing.ultra.l1b.ultra_l1b import ultra_l1b
|
|
6
7
|
from imap_processing.ultra.utils.ultra_l1_utils import create_dataset
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
@pytest.fixture
|
|
10
|
+
@pytest.fixture
|
|
10
11
|
def mock_data_l1a_rates_dict():
|
|
11
12
|
# Create sample data for the xarray Dataset
|
|
12
13
|
epoch = np.arange(
|
|
@@ -29,7 +30,7 @@ def mock_data_l1a_rates_dict():
|
|
|
29
30
|
return data_dict
|
|
30
31
|
|
|
31
32
|
|
|
32
|
-
@pytest.fixture
|
|
33
|
+
@pytest.fixture
|
|
33
34
|
def mock_data_l1b_de_dict():
|
|
34
35
|
epoch = np.array(
|
|
35
36
|
[760591786368000000, 760591787368000000, 760591788368000000],
|
|
@@ -39,8 +40,12 @@ def mock_data_l1b_de_dict():
|
|
|
39
40
|
return data_dict
|
|
40
41
|
|
|
41
42
|
|
|
42
|
-
@pytest.fixture
|
|
43
|
+
@pytest.fixture
|
|
43
44
|
def mock_data_l1b_extendedspin_dict():
|
|
45
|
+
epoch = np.array(
|
|
46
|
+
[760591786368000000, 760591787368000000, 760591788368000000],
|
|
47
|
+
dtype="datetime64[ns]",
|
|
48
|
+
)
|
|
44
49
|
spin = np.array(
|
|
45
50
|
[0, 1, 2],
|
|
46
51
|
dtype="uint32",
|
|
@@ -49,10 +54,13 @@ def mock_data_l1b_extendedspin_dict():
|
|
|
49
54
|
[0, 1],
|
|
50
55
|
dtype="int32",
|
|
51
56
|
)
|
|
57
|
+
spin_start_time = np.array([0, 1, 2], dtype="uint64")
|
|
52
58
|
quality = np.zeros((2, 3), dtype="uint16")
|
|
53
59
|
data_dict = {
|
|
60
|
+
"epoch": epoch,
|
|
54
61
|
"spin_number": spin,
|
|
55
62
|
"energy_bin_geometric_mean": energy,
|
|
63
|
+
"spin_start_time": spin_start_time,
|
|
56
64
|
"quality_ena_rates": quality,
|
|
57
65
|
}
|
|
58
66
|
return data_dict
|
|
@@ -64,7 +72,6 @@ def test_create_extendedspin_dataset(mock_data_l1b_extendedspin_dict):
|
|
|
64
72
|
mock_data_l1b_extendedspin_dict,
|
|
65
73
|
"imap_ultra_l1b_45sensor-extendedspin",
|
|
66
74
|
"l1b",
|
|
67
|
-
"001",
|
|
68
75
|
)
|
|
69
76
|
|
|
70
77
|
assert "spin_number" in dataset.coords
|
|
@@ -79,9 +86,7 @@ def test_create_extendedspin_dataset(mock_data_l1b_extendedspin_dict):
|
|
|
79
86
|
|
|
80
87
|
def test_create_de_dataset(mock_data_l1b_de_dict):
|
|
81
88
|
"""Tests that dataset is created as expected."""
|
|
82
|
-
dataset = create_dataset(
|
|
83
|
-
mock_data_l1b_de_dict, "imap_ultra_l1b_45sensor-de", "l1b", "001"
|
|
84
|
-
)
|
|
89
|
+
dataset = create_dataset(mock_data_l1b_de_dict, "imap_ultra_l1b_45sensor-de", "l1b")
|
|
85
90
|
|
|
86
91
|
assert "epoch" in dataset.coords
|
|
87
92
|
assert dataset.coords["epoch"].dtype == "datetime64[ns]"
|
|
@@ -90,25 +95,66 @@ def test_create_de_dataset(mock_data_l1b_de_dict):
|
|
|
90
95
|
np.testing.assert_array_equal(dataset["x_front"], np.zeros(3))
|
|
91
96
|
|
|
92
97
|
|
|
93
|
-
def test_ultra_l1b(
|
|
98
|
+
def test_ultra_l1b(l1b_de_dataset):
|
|
99
|
+
"""Tests that L1b data is created."""
|
|
100
|
+
|
|
101
|
+
assert len(l1b_de_dataset) == 1
|
|
102
|
+
|
|
103
|
+
assert (
|
|
104
|
+
l1b_de_dataset[0].attrs["Logical_source_description"]
|
|
105
|
+
== "IMAP-Ultra Instrument Level-1B Direct Event Data."
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def test_cdf_de(l1b_de_dataset):
|
|
110
|
+
"""Tests that CDF file is created and contains same attributes as xarray."""
|
|
111
|
+
test_data_path = write_cdf(l1b_de_dataset[0], istp=True)
|
|
112
|
+
assert test_data_path.exists()
|
|
113
|
+
assert test_data_path.name == "imap_ultra_l1b_45sensor-de_20240207_v999.cdf"
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def test_ultra_l1b_extendedspin(l1b_extendedspin_dataset):
|
|
94
117
|
"""Tests that L1b data is created."""
|
|
95
118
|
|
|
96
|
-
assert len(
|
|
119
|
+
assert len(l1b_extendedspin_dataset) == 3
|
|
97
120
|
|
|
98
121
|
# Define the suffixes and prefix
|
|
99
122
|
prefix = "imap_ultra_l1b_45sensor"
|
|
100
|
-
suffixes = ["
|
|
123
|
+
suffixes = ["extendedspin", "cullingmask", "badtimes"]
|
|
101
124
|
|
|
102
125
|
for i in range(len(suffixes)):
|
|
103
126
|
expected_logical_source = f"{prefix}-{suffixes[i]}"
|
|
104
|
-
assert
|
|
127
|
+
assert (
|
|
128
|
+
l1b_extendedspin_dataset[i].attrs["Logical_source"]
|
|
129
|
+
== expected_logical_source
|
|
130
|
+
)
|
|
131
|
+
|
|
105
132
|
|
|
133
|
+
def test_cdf_extendedspin(l1b_extendedspin_dataset):
|
|
134
|
+
"""Tests that CDF file is created and contains same attributes as xarray."""
|
|
135
|
+
test_data_path = write_cdf(l1b_extendedspin_dataset[0], istp=True)
|
|
136
|
+
assert test_data_path.exists()
|
|
106
137
|
assert (
|
|
107
|
-
|
|
108
|
-
== "IMAP-Ultra Instrument Level-1B Direct Event Data."
|
|
138
|
+
test_data_path.name == "imap_ultra_l1b_45sensor-extendedspin_20240207_v999.cdf"
|
|
109
139
|
)
|
|
110
140
|
|
|
111
141
|
|
|
142
|
+
def test_cdf_cullingmask(l1b_extendedspin_dataset):
|
|
143
|
+
"""Tests that CDF file is created and contains same attributes as xarray."""
|
|
144
|
+
test_data_path = write_cdf(l1b_extendedspin_dataset[1], istp=True)
|
|
145
|
+
assert test_data_path.exists()
|
|
146
|
+
assert (
|
|
147
|
+
test_data_path.name == "imap_ultra_l1b_45sensor-cullingmask_20240207_v999.cdf"
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
def test_cdf_badtimes(l1b_extendedspin_dataset):
|
|
152
|
+
"""Tests that CDF file is created and contains same attributes as xarray."""
|
|
153
|
+
test_data_path = write_cdf(l1b_extendedspin_dataset[2], istp=True)
|
|
154
|
+
assert test_data_path.exists()
|
|
155
|
+
assert test_data_path.name == "imap_ultra_l1b_45sensor-badtimes_20240207_v999.cdf"
|
|
156
|
+
|
|
157
|
+
|
|
112
158
|
def test_ultra_l1b_error(mock_data_l1a_rates_dict):
|
|
113
159
|
"""Tests that L1a data throws an error."""
|
|
114
160
|
mock_data_l1a_rates_dict["bad_key"] = mock_data_l1a_rates_dict.pop(
|
|
@@ -117,4 +163,4 @@ def test_ultra_l1b_error(mock_data_l1a_rates_dict):
|
|
|
117
163
|
with pytest.raises(
|
|
118
164
|
ValueError, match="Data dictionary does not contain the expected keys."
|
|
119
165
|
):
|
|
120
|
-
ultra_l1b(mock_data_l1a_rates_dict
|
|
166
|
+
ultra_l1b(mock_data_l1a_rates_dict)
|
|
@@ -10,7 +10,7 @@ from imap_processing.ultra.l1b.ultra_l1b_annotated import (
|
|
|
10
10
|
)
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
@pytest.fixture
|
|
13
|
+
@pytest.fixture
|
|
14
14
|
def kernels(spice_test_data_path):
|
|
15
15
|
"""List SPICE kernels."""
|
|
16
16
|
required_kernels = [
|
|
@@ -28,7 +28,7 @@ def kernels(spice_test_data_path):
|
|
|
28
28
|
return kernels
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
@pytest.mark.external_kernel
|
|
31
|
+
@pytest.mark.external_kernel
|
|
32
32
|
def test_get_particle_velocity(spice_test_data_path, kernels):
|
|
33
33
|
"""Tests get_particle_velocity function."""
|
|
34
34
|
spiceypy.furnsh(kernels)
|