imap-processing 0.11.0__py3-none-any.whl → 0.12.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 +10 -11
- imap_processing/_version.py +2 -2
- imap_processing/ccsds/excel_to_xtce.py +65 -16
- imap_processing/cdf/config/imap_codice_global_cdf_attrs.yaml +6 -28
- imap_processing/cdf/config/imap_codice_l1a_variable_attrs.yaml +365 -42
- 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 +26 -13
- 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 +6 -9
- imap_processing/cdf/config/imap_idex_l1a_variable_attrs.yaml +1 -1
- 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 +9 -21
- 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_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 +48 -52
- imap_processing/cdf/config/imap_swe_l2_variable_attrs.yaml +71 -47
- imap_processing/cdf/config/imap_ultra_global_cdf_attrs.yaml +2 -14
- imap_processing/cdf/config/imap_ultra_l1b_variable_attrs.yaml +51 -2
- imap_processing/cdf/config/imap_ultra_l1c_variable_attrs.yaml +29 -14
- imap_processing/cdf/utils.py +13 -7
- imap_processing/cli.py +23 -8
- imap_processing/codice/codice_l1a.py +207 -85
- imap_processing/codice/constants.py +1322 -568
- imap_processing/codice/decompress.py +2 -6
- imap_processing/ena_maps/ena_maps.py +480 -116
- 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 +45 -47
- imap_processing/hi/l1a/hi_l1a.py +24 -18
- 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 +31 -39
- imap_processing/hi/l1c/hi_l1c.py +405 -17
- imap_processing/hi/utils.py +58 -12
- 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 +173 -1
- imap_processing/hit/l0/constants.py +20 -11
- imap_processing/hit/l0/decom_hit.py +18 -4
- imap_processing/hit/l1a/hit_l1a.py +45 -54
- imap_processing/hit/l1b/constants.py +317 -0
- imap_processing/hit/l1b/hit_l1b.py +367 -18
- imap_processing/hit/l2/constants.py +281 -0
- imap_processing/hit/l2/hit_l2.py +614 -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 +246 -0
- imap_processing/ialirt/l0/process_swe.py +252 -0
- imap_processing/ialirt/packet_definitions/ialirt.xml +7 -3
- imap_processing/ialirt/packet_definitions/ialirt_mag.xml +115 -0
- 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 +25 -0
- imap_processing/idex/idex_l1a.py +6 -7
- imap_processing/idex/idex_l1b.py +4 -31
- imap_processing/idex/idex_l2a.py +789 -0
- imap_processing/idex/idex_variable_unpacking_and_eu_conversion.csv +39 -33
- imap_processing/lo/l0/lo_science.py +6 -0
- imap_processing/lo/l1a/lo_l1a.py +0 -1
- imap_processing/lo/l1b/lo_l1b.py +177 -25
- imap_processing/mag/constants.py +8 -0
- imap_processing/mag/imap_mag_sdc-configuration_v001.yaml +6 -0
- imap_processing/mag/l0/decom_mag.py +10 -3
- imap_processing/mag/l1a/mag_l1a.py +22 -11
- imap_processing/mag/l1a/mag_l1a_data.py +28 -3
- imap_processing/mag/l1b/mag_l1b.py +190 -48
- imap_processing/mag/l1c/interpolation_methods.py +211 -0
- imap_processing/mag/l1c/mag_l1c.py +447 -9
- imap_processing/quality_flags.py +1 -0
- imap_processing/spacecraft/packet_definitions/scid_x252.xml +538 -0
- imap_processing/spacecraft/quaternions.py +123 -0
- imap_processing/spice/geometry.py +16 -19
- imap_processing/spice/repoint.py +120 -0
- imap_processing/swapi/l1/swapi_l1.py +4 -0
- imap_processing/swapi/l2/swapi_l2.py +0 -1
- imap_processing/swe/l1a/swe_l1a.py +47 -8
- imap_processing/swe/l1a/swe_science.py +5 -2
- imap_processing/swe/l1b/swe_l1b_science.py +103 -56
- imap_processing/swe/l2/swe_l2.py +60 -65
- imap_processing/swe/packet_definitions/swe_packet_definition.xml +1121 -1
- imap_processing/swe/utils/swe_constants.py +63 -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 +23 -20
- imap_processing/tests/cdf/test_data/imap_instrument2_global_cdf_attrs.yaml +0 -2
- imap_processing/tests/codice/conftest.py +1 -1
- 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 +110 -46
- imap_processing/tests/codice/test_decompress.py +4 -4
- imap_processing/tests/conftest.py +166 -10
- imap_processing/tests/ena_maps/conftest.py +51 -0
- imap_processing/tests/ena_maps/test_ena_maps.py +638 -109
- imap_processing/tests/ena_maps/test_map_utils.py +66 -43
- imap_processing/tests/ena_maps/test_spatial_utils.py +16 -20
- 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 +12 -15
- imap_processing/tests/hi/test_hi_l1c.py +234 -6
- imap_processing/tests/hi/test_l1a.py +30 -0
- imap_processing/tests/hi/test_science_direct_event.py +1 -1
- imap_processing/tests/hi/test_utils.py +24 -2
- imap_processing/tests/hit/helpers/l1_validation.py +39 -39
- 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 +4 -0
- imap_processing/tests/hit/test_hit_l1a.py +24 -28
- imap_processing/tests/hit/test_hit_l1b.py +304 -40
- imap_processing/tests/hit/test_hit_l2.py +454 -0
- imap_processing/tests/hit/test_hit_utils.py +112 -2
- 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/ialirt/test_data/l0/461971383-404.bin +0 -0
- imap_processing/tests/ialirt/test_data/l0/461971384-405.bin +0 -0
- imap_processing/tests/ialirt/test_data/l0/461971385-406.bin +0 -0
- imap_processing/tests/ialirt/test_data/l0/461971386-407.bin +0 -0
- imap_processing/tests/ialirt/test_data/l0/461971387-408.bin +0 -0
- imap_processing/tests/ialirt/test_data/l0/461971388-409.bin +0 -0
- imap_processing/tests/ialirt/test_data/l0/461971389-410.bin +0 -0
- imap_processing/tests/ialirt/test_data/l0/461971390-411.bin +0 -0
- imap_processing/tests/ialirt/test_data/l0/461971391-412.bin +0 -0
- imap_processing/tests/ialirt/test_data/l0/sample_decoded_i-alirt_data.csv +383 -0
- imap_processing/tests/ialirt/unit/test_grouping.py +81 -0
- imap_processing/tests/ialirt/unit/test_parse_mag.py +168 -0
- imap_processing/tests/ialirt/unit/test_process_swe.py +208 -3
- imap_processing/tests/ialirt/unit/test_time.py +16 -0
- imap_processing/tests/idex/conftest.py +62 -6
- imap_processing/tests/idex/test_data/imap_idex_l0_raw_20231218_v001.pkts +0 -0
- imap_processing/tests/idex/test_data/impact_14_tof_high_data.txt +4508 -4508
- imap_processing/tests/idex/test_idex_l1a.py +48 -4
- imap_processing/tests/idex/test_idex_l1b.py +3 -3
- imap_processing/tests/idex/test_idex_l2a.py +383 -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_l1b.py +148 -4
- imap_processing/tests/lo/test_lo_science.py +1 -0
- imap_processing/tests/mag/conftest.py +69 -0
- imap_processing/tests/mag/test_mag_decom.py +1 -1
- imap_processing/tests/mag/test_mag_l1a.py +38 -0
- imap_processing/tests/mag/test_mag_l1b.py +34 -53
- imap_processing/tests/mag/test_mag_l1c.py +251 -20
- imap_processing/tests/mag/test_mag_validation.py +109 -25
- 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/imap_calibration_mag_20240229_v01.cdf +0 -0
- imap_processing/tests/spacecraft/__init__.py +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_geometry.py +6 -9
- imap_processing/tests/spice/test_repoint.py +111 -0
- imap_processing/tests/swapi/test_swapi_l1.py +7 -3
- 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/test_swe_l1a.py +18 -0
- 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_l1b_science.py +23 -4
- imap_processing/tests/swe/test_swe_l2.py +112 -30
- imap_processing/tests/test_cli.py +2 -2
- imap_processing/tests/test_utils.py +138 -16
- 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 +341 -0
- imap_processing/tests/ultra/unit/conftest.py +69 -26
- imap_processing/tests/ultra/unit/test_badtimes.py +2 -0
- imap_processing/tests/ultra/unit/test_cullingmask.py +4 -0
- imap_processing/tests/ultra/unit/test_de.py +12 -4
- imap_processing/tests/ultra/unit/test_decom_apid_881.py +44 -0
- imap_processing/tests/ultra/unit/test_spacecraft_pset.py +78 -0
- imap_processing/tests/ultra/unit/test_ultra_l1a.py +28 -12
- imap_processing/tests/ultra/unit/test_ultra_l1b.py +34 -6
- imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py +22 -26
- imap_processing/tests/ultra/unit/test_ultra_l1b_extended.py +86 -51
- imap_processing/tests/ultra/unit/test_ultra_l1c_pset_bins.py +94 -52
- imap_processing/ultra/l0/decom_tools.py +6 -5
- imap_processing/ultra/l1a/ultra_l1a.py +28 -56
- imap_processing/ultra/l1b/de.py +72 -28
- imap_processing/ultra/l1b/extendedspin.py +12 -14
- imap_processing/ultra/l1b/ultra_l1b.py +34 -9
- imap_processing/ultra/l1b/ultra_l1b_culling.py +65 -29
- imap_processing/ultra/l1b/ultra_l1b_extended.py +64 -19
- imap_processing/ultra/l1c/spacecraft_pset.py +86 -0
- imap_processing/ultra/l1c/ultra_l1c.py +7 -4
- imap_processing/ultra/l1c/ultra_l1c_pset_bins.py +112 -61
- imap_processing/ultra/lookup_tables/ultra_90_dps_exposure_compressed.cdf +0 -0
- imap_processing/ultra/utils/ultra_l1_utils.py +20 -2
- imap_processing/utils.py +68 -28
- {imap_processing-0.11.0.dist-info → imap_processing-0.12.0.dist-info}/METADATA +8 -5
- {imap_processing-0.11.0.dist-info → imap_processing-0.12.0.dist-info}/RECORD +250 -199
- imap_processing/cdf/config/imap_mag_l1_variable_attrs.yaml +0 -237
- imap_processing/hi/l1a/housekeeping.py +0 -27
- 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/ultra/test_data/mock_data.py +0 -161
- imap_processing/ultra/l1c/pset.py +0 -40
- /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.12.0.dist-info}/LICENSE +0 -0
- {imap_processing-0.11.0.dist-info → imap_processing-0.12.0.dist-info}/WHEEL +0 -0
- {imap_processing-0.11.0.dist-info → imap_processing-0.12.0.dist-info}/entry_points.txt +0 -0
|
@@ -13,11 +13,11 @@ lzma_bytes = lzma.compress((234).to_bytes(1, byteorder="big"))
|
|
|
13
13
|
# LZMA_EXAMPLE = "".join(format(byte, "08b") for byte in lzma_bytes)
|
|
14
14
|
TEST_DATA = [
|
|
15
15
|
(b"\xea", CoDICECompression.NO_COMPRESSION, [234]),
|
|
16
|
-
(b"\xea", CoDICECompression.LOSSY_A, [
|
|
17
|
-
(b"\xea", CoDICECompression.LOSSY_B, [
|
|
16
|
+
(b"\xea", CoDICECompression.LOSSY_A, [221183]),
|
|
17
|
+
(b"\xea", CoDICECompression.LOSSY_B, [1441791]),
|
|
18
18
|
(lzma_bytes, CoDICECompression.LOSSLESS, [234]),
|
|
19
|
-
(lzma_bytes, CoDICECompression.LOSSY_A_LOSSLESS, [
|
|
20
|
-
(lzma_bytes, CoDICECompression.LOSSY_B_LOSSLESS, [
|
|
19
|
+
(lzma_bytes, CoDICECompression.LOSSY_A_LOSSLESS, [221183]),
|
|
20
|
+
(lzma_bytes, CoDICECompression.LOSSY_B_LOSSLESS, [1441791]),
|
|
21
21
|
]
|
|
22
22
|
|
|
23
23
|
|
|
@@ -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
|
|
@@ -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,12 @@ def _download_test_data(test_data_paths):
|
|
|
119
125
|
logger.info(f"File already exists: {destination}")
|
|
120
126
|
|
|
121
127
|
|
|
122
|
-
@pytest.fixture(scope="session")
|
|
123
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
|
+
"imap_codice_l0_raw_20241110_v001.pkts",
|
|
129
134
|
imap_module_directory
|
|
130
135
|
/ "tests"
|
|
131
136
|
/ "codice"
|
|
@@ -133,9 +138,66 @@ def test_data_paths():
|
|
|
133
138
|
/ "imap_codice_l0_raw_20241110_v001.pkts",
|
|
134
139
|
),
|
|
135
140
|
(
|
|
136
|
-
"
|
|
141
|
+
"imap_hi_l1a_45sensor-de_20250415_v999.cdf",
|
|
142
|
+
imap_module_directory
|
|
143
|
+
/ "tests"
|
|
144
|
+
/ "hi"
|
|
145
|
+
/ "data"
|
|
146
|
+
/ "l1"
|
|
147
|
+
/ "imap_hi_l1a_45sensor-de_20250415_v999.cdf",
|
|
148
|
+
),
|
|
149
|
+
(
|
|
150
|
+
"imap_hi_l1b_45sensor-de_20250415_v999.cdf",
|
|
151
|
+
imap_module_directory
|
|
152
|
+
/ "tests"
|
|
153
|
+
/ "hi"
|
|
154
|
+
/ "data"
|
|
155
|
+
/ "l1"
|
|
156
|
+
/ "imap_hi_l1b_45sensor-de_20250415_v999.cdf",
|
|
157
|
+
),
|
|
158
|
+
(
|
|
159
|
+
"idex_l1a_validation_file.h5",
|
|
160
|
+
imap_module_directory
|
|
161
|
+
/ "tests"
|
|
162
|
+
/ "idex"
|
|
163
|
+
/ "test_data"
|
|
164
|
+
/ "idex_l1a_validation_file.h5",
|
|
165
|
+
),
|
|
166
|
+
(
|
|
167
|
+
"ultra-90_raw_event_data_shortened.csv",
|
|
137
168
|
imap_module_directory
|
|
138
|
-
/ "tests
|
|
169
|
+
/ "tests"
|
|
170
|
+
/ "ultra"
|
|
171
|
+
/ "data"
|
|
172
|
+
/ "l1"
|
|
173
|
+
/ "ultra-90_raw_event_data_shortened.csv",
|
|
174
|
+
),
|
|
175
|
+
(
|
|
176
|
+
"Ultra_90_DPS_efficiencies_all.csv",
|
|
177
|
+
imap_module_directory
|
|
178
|
+
/ "tests"
|
|
179
|
+
/ "ultra"
|
|
180
|
+
/ "data"
|
|
181
|
+
/ "l1"
|
|
182
|
+
/ "Ultra_90_DPS_efficiencies_all.csv",
|
|
183
|
+
),
|
|
184
|
+
(
|
|
185
|
+
"ultra_90_dps_gf.csv",
|
|
186
|
+
imap_module_directory
|
|
187
|
+
/ "tests"
|
|
188
|
+
/ "ultra"
|
|
189
|
+
/ "data"
|
|
190
|
+
/ "l1"
|
|
191
|
+
/ "ultra_90_dps_gf.csv",
|
|
192
|
+
),
|
|
193
|
+
(
|
|
194
|
+
"ultra_90_dps_exposure.csv",
|
|
195
|
+
imap_module_directory
|
|
196
|
+
/ "tests"
|
|
197
|
+
/ "ultra"
|
|
198
|
+
/ "data"
|
|
199
|
+
/ "l1"
|
|
200
|
+
/ "ultra_90_dps_exposure.csv",
|
|
139
201
|
),
|
|
140
202
|
]
|
|
141
203
|
return test_data_path_list
|
|
@@ -159,7 +221,8 @@ def pytest_collection_modifyitems(items):
|
|
|
159
221
|
-----
|
|
160
222
|
See the following link for details about this function, also known as a
|
|
161
223
|
pytest hook:
|
|
162
|
-
https://docs.pytest.org/en/stable/reference/reference.html#
|
|
224
|
+
https://docs.pytest.org/en/stable/reference/reference.html#
|
|
225
|
+
pytest.hookspec.pytest_collection_modifyitems
|
|
163
226
|
"""
|
|
164
227
|
markers_to_fixtures = {
|
|
165
228
|
"external_kernel": "_download_external_kernels",
|
|
@@ -485,3 +548,96 @@ def generate_spin_data():
|
|
|
485
548
|
return spin_df
|
|
486
549
|
|
|
487
550
|
return make_data
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
@pytest.fixture()
|
|
554
|
+
def use_test_repoint_data_csv(monkeypatch):
|
|
555
|
+
"""Sets the REPOINT_DATA_FILEPATH environment variable to input path."""
|
|
556
|
+
|
|
557
|
+
def wrapped_set_repoint_data_filepath(path: Path):
|
|
558
|
+
monkeypatch.setenv("REPOINT_DATA_FILEPATH", str(path))
|
|
559
|
+
|
|
560
|
+
return wrapped_set_repoint_data_filepath
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
def generate_repoint_data(
|
|
564
|
+
repoint_start_met: Union[float, np.ndarray],
|
|
565
|
+
repoint_end_met: Optional[Union[float, np.ndarray]] = None,
|
|
566
|
+
repoint_id_start: Optional[int] = 0,
|
|
567
|
+
) -> pd.DataFrame:
|
|
568
|
+
"""
|
|
569
|
+
Generate a repoint dataframe for the star/end times provided.
|
|
570
|
+
|
|
571
|
+
Parameters
|
|
572
|
+
----------
|
|
573
|
+
repoint_start_met : float, np.ndarray
|
|
574
|
+
Provides the repoint start time(s) in Mission Elapsed Time (MET).
|
|
575
|
+
repoint_end_met : float, np.ndarray, optional
|
|
576
|
+
Provides the repoint end time(s) in MET. If not provided, end times
|
|
577
|
+
will be 15 minutes after start times.
|
|
578
|
+
repoint_id_start : int, optional
|
|
579
|
+
Provides the starting repoint id number of the first repoint in the
|
|
580
|
+
generated data.
|
|
581
|
+
|
|
582
|
+
Returns
|
|
583
|
+
-------
|
|
584
|
+
repoint_df : pd.DataFrame
|
|
585
|
+
Repoint dataframe with start and end repoint times provided and incrementing
|
|
586
|
+
repoint_ids starting at 1.
|
|
587
|
+
"""
|
|
588
|
+
repoint_start_times = np.array(repoint_start_met)
|
|
589
|
+
if repoint_end_met is None:
|
|
590
|
+
repoint_end_met = repoint_start_times + 15 * 60
|
|
591
|
+
repoint_df = pd.DataFrame.from_dict(
|
|
592
|
+
{
|
|
593
|
+
"repoint_start_time": repoint_start_times,
|
|
594
|
+
"repoint_end_time": np.array(repoint_end_met),
|
|
595
|
+
"repoint_id": np.arange(repoint_start_times.size, dtype=int)
|
|
596
|
+
+ repoint_id_start,
|
|
597
|
+
}
|
|
598
|
+
)
|
|
599
|
+
return repoint_df
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
@pytest.fixture()
|
|
603
|
+
def use_fake_repoint_data_for_time(use_test_repoint_data_csv, tmpdir):
|
|
604
|
+
"""
|
|
605
|
+
Generate and use fake spin data for testing.
|
|
606
|
+
|
|
607
|
+
Returns
|
|
608
|
+
-------
|
|
609
|
+
callable
|
|
610
|
+
Returns a callable function that takes start_met and optionally n_repoints
|
|
611
|
+
as inputs, generates fake repoint data, writes the data to a csv file,
|
|
612
|
+
and sets the REPOINT_DATA_FILEPATH environment variable to point to the
|
|
613
|
+
fake repoint data file.
|
|
614
|
+
"""
|
|
615
|
+
|
|
616
|
+
def wrapped_repoint_data_filepath(
|
|
617
|
+
repoint_start_met: Union[float, np.ndarray],
|
|
618
|
+
repoint_end_met: Optional[Union[float, np.ndarray]] = None,
|
|
619
|
+
repoint_id_start: Optional[int] = 0,
|
|
620
|
+
) -> pd.DataFrame:
|
|
621
|
+
"""
|
|
622
|
+
Generate and use fake repoint data for testing.
|
|
623
|
+
Parameters
|
|
624
|
+
----------
|
|
625
|
+
repoint_start_met : float, np.ndarray
|
|
626
|
+
Provides the repoint start time(s) in Mission Elapsed Time (MET).
|
|
627
|
+
repoint_end_met : float, np.ndarray
|
|
628
|
+
Provides the repoint end time(s) in MET. If not provided, end times
|
|
629
|
+
will be 15 minutes after start times.
|
|
630
|
+
repoint_id_start : int, optional
|
|
631
|
+
Provides the starting repoint id number of the first repoint in the
|
|
632
|
+
generated data.
|
|
633
|
+
"""
|
|
634
|
+
repoint_df = generate_repoint_data(
|
|
635
|
+
repoint_start_met,
|
|
636
|
+
repoint_end_met=repoint_end_met,
|
|
637
|
+
repoint_id_start=repoint_id_start,
|
|
638
|
+
)
|
|
639
|
+
repoint_csv_file_path = tmpdir / "repoint_data.repointing.csv"
|
|
640
|
+
repoint_df.to_csv(repoint_csv_file_path, index=False)
|
|
641
|
+
use_test_repoint_data_csv(repoint_csv_file_path)
|
|
642
|
+
|
|
643
|
+
return wrapped_repoint_data_filepath
|
|
@@ -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
|
+
}
|