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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""MAG L1B Processing."""
|
|
2
2
|
|
|
3
|
+
import logging
|
|
3
4
|
from pathlib import Path
|
|
4
5
|
|
|
5
6
|
import numpy as np
|
|
@@ -9,8 +10,12 @@ from xarray import Dataset
|
|
|
9
10
|
from imap_processing.cdf.imap_cdf_manager import ImapCdfAttributes
|
|
10
11
|
from imap_processing.cdf.utils import load_cdf
|
|
11
12
|
|
|
13
|
+
logger = logging.getLogger(__name__)
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
|
|
16
|
+
def mag_l1b(
|
|
17
|
+
input_dataset: xr.Dataset, version: str, calibration_dataset: xr.Dataset = None
|
|
18
|
+
) -> Dataset:
|
|
14
19
|
"""
|
|
15
20
|
Will process MAG L1B data from L1A data.
|
|
16
21
|
|
|
@@ -20,6 +25,10 @@ def mag_l1b(input_dataset: xr.Dataset, version: str) -> Dataset:
|
|
|
20
25
|
The input dataset to process.
|
|
21
26
|
version : str
|
|
22
27
|
The version of the output data.
|
|
28
|
+
calibration_dataset : xr.Dataset
|
|
29
|
+
The calibration dataset containing calibration matrices and timeshift values for
|
|
30
|
+
mago and magi.
|
|
31
|
+
When None, this defaults to the test calibration file.
|
|
23
32
|
|
|
24
33
|
Returns
|
|
25
34
|
-------
|
|
@@ -28,62 +37,85 @@ def mag_l1b(input_dataset: xr.Dataset, version: str) -> Dataset:
|
|
|
28
37
|
"""
|
|
29
38
|
# TODO:
|
|
30
39
|
# Read in calibration file
|
|
31
|
-
|
|
32
|
-
|
|
40
|
+
|
|
41
|
+
# TODO: This should definitely be loaded from AWS
|
|
42
|
+
if calibration_dataset is None:
|
|
43
|
+
calibration_dataset = load_cdf(
|
|
44
|
+
Path(__file__).parent / "imap_calibration_mag_20240229_v01.cdf"
|
|
45
|
+
)
|
|
46
|
+
logger.info("Using default test calibration file.")
|
|
47
|
+
|
|
48
|
+
source = input_dataset.attrs["Logical_source"]
|
|
49
|
+
if isinstance(source, list):
|
|
50
|
+
source = source[0]
|
|
51
|
+
|
|
52
|
+
if "raw" in source:
|
|
33
53
|
# Raw files should not be processed in L1B.
|
|
34
54
|
raise ValueError("Raw L1A file passed into L1B. Unable to process.")
|
|
35
55
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
# Variable attributes can remain the same as L1A
|
|
42
|
-
input_logical_source = input_dataset.attrs["Logical_source"]
|
|
43
|
-
if isinstance(input_dataset.attrs["Logical_source"], list):
|
|
44
|
-
input_logical_source = input_dataset.attrs["Logical_source"][0]
|
|
56
|
+
mag_attributes = ImapCdfAttributes()
|
|
57
|
+
mag_attributes.add_instrument_global_attrs("mag")
|
|
58
|
+
mag_attributes.add_instrument_variable_attrs("mag", "l1b")
|
|
59
|
+
mag_attributes.add_global_attribute("Data_version", version)
|
|
60
|
+
source = source.replace("l1a", "l1b")
|
|
45
61
|
|
|
46
|
-
|
|
47
|
-
|
|
62
|
+
output_dataset = mag_l1b_processing(
|
|
63
|
+
input_dataset, calibration_dataset, mag_attributes, source
|
|
64
|
+
)
|
|
48
65
|
|
|
49
66
|
return output_dataset
|
|
50
67
|
|
|
51
68
|
|
|
52
|
-
def mag_l1b_processing(
|
|
69
|
+
def mag_l1b_processing(
|
|
70
|
+
input_dataset: xr.Dataset,
|
|
71
|
+
calibration_dataset: xr.Dataset,
|
|
72
|
+
mag_attributes: ImapCdfAttributes,
|
|
73
|
+
logical_source: str,
|
|
74
|
+
) -> xr.Dataset:
|
|
53
75
|
"""
|
|
54
76
|
Will process MAG L1B data from L1A data.
|
|
55
77
|
|
|
56
78
|
MAG L1B is almost identical to L1A, with only the vectors and attributes getting
|
|
57
79
|
updated. All non-vector variables are the same.
|
|
58
80
|
|
|
81
|
+
This step rescales the vector data according to the compression width, and then
|
|
82
|
+
multiplies the vector according to the calibration matrix for a given range. It
|
|
83
|
+
also shifts the timestamps by the values defined in calibration_dataset.
|
|
84
|
+
|
|
59
85
|
Parameters
|
|
60
86
|
----------
|
|
61
87
|
input_dataset : xr.Dataset
|
|
62
88
|
The input dataset to process.
|
|
89
|
+
calibration_dataset : xr.Dataset
|
|
90
|
+
The calibration dataset containing calibration matrices and timeshift values for
|
|
91
|
+
mago and magi.
|
|
92
|
+
mag_attributes : ImapCdfAttributes
|
|
93
|
+
Attribute class for output CDF containing MAG L1B attributes.
|
|
94
|
+
logical_source : str
|
|
95
|
+
The expected logical source of the output file. Should look something like:
|
|
96
|
+
imap_mag_l1b_norm-magi.
|
|
63
97
|
|
|
64
98
|
Returns
|
|
65
99
|
-------
|
|
66
100
|
output_dataset : xr.Dataset
|
|
67
101
|
L1b dataset.
|
|
68
102
|
"""
|
|
69
|
-
# TODO: There is a time alignment step that will add a lot of complexity.
|
|
70
|
-
# This needs to be done once we have some SPICE time data.
|
|
71
|
-
|
|
72
|
-
mag_attributes = ImapCdfAttributes()
|
|
73
|
-
mag_attributes.add_instrument_variable_attrs("mag", "l1")
|
|
74
|
-
|
|
75
103
|
dims = [["direction"], ["compression"]]
|
|
76
104
|
new_dims = [["direction"], ["compression"]]
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
Path(__file__).parent / "imap_calibration_mag_20240229_v01.cdf"
|
|
80
|
-
)
|
|
81
|
-
# TODO: add time shift
|
|
82
|
-
# TODO: Check validity of time range for calibration
|
|
83
|
-
if "mago" in input_dataset.attrs["Logical_source"][0]:
|
|
105
|
+
|
|
106
|
+
if "mago" in logical_source:
|
|
84
107
|
calibration_matrix = calibration_dataset["MFOTOURFO"]
|
|
85
|
-
|
|
108
|
+
time_shift = calibration_dataset["OTS"]
|
|
109
|
+
elif "magi" in logical_source:
|
|
86
110
|
calibration_matrix = calibration_dataset["MFITOURFI"]
|
|
111
|
+
time_shift = calibration_dataset["ITS"]
|
|
112
|
+
else:
|
|
113
|
+
raise ValueError(
|
|
114
|
+
f"Calibration matrix not found, invalid logical source "
|
|
115
|
+
f"{input_dataset.attrs['Logical_source']}"
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
# TODO: Check validity of time range for calibration
|
|
87
119
|
|
|
88
120
|
l1b_fields = xr.apply_ufunc(
|
|
89
121
|
update_vector,
|
|
@@ -96,23 +128,85 @@ def mag_l1b_processing(input_dataset: xr.Dataset) -> xr.Dataset:
|
|
|
96
128
|
kwargs={"calibration_matrix": calibration_matrix},
|
|
97
129
|
)
|
|
98
130
|
|
|
99
|
-
|
|
100
|
-
|
|
131
|
+
epoch_time = shift_time(input_dataset["epoch"], time_shift)
|
|
132
|
+
epoch_time.attrs = mag_attributes.get_variable_attributes("epoch")
|
|
101
133
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
"
|
|
134
|
+
direction = xr.DataArray(
|
|
135
|
+
np.arange(4),
|
|
136
|
+
name="direction",
|
|
137
|
+
dims=["direction"],
|
|
138
|
+
attrs=mag_attributes.get_variable_attributes(
|
|
139
|
+
"direction_attrs", check_schema=False
|
|
140
|
+
),
|
|
105
141
|
)
|
|
106
|
-
|
|
107
|
-
|
|
142
|
+
|
|
143
|
+
compression = xr.DataArray(
|
|
144
|
+
np.arange(2),
|
|
145
|
+
name="compression",
|
|
146
|
+
dims=["compression"],
|
|
147
|
+
attrs=mag_attributes.get_variable_attributes(
|
|
148
|
+
"compression_attrs", check_schema=False
|
|
149
|
+
),
|
|
108
150
|
)
|
|
109
|
-
|
|
110
|
-
|
|
151
|
+
|
|
152
|
+
direction_label = xr.DataArray(
|
|
153
|
+
direction.values.astype(str),
|
|
154
|
+
name="direction_label",
|
|
155
|
+
dims=["direction_label"],
|
|
156
|
+
attrs=mag_attributes.get_variable_attributes(
|
|
157
|
+
"direction_label", check_schema=False
|
|
158
|
+
),
|
|
111
159
|
)
|
|
112
|
-
|
|
113
|
-
|
|
160
|
+
|
|
161
|
+
compression_label = xr.DataArray(
|
|
162
|
+
compression.values.astype(str),
|
|
163
|
+
name="compression_label",
|
|
164
|
+
dims=["compression_label"],
|
|
165
|
+
attrs=mag_attributes.get_variable_attributes(
|
|
166
|
+
"compression_label", check_schema=False
|
|
167
|
+
),
|
|
114
168
|
)
|
|
115
169
|
|
|
170
|
+
global_attributes = mag_attributes.get_global_attributes(logical_source)
|
|
171
|
+
try:
|
|
172
|
+
global_attributes["is_mago"] = input_dataset.attrs["is_mago"]
|
|
173
|
+
global_attributes["is_active"] = input_dataset.attrs["is_active"]
|
|
174
|
+
global_attributes["vectors_per_second"] = input_dataset.attrs[
|
|
175
|
+
"vectors_per_second"
|
|
176
|
+
]
|
|
177
|
+
global_attributes["missing_sequences"] = input_dataset.attrs[
|
|
178
|
+
"missing_sequences"
|
|
179
|
+
]
|
|
180
|
+
except KeyError as e:
|
|
181
|
+
logger.info(
|
|
182
|
+
f"Key error when assigning global attributes, attribute not found in "
|
|
183
|
+
f"L1A file: {e}"
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
output_dataset = xr.Dataset(
|
|
187
|
+
coords={
|
|
188
|
+
"epoch": epoch_time,
|
|
189
|
+
"direction": direction,
|
|
190
|
+
"compression": compression,
|
|
191
|
+
"direction_label": direction_label,
|
|
192
|
+
"compression_label": compression_label,
|
|
193
|
+
},
|
|
194
|
+
attrs=global_attributes,
|
|
195
|
+
)
|
|
196
|
+
# Fill the output with data
|
|
197
|
+
output_dataset["vectors"] = xr.DataArray(
|
|
198
|
+
l1b_fields[0].data,
|
|
199
|
+
name="vectors",
|
|
200
|
+
dims=["epoch", "direction"],
|
|
201
|
+
attrs=mag_attributes.get_variable_attributes("vector_attrs"),
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
output_dataset["compression_flags"] = xr.DataArray(
|
|
205
|
+
input_dataset["compression_flags"].data,
|
|
206
|
+
name="compression_flags",
|
|
207
|
+
dims=["epoch", "compression"],
|
|
208
|
+
attrs=mag_attributes.get_variable_attributes("compression_flags_attrs"),
|
|
209
|
+
)
|
|
116
210
|
return output_dataset
|
|
117
211
|
|
|
118
212
|
|
|
@@ -177,11 +271,13 @@ def rescale_vector(
|
|
|
177
271
|
output_vector : numpy.ndarray
|
|
178
272
|
Updated vector.
|
|
179
273
|
"""
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
274
|
+
output_vector: np.ndarray = input_vector.astype(np.float64)
|
|
275
|
+
|
|
276
|
+
if compression_flags[0]:
|
|
183
277
|
factor = np.float_power(2, (16 - compression_flags[1]))
|
|
184
|
-
|
|
278
|
+
output_vector[:3] = input_vector.astype(np.float64)[:3] * factor
|
|
279
|
+
|
|
280
|
+
return output_vector
|
|
185
281
|
|
|
186
282
|
|
|
187
283
|
def calibrate_vector(
|
|
@@ -206,8 +302,54 @@ def calibrate_vector(
|
|
|
206
302
|
updated_vector : numpy.ndarray
|
|
207
303
|
Calibrated vector.
|
|
208
304
|
"""
|
|
209
|
-
updated_vector = input_vector.copy()
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
305
|
+
updated_vector: np.ndarray = input_vector.copy()
|
|
306
|
+
if input_vector[3] % 1 != 0:
|
|
307
|
+
raise ValueError("Range must be an integer.")
|
|
308
|
+
|
|
309
|
+
range = int(input_vector[3])
|
|
310
|
+
x_y_z = input_vector[:3]
|
|
311
|
+
updated_vector[:3] = np.dot(calibration_matrix.values[:, :, range], x_y_z)
|
|
213
312
|
return updated_vector
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
def shift_time(epoch_times: xr.DataArray, time_shift: xr.DataArray) -> xr.DataArray:
|
|
316
|
+
"""
|
|
317
|
+
Shift epoch times by the provided time_shift calibration value.
|
|
318
|
+
|
|
319
|
+
Sometimes the time values calculated from the sensor vary slightly from the "actual"
|
|
320
|
+
time the data was captured. To correct for this, the MAG team provides time shift
|
|
321
|
+
values in the calibration file. This function applies the time shift to the epoch
|
|
322
|
+
times.
|
|
323
|
+
|
|
324
|
+
The time shift is provided in seconds. A positive shift is adding time, while a
|
|
325
|
+
negative shift subtracts it (so the values move backwards.)
|
|
326
|
+
|
|
327
|
+
This may mean vectors shift out of the specific day that is being processed. To
|
|
328
|
+
manage this, all MAG L0, L1A, L1B, and L1C science data files contain an extra 30
|
|
329
|
+
minute buffer on either side (so the data ranges from
|
|
330
|
+
midnight - 30 minutes to midnight + 24 hours + 30 minutes.)
|
|
331
|
+
The extra buffer is removed at L1D and L2 so those science files are exactly 24
|
|
332
|
+
hours long.
|
|
333
|
+
|
|
334
|
+
For more information please refer to the algorithm document.
|
|
335
|
+
|
|
336
|
+
Parameters
|
|
337
|
+
----------
|
|
338
|
+
epoch_times : xr.DataArray
|
|
339
|
+
The input epoch times, in J2000 ns.
|
|
340
|
+
time_shift : xr.DataArray
|
|
341
|
+
The time shift to apply for the given sensor. This should be one value and is
|
|
342
|
+
in seconds.
|
|
343
|
+
|
|
344
|
+
Returns
|
|
345
|
+
-------
|
|
346
|
+
shifted_times : xr.DataArray
|
|
347
|
+
The shifted epoch times, equal to epoch_times with time_shift added to each
|
|
348
|
+
value.
|
|
349
|
+
"""
|
|
350
|
+
if time_shift.size != 1:
|
|
351
|
+
raise ValueError("Time shift must be a single value.")
|
|
352
|
+
# Time shift is in seconds
|
|
353
|
+
time_shift_ns = time_shift.data * 1e9
|
|
354
|
+
|
|
355
|
+
return epoch_times + time_shift_ns
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# mypy: ignore-errors
|
|
2
|
+
"""Module containing interpolation methods for MAG L1C."""
|
|
3
|
+
|
|
4
|
+
from enum import Enum
|
|
5
|
+
|
|
6
|
+
import numpy as np
|
|
7
|
+
from scipy.interpolate import make_interp_spline
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def linear(
|
|
11
|
+
input_vectors: np.ndarray,
|
|
12
|
+
input_timestamps: np.ndarray,
|
|
13
|
+
output_timestamps: np.ndarray,
|
|
14
|
+
) -> np.ndarray:
|
|
15
|
+
"""
|
|
16
|
+
Linear interpolation of input vectors to output timestamps.
|
|
17
|
+
|
|
18
|
+
Parameters
|
|
19
|
+
----------
|
|
20
|
+
input_vectors : numpy.ndarray
|
|
21
|
+
Input vectors of shape (n, 3) where n is equal to the number of input
|
|
22
|
+
timestamps. Contains x, y, z components of the vector.
|
|
23
|
+
input_timestamps : numpy.ndarray
|
|
24
|
+
Input timestamps of shape (n,) which correspond to the timestamps of the input
|
|
25
|
+
vectors.
|
|
26
|
+
output_timestamps : numpy.ndarray
|
|
27
|
+
Output timestamps of shape (m,) to generate interpolated vectors for.
|
|
28
|
+
|
|
29
|
+
Returns
|
|
30
|
+
-------
|
|
31
|
+
numpy.ndarray
|
|
32
|
+
Interpolated vectors of shape (m, 3) where m is equal to the number of output
|
|
33
|
+
timestamps. Contains x, y, z components of the vector.
|
|
34
|
+
"""
|
|
35
|
+
spline = make_interp_spline(input_timestamps, input_vectors, k=1)
|
|
36
|
+
return spline(output_timestamps)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def quadratic(
|
|
40
|
+
input_vectors: np.ndarray,
|
|
41
|
+
input_timestamps: np.ndarray,
|
|
42
|
+
output_timestamps: np.ndarray,
|
|
43
|
+
) -> np.ndarray:
|
|
44
|
+
"""
|
|
45
|
+
Quadratic interpolation of input vectors to output timestamps.
|
|
46
|
+
|
|
47
|
+
Parameters
|
|
48
|
+
----------
|
|
49
|
+
input_vectors : numpy.ndarray
|
|
50
|
+
Input vectors of shape (n, 3) where n is equal to the number of input
|
|
51
|
+
timestamps. Contains x, y, z components of the vector.
|
|
52
|
+
input_timestamps : numpy.ndarray
|
|
53
|
+
Input timestamps of shape (n,) which correspond to the timestamps of the input
|
|
54
|
+
vectors.
|
|
55
|
+
output_timestamps : numpy.ndarray
|
|
56
|
+
Output timestamps of shape (m,) to generate interpolated vectors for.
|
|
57
|
+
|
|
58
|
+
Returns
|
|
59
|
+
-------
|
|
60
|
+
numpy.ndarray
|
|
61
|
+
Interpolated vectors of shape (m, 3) where m is equal to the number of output
|
|
62
|
+
timestamps. Contains x, y, z components of the vector.
|
|
63
|
+
"""
|
|
64
|
+
spline = make_interp_spline(input_timestamps, input_vectors, k=2)
|
|
65
|
+
return spline(output_timestamps)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def cubic(
|
|
69
|
+
input_vectors: np.ndarray,
|
|
70
|
+
input_timestamps: np.ndarray,
|
|
71
|
+
output_timestamps: np.ndarray,
|
|
72
|
+
) -> np.ndarray:
|
|
73
|
+
"""
|
|
74
|
+
Cubic interpolation of input vectors to output timestamps.
|
|
75
|
+
|
|
76
|
+
Parameters
|
|
77
|
+
----------
|
|
78
|
+
input_vectors : numpy.ndarray
|
|
79
|
+
Input vectors of shape (n, 3) where n is equal to the number of input
|
|
80
|
+
timestamps. Contains x, y, z components of the vector.
|
|
81
|
+
input_timestamps : numpy.ndarray
|
|
82
|
+
Input timestamps of shape (n,) which correspond to the timestamps of the input
|
|
83
|
+
vectors.
|
|
84
|
+
output_timestamps : numpy.ndarray
|
|
85
|
+
Output timestamps of shape (m,) to generate interpolated vectors for.
|
|
86
|
+
|
|
87
|
+
Returns
|
|
88
|
+
-------
|
|
89
|
+
numpy.ndarray
|
|
90
|
+
Interpolated vectors of shape (m, 3) where m is equal to the number of output
|
|
91
|
+
timestamps. Contains x, y, z components of the vector.
|
|
92
|
+
"""
|
|
93
|
+
spline = make_interp_spline(input_timestamps, input_vectors, k=3)
|
|
94
|
+
return spline(output_timestamps)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def linear_filtered(
|
|
98
|
+
input_vectors: np.ndarray,
|
|
99
|
+
input_timestamps: np.ndarray,
|
|
100
|
+
output_timestamps: np.ndarray,
|
|
101
|
+
) -> np.ndarray:
|
|
102
|
+
"""
|
|
103
|
+
Linear filtered interpolation of input vectors to output timestamps.
|
|
104
|
+
|
|
105
|
+
Parameters
|
|
106
|
+
----------
|
|
107
|
+
input_vectors : numpy.ndarray
|
|
108
|
+
Input vectors of shape (n, 3) where n is equal to the number of input
|
|
109
|
+
timestamps. Contains x, y, z components of the vector.
|
|
110
|
+
input_timestamps : numpy.ndarray
|
|
111
|
+
Input timestamps of shape (n,) which correspond to the timestamps of the input
|
|
112
|
+
vectors.
|
|
113
|
+
output_timestamps : numpy.ndarray
|
|
114
|
+
Output timestamps of shape (m,) to generate interpolated vectors for.
|
|
115
|
+
|
|
116
|
+
Returns
|
|
117
|
+
-------
|
|
118
|
+
numpy.ndarray
|
|
119
|
+
Interpolated vectors of shape (m, 3) where m is equal to the number of output
|
|
120
|
+
timestamps. Contains x, y, z components of the vector.
|
|
121
|
+
"""
|
|
122
|
+
pass
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def quadratic_filtered(
|
|
126
|
+
input_vectors: np.ndarray,
|
|
127
|
+
input_timestamps: np.ndarray,
|
|
128
|
+
output_timestamps: np.ndarray,
|
|
129
|
+
) -> np.ndarray:
|
|
130
|
+
"""
|
|
131
|
+
Quadratic filtered interpolation of input vectors to output timestamps.
|
|
132
|
+
|
|
133
|
+
Parameters
|
|
134
|
+
----------
|
|
135
|
+
input_vectors : numpy.ndarray
|
|
136
|
+
Input vectors of shape (n, 3) where n is equal to the number of input
|
|
137
|
+
timestamps. Contains x, y, z components of the vector.
|
|
138
|
+
input_timestamps : numpy.ndarray
|
|
139
|
+
Input timestamps of shape (n,) which correspond to the timestamps of the input
|
|
140
|
+
vectors.
|
|
141
|
+
output_timestamps : numpy.ndarray
|
|
142
|
+
Output timestamps of shape (m,) to generate interpolated vectors for.
|
|
143
|
+
|
|
144
|
+
Returns
|
|
145
|
+
-------
|
|
146
|
+
numpy.ndarray
|
|
147
|
+
Interpolated vectors of shape (m, 3) where m is equal to the number of output
|
|
148
|
+
timestamps. Contains x, y, z components of the vector.
|
|
149
|
+
"""
|
|
150
|
+
pass
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def cubic_filtered(
|
|
154
|
+
input_vectors: np.ndarray,
|
|
155
|
+
input_timestamps: np.ndarray,
|
|
156
|
+
output_timestamps: np.ndarray,
|
|
157
|
+
) -> np.ndarray:
|
|
158
|
+
"""
|
|
159
|
+
Cubic filtered interpolation of input vectors to output timestamps.
|
|
160
|
+
|
|
161
|
+
Parameters
|
|
162
|
+
----------
|
|
163
|
+
input_vectors : numpy.ndarray
|
|
164
|
+
Input vectors of shape (n, 3) where n is equal to the number of input
|
|
165
|
+
timestamps. Contains x, y, z components of the vector.
|
|
166
|
+
input_timestamps : numpy.ndarray
|
|
167
|
+
Input timestamps of shape (n,) which correspond to the timestamps of the input
|
|
168
|
+
vectors.
|
|
169
|
+
output_timestamps : numpy.ndarray
|
|
170
|
+
Output timestamps of shape (m,) to generate interpolated vectors for.
|
|
171
|
+
|
|
172
|
+
Returns
|
|
173
|
+
-------
|
|
174
|
+
numpy.ndarray
|
|
175
|
+
Interpolated vectors of shape (m, 3) where m is equal to the number of output
|
|
176
|
+
timestamps. Contains x, y, z components of the vector.
|
|
177
|
+
"""
|
|
178
|
+
pass
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
class InterpolationFunction(Enum):
|
|
182
|
+
"""Enum which describes the options for interpolation functions on MAG L1C."""
|
|
183
|
+
|
|
184
|
+
linear = (linear,)
|
|
185
|
+
quadratic = (quadratic,)
|
|
186
|
+
cubic = (cubic,)
|
|
187
|
+
linear_filtered = (linear_filtered,)
|
|
188
|
+
quadratic_filtered = (quadratic_filtered,)
|
|
189
|
+
cubic_filtered = (cubic_filtered,)
|
|
190
|
+
|
|
191
|
+
def __call__(self, *args, **kwargs):
|
|
192
|
+
"""
|
|
193
|
+
Overwritten call which allows you to call the interpolation function directly.
|
|
194
|
+
|
|
195
|
+
example: InterpolationFunction.linear(input_vectors, input_timestamps,
|
|
196
|
+
output_timestamps)
|
|
197
|
+
|
|
198
|
+
Parameters
|
|
199
|
+
----------
|
|
200
|
+
*args : list
|
|
201
|
+
List of arguments to pass to the interpolation function. Must match
|
|
202
|
+
(input_vectors, input_timestamps, output_timestamps).
|
|
203
|
+
**kwargs : dict
|
|
204
|
+
Keyword arguments to pass to the interpolation function.
|
|
205
|
+
|
|
206
|
+
Returns
|
|
207
|
+
-------
|
|
208
|
+
Any
|
|
209
|
+
The return value of the interpolation function.
|
|
210
|
+
"""
|
|
211
|
+
return self.value[0](*args, **kwargs)
|