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
|
@@ -6,7 +6,7 @@ import re
|
|
|
6
6
|
import time
|
|
7
7
|
from contextlib import contextmanager
|
|
8
8
|
from pathlib import Path
|
|
9
|
-
from typing import Optional
|
|
9
|
+
from typing import Optional, Union
|
|
10
10
|
|
|
11
11
|
import cdflib
|
|
12
12
|
import imap_data_access
|
|
@@ -17,7 +17,7 @@ import requests
|
|
|
17
17
|
import spiceypy
|
|
18
18
|
|
|
19
19
|
from imap_processing import imap_module_directory
|
|
20
|
-
from imap_processing.spice.time import met_to_ttj2000ns
|
|
20
|
+
from imap_processing.spice.time import TTJ2000_EPOCH, met_to_ttj2000ns
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
@pytest.fixture(autouse=True)
|
|
@@ -55,7 +55,8 @@ def _download_external_kernels(spice_test_data_path):
|
|
|
55
55
|
kernel_urls = [
|
|
56
56
|
"https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets/de440s.bsp",
|
|
57
57
|
"https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/pck00011.tpc",
|
|
58
|
-
"https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/
|
|
58
|
+
"https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/"
|
|
59
|
+
"earth_1962_240827_2124_combined.bpc",
|
|
59
60
|
]
|
|
60
61
|
|
|
61
62
|
for kernel_url in kernel_urls:
|
|
@@ -92,7 +93,11 @@ def _download_external_kernels(spice_test_data_path):
|
|
|
92
93
|
|
|
93
94
|
|
|
94
95
|
@pytest.fixture(scope="session")
|
|
95
|
-
def _download_test_data(
|
|
96
|
+
def _download_test_data():
|
|
97
|
+
_download_external_data(_test_data_paths())
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def _download_external_data(test_data_path_list):
|
|
96
101
|
"""This fixture downloads externally-located test data files into a specific
|
|
97
102
|
location. The list of files and their storage locations are specified in
|
|
98
103
|
the `test_data_paths` parameter, which is a list of tuples; the zeroth
|
|
@@ -101,8 +106,9 @@ def _download_test_data(test_data_paths):
|
|
|
101
106
|
|
|
102
107
|
logger = logging.getLogger(__name__)
|
|
103
108
|
|
|
104
|
-
|
|
105
|
-
|
|
109
|
+
api_path = "https://api.dev.imap-mission.com/download/test_data/"
|
|
110
|
+
for test_data_path in test_data_path_list:
|
|
111
|
+
source = api_path + test_data_path[0]
|
|
106
112
|
destination = test_data_path[1]
|
|
107
113
|
|
|
108
114
|
# Download the test data if necessary and write it to the appropriate
|
|
@@ -119,13 +125,16 @@ def _download_test_data(test_data_paths):
|
|
|
119
125
|
logger.info(f"File already exists: {destination}")
|
|
120
126
|
|
|
121
127
|
|
|
122
|
-
|
|
123
|
-
def test_data_paths():
|
|
128
|
+
def _test_data_paths():
|
|
124
129
|
"""Defines a list of test data files to download from the AWS S3 bucket
|
|
125
130
|
and the corresponding location in which to store the downloaded file"""
|
|
126
131
|
test_data_path_list = [
|
|
127
132
|
(
|
|
128
|
-
"
|
|
133
|
+
"apid_478.bin",
|
|
134
|
+
imap_module_directory / "tests" / "ialirt" / "data" / "l0" / "apid_478.bin",
|
|
135
|
+
),
|
|
136
|
+
(
|
|
137
|
+
"imap_codice_l0_raw_20241110_v001.pkts",
|
|
129
138
|
imap_module_directory
|
|
130
139
|
/ "tests"
|
|
131
140
|
/ "codice"
|
|
@@ -133,11 +142,95 @@ def test_data_paths():
|
|
|
133
142
|
/ "imap_codice_l0_raw_20241110_v001.pkts",
|
|
134
143
|
),
|
|
135
144
|
(
|
|
136
|
-
"
|
|
145
|
+
"imap_hi_l1a_45sensor-de_20250415_v999.cdf",
|
|
146
|
+
imap_module_directory
|
|
147
|
+
/ "tests"
|
|
148
|
+
/ "hi"
|
|
149
|
+
/ "data"
|
|
150
|
+
/ "l1"
|
|
151
|
+
/ "imap_hi_l1a_45sensor-de_20250415_v999.cdf",
|
|
152
|
+
),
|
|
153
|
+
(
|
|
154
|
+
"imap_hi_l1b_45sensor-de_20250415_v999.cdf",
|
|
155
|
+
imap_module_directory
|
|
156
|
+
/ "tests"
|
|
157
|
+
/ "hi"
|
|
158
|
+
/ "data"
|
|
159
|
+
/ "l1"
|
|
160
|
+
/ "imap_hi_l1b_45sensor-de_20250415_v999.cdf",
|
|
161
|
+
),
|
|
162
|
+
(
|
|
163
|
+
"imap_hi_l1c_45sensor-pset_20250415_v999.cdf",
|
|
164
|
+
imap_module_directory
|
|
165
|
+
/ "tests"
|
|
166
|
+
/ "hi"
|
|
167
|
+
/ "data"
|
|
168
|
+
/ "l1"
|
|
169
|
+
/ "imap_hi_l1c_45sensor-pset_20250415_v999.cdf",
|
|
170
|
+
),
|
|
171
|
+
(
|
|
172
|
+
"idex_l1a_validation_file.h5",
|
|
173
|
+
imap_module_directory
|
|
174
|
+
/ "tests"
|
|
175
|
+
/ "idex"
|
|
176
|
+
/ "test_data"
|
|
177
|
+
/ "idex_l1a_validation_file.h5",
|
|
178
|
+
),
|
|
179
|
+
(
|
|
180
|
+
"idex_l1b_validation_file.h5",
|
|
181
|
+
imap_module_directory
|
|
182
|
+
/ "tests"
|
|
183
|
+
/ "idex"
|
|
184
|
+
/ "test_data"
|
|
185
|
+
/ "idex_l1b_validation_file.h5",
|
|
186
|
+
),
|
|
187
|
+
(
|
|
188
|
+
"ultra-90_raw_event_data_shortened.csv",
|
|
189
|
+
imap_module_directory
|
|
190
|
+
/ "tests"
|
|
191
|
+
/ "ultra"
|
|
192
|
+
/ "data"
|
|
193
|
+
/ "l1"
|
|
194
|
+
/ "ultra-90_raw_event_data_shortened.csv",
|
|
195
|
+
),
|
|
196
|
+
(
|
|
197
|
+
"Ultra_90_DPS_efficiencies_all.csv",
|
|
198
|
+
imap_module_directory
|
|
199
|
+
/ "tests"
|
|
200
|
+
/ "ultra"
|
|
201
|
+
/ "data"
|
|
202
|
+
/ "l1"
|
|
203
|
+
/ "Ultra_90_DPS_efficiencies_all.csv",
|
|
204
|
+
),
|
|
205
|
+
(
|
|
206
|
+
"ultra_90_dps_gf.csv",
|
|
207
|
+
imap_module_directory
|
|
208
|
+
/ "tests"
|
|
209
|
+
/ "ultra"
|
|
210
|
+
/ "data"
|
|
211
|
+
/ "l1"
|
|
212
|
+
/ "ultra_90_dps_gf.csv",
|
|
213
|
+
),
|
|
214
|
+
(
|
|
215
|
+
"ultra_90_dps_exposure.csv",
|
|
216
|
+
imap_module_directory
|
|
217
|
+
/ "tests"
|
|
218
|
+
/ "ultra"
|
|
219
|
+
/ "data"
|
|
220
|
+
/ "l1"
|
|
221
|
+
/ "ultra_90_dps_exposure.csv",
|
|
222
|
+
),
|
|
223
|
+
(
|
|
224
|
+
"Ultra_efficiencies_45_combined_logistic_interpolation.csv",
|
|
137
225
|
imap_module_directory
|
|
138
|
-
/ "tests
|
|
226
|
+
/ "tests"
|
|
227
|
+
/ "ultra"
|
|
228
|
+
/ "data"
|
|
229
|
+
/ "l1"
|
|
230
|
+
/ "Ultra_efficiencies_45_combined_logistic_interpolation.csv",
|
|
139
231
|
),
|
|
140
232
|
]
|
|
233
|
+
|
|
141
234
|
return test_data_path_list
|
|
142
235
|
|
|
143
236
|
|
|
@@ -159,7 +252,8 @@ def pytest_collection_modifyitems(items):
|
|
|
159
252
|
-----
|
|
160
253
|
See the following link for details about this function, also known as a
|
|
161
254
|
pytest hook:
|
|
162
|
-
https://docs.pytest.org/en/stable/reference/reference.html#
|
|
255
|
+
https://docs.pytest.org/en/stable/reference/reference.html#
|
|
256
|
+
pytest.hookspec.pytest_collection_modifyitems
|
|
163
257
|
"""
|
|
164
258
|
markers_to_fixtures = {
|
|
165
259
|
"external_kernel": "_download_external_kernels",
|
|
@@ -178,7 +272,7 @@ def spice_test_data_path(imap_tests_path):
|
|
|
178
272
|
return imap_tests_path / "spice/test_data"
|
|
179
273
|
|
|
180
274
|
|
|
181
|
-
@pytest.fixture
|
|
275
|
+
@pytest.fixture
|
|
182
276
|
def furnish_time_kernels(spice_test_data_path):
|
|
183
277
|
"""Furnishes (temporarily) the testing LSK and SCLK"""
|
|
184
278
|
spiceypy.kclear()
|
|
@@ -190,7 +284,7 @@ def furnish_time_kernels(spice_test_data_path):
|
|
|
190
284
|
spiceypy.kclear()
|
|
191
285
|
|
|
192
286
|
|
|
193
|
-
@pytest.fixture
|
|
287
|
+
@pytest.fixture
|
|
194
288
|
def furnish_sclk(spice_test_data_path):
|
|
195
289
|
"""Furnishes (temporarily) the SCLK for JPSS stored in the package data directory"""
|
|
196
290
|
test_sclk = spice_test_data_path / "imap_sclk_0000.tsc"
|
|
@@ -199,7 +293,7 @@ def furnish_sclk(spice_test_data_path):
|
|
|
199
293
|
spiceypy.kclear()
|
|
200
294
|
|
|
201
295
|
|
|
202
|
-
@pytest.fixture
|
|
296
|
+
@pytest.fixture
|
|
203
297
|
def furnish_kernels(spice_test_data_path):
|
|
204
298
|
"""Return a function that will furnish an arbitrary list of kernels."""
|
|
205
299
|
|
|
@@ -301,7 +395,7 @@ def session_test_metakernel(monkeypatch_session, tmpdir_factory, spice_test_data
|
|
|
301
395
|
spiceypy.kclear()
|
|
302
396
|
|
|
303
397
|
|
|
304
|
-
@pytest.fixture
|
|
398
|
+
@pytest.fixture
|
|
305
399
|
def use_test_metakernel(
|
|
306
400
|
request, monkeypatch, spice_test_data_path, session_test_metakernel
|
|
307
401
|
):
|
|
@@ -351,14 +445,14 @@ def use_test_metakernel(
|
|
|
351
445
|
spiceypy.kclear()
|
|
352
446
|
|
|
353
447
|
|
|
354
|
-
@pytest.fixture
|
|
448
|
+
@pytest.fixture
|
|
355
449
|
def _unset_metakernel_path(monkeypatch):
|
|
356
450
|
"""Temporarily unsets the SPICE_METAKERNEL environment variable"""
|
|
357
451
|
if os.getenv("SPICE_METAKERNEL", None) is not None:
|
|
358
452
|
monkeypatch.delenv("SPICE_METAKERNEL")
|
|
359
453
|
|
|
360
454
|
|
|
361
|
-
@pytest.fixture
|
|
455
|
+
@pytest.fixture
|
|
362
456
|
def use_test_spin_data_csv(monkeypatch):
|
|
363
457
|
"""Sets the SPIN_DATA_FILEPATH environment variable to input path."""
|
|
364
458
|
|
|
@@ -368,7 +462,7 @@ def use_test_spin_data_csv(monkeypatch):
|
|
|
368
462
|
return wrapped_set_spin_data_filepath
|
|
369
463
|
|
|
370
464
|
|
|
371
|
-
@pytest.fixture
|
|
465
|
+
@pytest.fixture
|
|
372
466
|
def use_fake_spin_data_for_time(
|
|
373
467
|
request, use_test_spin_data_csv, tmpdir, generate_spin_data
|
|
374
468
|
):
|
|
@@ -405,7 +499,7 @@ def use_fake_spin_data_for_time(
|
|
|
405
499
|
return wrapped_set_spin_data_filepath
|
|
406
500
|
|
|
407
501
|
|
|
408
|
-
@pytest.fixture
|
|
502
|
+
@pytest.fixture
|
|
409
503
|
def generate_spin_data():
|
|
410
504
|
def make_data(start_met: float, end_met: Optional[float] = None) -> pd.DataFrame:
|
|
411
505
|
"""
|
|
@@ -413,8 +507,9 @@ def generate_spin_data():
|
|
|
413
507
|
Spin table contains the following fields:
|
|
414
508
|
(
|
|
415
509
|
spin_number,
|
|
416
|
-
|
|
417
|
-
|
|
510
|
+
spin_start_sec_sclk,
|
|
511
|
+
spin_start_subsec_sclk,
|
|
512
|
+
spin_start_utc,
|
|
418
513
|
spin_period_sec,
|
|
419
514
|
spin_period_valid,
|
|
420
515
|
spin_phase_valid,
|
|
@@ -442,18 +537,25 @@ def generate_spin_data():
|
|
|
442
537
|
end_met = start_met + 86400
|
|
443
538
|
|
|
444
539
|
# Create spin start second data of 15 seconds increment
|
|
445
|
-
|
|
446
|
-
|
|
540
|
+
spin_start_met = np.arange(start_met, end_met + 1, 15)
|
|
541
|
+
spin_start_sec = np.floor(spin_start_met).astype(int)
|
|
542
|
+
spin_start_subsec = int((start_met - spin_start_sec[0]) * 1e6)
|
|
543
|
+
|
|
544
|
+
# Calculate UTC times without spice (accepting ~5 second inaccuracy)
|
|
545
|
+
spin_start_dt64 = TTJ2000_EPOCH + (spin_start_met * 1e9).astype(
|
|
546
|
+
"timedelta64[ns]"
|
|
547
|
+
)
|
|
447
548
|
|
|
448
549
|
nspins = len(spin_start_sec)
|
|
449
550
|
|
|
450
551
|
spin_df = pd.DataFrame.from_dict(
|
|
451
552
|
{
|
|
452
553
|
"spin_number": np.arange(nspins, dtype=np.uint32),
|
|
453
|
-
"
|
|
454
|
-
"
|
|
554
|
+
"spin_start_sec_sclk": spin_start_sec,
|
|
555
|
+
"spin_start_subsec_sclk": np.full(
|
|
455
556
|
nspins, spin_start_subsec, dtype=np.uint32
|
|
456
557
|
),
|
|
558
|
+
"spin_start_utc": np.datetime_as_string(spin_start_dt64, unit="us"),
|
|
457
559
|
"spin_period_sec": np.full(nspins, 15.0, dtype=np.float32),
|
|
458
560
|
"spin_period_valid": np.ones(nspins, dtype=np.uint8),
|
|
459
561
|
"spin_phase_valid": np.ones(nspins, dtype=np.uint8),
|
|
@@ -463,7 +565,7 @@ def generate_spin_data():
|
|
|
463
565
|
)
|
|
464
566
|
|
|
465
567
|
# Convert spin_start_sec to datetime to set repointing times flags
|
|
466
|
-
spin_start_dates = met_to_ttj2000ns(spin_start_sec + spin_start_subsec /
|
|
568
|
+
spin_start_dates = met_to_ttj2000ns(spin_start_sec + spin_start_subsec / 1e6)
|
|
467
569
|
spin_start_dates = cdflib.cdfepoch.to_datetime(spin_start_dates)
|
|
468
570
|
|
|
469
571
|
# Convert DatetimeIndex to Series for using .dt accessor
|
|
@@ -485,3 +587,113 @@ def generate_spin_data():
|
|
|
485
587
|
return spin_df
|
|
486
588
|
|
|
487
589
|
return make_data
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
@pytest.fixture
|
|
593
|
+
def use_test_repoint_data_csv(monkeypatch):
|
|
594
|
+
"""Sets the REPOINT_DATA_FILEPATH environment variable to input path."""
|
|
595
|
+
|
|
596
|
+
def wrapped_set_repoint_data_filepath(path: Path):
|
|
597
|
+
monkeypatch.setenv("REPOINT_DATA_FILEPATH", str(path))
|
|
598
|
+
|
|
599
|
+
return wrapped_set_repoint_data_filepath
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
def generate_repoint_data(
|
|
603
|
+
repoint_start_met: Union[float, np.ndarray],
|
|
604
|
+
repoint_end_met: Optional[Union[float, np.ndarray]] = None,
|
|
605
|
+
repoint_id_start: Optional[int] = 0,
|
|
606
|
+
) -> pd.DataFrame:
|
|
607
|
+
"""
|
|
608
|
+
Generate a repoint dataframe for the star/end times provided.
|
|
609
|
+
|
|
610
|
+
Parameters
|
|
611
|
+
----------
|
|
612
|
+
repoint_start_met : float, np.ndarray
|
|
613
|
+
Provides the repoint start time(s) in Mission Elapsed Time (MET).
|
|
614
|
+
repoint_end_met : float, np.ndarray, optional
|
|
615
|
+
Provides the repoint end time(s) in MET. If not provided, end times
|
|
616
|
+
will be 15 minutes after start times.
|
|
617
|
+
repoint_id_start : int, optional
|
|
618
|
+
Provides the starting repoint id number of the first repoint in the
|
|
619
|
+
generated data.
|
|
620
|
+
|
|
621
|
+
Returns
|
|
622
|
+
-------
|
|
623
|
+
repoint_df : pd.DataFrame
|
|
624
|
+
Repoint dataframe with start and end repoint times provided and incrementing
|
|
625
|
+
repoint_ids starting at 1.
|
|
626
|
+
"""
|
|
627
|
+
repoint_start_times = np.array(repoint_start_met)
|
|
628
|
+
if repoint_end_met is None:
|
|
629
|
+
repoint_end_met = repoint_start_times + 15 * 60
|
|
630
|
+
# Calculate UTC times without spice (accepting ~5 second inaccuracy)
|
|
631
|
+
repoint_start_dt64 = TTJ2000_EPOCH + (repoint_start_times * 1e9).astype(
|
|
632
|
+
"timedelta64[ns]"
|
|
633
|
+
)
|
|
634
|
+
repoint_end_dt64 = TTJ2000_EPOCH + (repoint_end_met * 1e9).astype("timedelta64[ns]")
|
|
635
|
+
repoint_df = pd.DataFrame.from_dict(
|
|
636
|
+
{
|
|
637
|
+
"repoint_start_sec_sclk": repoint_start_times.astype(int),
|
|
638
|
+
"repoint_start_subsec_sclk": ((repoint_start_times % 1.0) * 1e6).astype(
|
|
639
|
+
int
|
|
640
|
+
),
|
|
641
|
+
"repoint_start_utc": np.datetime_as_string(repoint_start_dt64, unit="us"),
|
|
642
|
+
"repoint_end_sec_sclk": repoint_end_met.astype(int),
|
|
643
|
+
"repoint_end_subsec_sclk": ((repoint_end_met % 1.0) * 1e6).astype(int),
|
|
644
|
+
"repoint_end_utc": np.datetime_as_string(repoint_end_dt64, unit="us"),
|
|
645
|
+
"repoint_id": np.arange(repoint_start_times.size, dtype=int)
|
|
646
|
+
+ repoint_id_start,
|
|
647
|
+
}
|
|
648
|
+
)
|
|
649
|
+
return repoint_df
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
@pytest.fixture
|
|
653
|
+
def use_fake_repoint_data_for_time(use_test_repoint_data_csv, tmpdir):
|
|
654
|
+
"""
|
|
655
|
+
Generate and use fake spin data for testing.
|
|
656
|
+
|
|
657
|
+
Returns
|
|
658
|
+
-------
|
|
659
|
+
callable
|
|
660
|
+
Returns a callable function that takes start_met and optionally n_repoints
|
|
661
|
+
as inputs, generates fake repoint data, writes the data to a csv file,
|
|
662
|
+
and sets the REPOINT_DATA_FILEPATH environment variable to point to the
|
|
663
|
+
fake repoint data file.
|
|
664
|
+
"""
|
|
665
|
+
|
|
666
|
+
def wrapped_repoint_data_filepath(
|
|
667
|
+
repoint_start_met: Union[float, np.ndarray],
|
|
668
|
+
repoint_end_met: Optional[Union[float, np.ndarray]] = None,
|
|
669
|
+
repoint_id_start: Optional[int] = 0,
|
|
670
|
+
) -> pd.DataFrame:
|
|
671
|
+
"""
|
|
672
|
+
Generate and use fake repoint data for testing.
|
|
673
|
+
Parameters
|
|
674
|
+
----------
|
|
675
|
+
repoint_start_met : float, np.ndarray
|
|
676
|
+
Provides the repoint start time(s) in Mission Elapsed Time (MET).
|
|
677
|
+
repoint_end_met : float, np.ndarray
|
|
678
|
+
Provides the repoint end time(s) in MET. If not provided, end times
|
|
679
|
+
will be 15 minutes after start times.
|
|
680
|
+
repoint_id_start : int, optional
|
|
681
|
+
Provides the starting repoint id number of the first repoint in the
|
|
682
|
+
generated data.
|
|
683
|
+
"""
|
|
684
|
+
repoint_df = generate_repoint_data(
|
|
685
|
+
repoint_start_met,
|
|
686
|
+
repoint_end_met=repoint_end_met,
|
|
687
|
+
repoint_id_start=repoint_id_start,
|
|
688
|
+
)
|
|
689
|
+
repoint_csv_file_path = tmpdir / "repoint_data.repointing.csv"
|
|
690
|
+
repoint_df.to_csv(repoint_csv_file_path, index=False)
|
|
691
|
+
use_test_repoint_data_csv(repoint_csv_file_path)
|
|
692
|
+
|
|
693
|
+
return wrapped_repoint_data_filepath
|
|
694
|
+
|
|
695
|
+
|
|
696
|
+
if __name__ == "__main__":
|
|
697
|
+
# This is to enable downloading files easier by letting us
|
|
698
|
+
# run this file directly
|
|
699
|
+
_download_external_data(_test_data_paths())
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""Shared fixtures for ENA maps tests."""
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
import pytest
|
|
5
|
+
|
|
6
|
+
from imap_processing.tests.ultra.data.mock_data import (
|
|
7
|
+
mock_l1c_pset_product_healpix,
|
|
8
|
+
mock_l1c_pset_product_rectangular,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@pytest.fixture(scope="module")
|
|
13
|
+
def ultra_l1c_pset_datasets():
|
|
14
|
+
"""Make fake L1C Ultra PSET products on a HEALPix tiling for testing"""
|
|
15
|
+
l1c_nside = 64
|
|
16
|
+
return {
|
|
17
|
+
"nside": l1c_nside,
|
|
18
|
+
"products": [
|
|
19
|
+
mock_l1c_pset_product_healpix(
|
|
20
|
+
nside=l1c_nside,
|
|
21
|
+
stripe_center_lat=mid_latitude,
|
|
22
|
+
width_scale=5,
|
|
23
|
+
counts_scaling_params=(50, 0.5),
|
|
24
|
+
peak_exposure=1000,
|
|
25
|
+
timestr=f"2025-09-{i + 1:02d}T12:00:00",
|
|
26
|
+
head="90",
|
|
27
|
+
)
|
|
28
|
+
for i, mid_latitude in enumerate(np.arange(-90, 90, 22.5))
|
|
29
|
+
],
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@pytest.fixture(scope="session")
|
|
34
|
+
def rectangular_l1c_pset_datasets():
|
|
35
|
+
"""Make fake L1C Ultra PSET products on a rectangular tiling for testing"""
|
|
36
|
+
l1c_spacing_deg = 1
|
|
37
|
+
return {
|
|
38
|
+
"spacing": l1c_spacing_deg,
|
|
39
|
+
"products": [
|
|
40
|
+
mock_l1c_pset_product_rectangular(
|
|
41
|
+
spacing_deg=l1c_spacing_deg,
|
|
42
|
+
stripe_center_lat=mid_latitude,
|
|
43
|
+
width_scale=5,
|
|
44
|
+
counts_scaling_params=(50, 0.5),
|
|
45
|
+
peak_exposure=1000,
|
|
46
|
+
timestr=f"2025-09-{i + 1:02d}T12:00:00",
|
|
47
|
+
head="90",
|
|
48
|
+
)
|
|
49
|
+
for i, mid_latitude in enumerate(np.arange(-90, 90, 22.5))
|
|
50
|
+
],
|
|
51
|
+
}
|