imap-processing 0.9.0__py3-none-any.whl → 0.11.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of imap-processing might be problematic. Click here for more details.
- imap_processing/_version.py +2 -2
- imap_processing/cdf/config/imap_codice_l1a_variable_attrs.yaml +749 -442
- imap_processing/cdf/config/imap_glows_global_cdf_attrs.yaml +7 -0
- imap_processing/cdf/config/imap_glows_l1a_variable_attrs.yaml +8 -2
- imap_processing/cdf/config/imap_glows_l1b_variable_attrs.yaml +0 -1
- imap_processing/cdf/config/imap_glows_l2_variable_attrs.yaml +358 -0
- imap_processing/cdf/config/imap_hi_variable_attrs.yaml +59 -25
- imap_processing/cdf/config/imap_hit_global_cdf_attrs.yaml +22 -0
- imap_processing/cdf/config/imap_idex_l1a_variable_attrs.yaml +32 -8
- imap_processing/cdf/config/imap_idex_l1b_variable_attrs.yaml +94 -5
- imap_processing/cdf/config/imap_lo_l1a_variable_attrs.yaml +65 -37
- imap_processing/cdf/config/imap_swapi_variable_attrs.yaml +16 -1
- imap_processing/cdf/config/imap_swe_global_cdf_attrs.yaml +7 -0
- imap_processing/cdf/config/imap_swe_l1a_variable_attrs.yaml +14 -14
- imap_processing/cdf/config/imap_swe_l1b_variable_attrs.yaml +25 -24
- imap_processing/cdf/config/imap_swe_l2_variable_attrs.yaml +238 -0
- imap_processing/cdf/config/imap_ultra_l1b_variable_attrs.yaml +100 -92
- imap_processing/cdf/utils.py +2 -2
- imap_processing/cli.py +45 -9
- imap_processing/codice/codice_l1a.py +104 -58
- imap_processing/codice/constants.py +111 -155
- imap_processing/codice/data/esa_sweep_values.csv +256 -256
- imap_processing/codice/data/lo_stepping_values.csv +128 -128
- imap_processing/ena_maps/ena_maps.py +519 -0
- imap_processing/ena_maps/utils/map_utils.py +145 -0
- imap_processing/ena_maps/utils/spatial_utils.py +226 -0
- imap_processing/glows/__init__.py +3 -0
- imap_processing/glows/ancillary/imap_glows_pipeline_settings_v001.json +52 -0
- imap_processing/glows/l1a/glows_l1a.py +72 -14
- imap_processing/glows/l1b/glows_l1b.py +2 -1
- imap_processing/glows/l1b/glows_l1b_data.py +25 -1
- imap_processing/glows/l2/glows_l2.py +324 -0
- imap_processing/glows/l2/glows_l2_data.py +156 -51
- imap_processing/hi/l1a/science_direct_event.py +57 -51
- imap_processing/hi/l1b/hi_l1b.py +43 -28
- imap_processing/hi/l1c/hi_l1c.py +225 -42
- imap_processing/hi/utils.py +20 -3
- imap_processing/hit/l0/constants.py +2 -2
- imap_processing/hit/l0/decom_hit.py +1 -1
- imap_processing/hit/l1a/hit_l1a.py +94 -13
- imap_processing/hit/l1b/hit_l1b.py +158 -9
- imap_processing/ialirt/l0/process_codicehi.py +156 -0
- imap_processing/ialirt/l0/process_codicelo.py +5 -2
- imap_processing/ialirt/packet_definitions/ialirt.xml +28 -20
- imap_processing/ialirt/packet_definitions/ialirt_codicehi.xml +241 -0
- imap_processing/ialirt/packet_definitions/ialirt_swapi.xml +170 -0
- imap_processing/ialirt/packet_definitions/ialirt_swe.xml +258 -0
- imap_processing/ialirt/process_ephemeris.py +72 -40
- imap_processing/idex/decode.py +241 -0
- imap_processing/idex/idex_l1a.py +143 -81
- imap_processing/idex/idex_l1b.py +244 -10
- imap_processing/lo/l0/lo_science.py +61 -0
- imap_processing/lo/l1a/lo_l1a.py +98 -10
- imap_processing/lo/l1b/lo_l1b.py +2 -2
- imap_processing/lo/l1c/lo_l1c.py +2 -2
- imap_processing/lo/packet_definitions/lo_xtce.xml +1082 -9178
- imap_processing/mag/l0/decom_mag.py +2 -2
- imap_processing/mag/l1a/mag_l1a.py +7 -7
- imap_processing/mag/l1a/mag_l1a_data.py +62 -30
- imap_processing/mag/l1b/mag_l1b.py +11 -6
- imap_processing/quality_flags.py +18 -3
- imap_processing/spice/geometry.py +149 -177
- imap_processing/spice/kernels.py +26 -26
- imap_processing/spice/spin.py +233 -0
- imap_processing/spice/time.py +96 -31
- imap_processing/swapi/l1/swapi_l1.py +60 -31
- imap_processing/swapi/packet_definitions/swapi_packet_definition.xml +363 -384
- imap_processing/swe/l1a/swe_l1a.py +8 -3
- imap_processing/swe/l1a/swe_science.py +24 -24
- imap_processing/swe/l1b/swe_l1b.py +2 -1
- imap_processing/swe/l1b/swe_l1b_science.py +181 -122
- imap_processing/swe/l2/swe_l2.py +337 -70
- imap_processing/swe/utils/swe_utils.py +28 -0
- imap_processing/tests/cdf/test_utils.py +2 -2
- imap_processing/tests/codice/conftest.py +20 -17
- imap_processing/tests/codice/data/validation/imap_codice_l1a_hskp_20241110193622_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-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-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_l0.py +55 -121
- imap_processing/tests/codice/test_codice_l1a.py +147 -59
- imap_processing/tests/conftest.py +81 -22
- imap_processing/tests/ena_maps/test_ena_maps.py +309 -0
- imap_processing/tests/ena_maps/test_map_utils.py +286 -0
- imap_processing/tests/ena_maps/test_spatial_utils.py +161 -0
- imap_processing/tests/glows/conftest.py +7 -1
- imap_processing/tests/glows/test_glows_l1a_cdf.py +3 -7
- imap_processing/tests/glows/test_glows_l1a_data.py +34 -6
- imap_processing/tests/glows/test_glows_l1b_data.py +29 -17
- imap_processing/tests/glows/test_glows_l2.py +101 -0
- imap_processing/tests/hi/conftest.py +3 -3
- imap_processing/tests/hi/data/l1/imap_hi_l1b_45sensor-de_20250415_v999.cdf +0 -0
- imap_processing/tests/hi/data/l1/imap_his_pset-calibration-prod-config_20240101_v001.csv +31 -0
- imap_processing/tests/hi/test_hi_l1b.py +14 -9
- imap_processing/tests/hi/test_hi_l1c.py +136 -36
- imap_processing/tests/hi/test_l1a.py +0 -2
- imap_processing/tests/hi/test_science_direct_event.py +18 -14
- imap_processing/tests/hi/test_utils.py +16 -11
- imap_processing/tests/hit/helpers/__init__.py +0 -0
- imap_processing/tests/hit/helpers/l1_validation.py +405 -0
- imap_processing/tests/hit/test_data/sci_sample.ccsds +0 -0
- imap_processing/tests/hit/test_decom_hit.py +8 -10
- imap_processing/tests/hit/test_hit_l1a.py +117 -180
- imap_processing/tests/hit/test_hit_l1b.py +149 -55
- imap_processing/tests/hit/validation_data/hit_l1b_standard_sample2_nsrl_v4_3decimals.csv +62 -0
- imap_processing/tests/hit/validation_data/sci_sample_raw.csv +62 -0
- imap_processing/tests/ialirt/test_data/l0/20240827095047_SWE_IALIRT_packet.bin +0 -0
- imap_processing/tests/ialirt/test_data/l0/BinLog CCSDS_FRAG_TLM_20240826_152323Z_IALIRT_data_for_SDC.bin +0 -0
- imap_processing/tests/ialirt/test_data/l0/eu_SWP_IAL_20240826_152033.csv +644 -0
- imap_processing/tests/ialirt/test_data/l0/hi_fsw_view_1_ccsds.bin +0 -0
- imap_processing/tests/ialirt/test_data/l0/idle_export_eu.SWE_IALIRT_20240827_093852.csv +914 -0
- imap_processing/tests/ialirt/test_data/l0/imap_codice_l1a_hi-ialirt_20240523200000_v0.0.0.cdf +0 -0
- imap_processing/tests/ialirt/unit/test_process_codicehi.py +106 -0
- imap_processing/tests/ialirt/unit/test_process_ephemeris.py +33 -5
- imap_processing/tests/ialirt/unit/test_process_swapi.py +85 -0
- imap_processing/tests/ialirt/unit/test_process_swe.py +106 -0
- imap_processing/tests/idex/conftest.py +29 -1
- imap_processing/tests/idex/test_data/compressed_2023_102_14_24_55.pkts +0 -0
- imap_processing/tests/idex/test_data/non_compressed_2023_102_14_22_26.pkts +0 -0
- imap_processing/tests/idex/test_idex_l0.py +6 -3
- imap_processing/tests/idex/test_idex_l1a.py +151 -1
- imap_processing/tests/idex/test_idex_l1b.py +124 -2
- imap_processing/tests/lo/test_lo_l1a.py +62 -2
- imap_processing/tests/lo/test_lo_science.py +85 -0
- imap_processing/tests/lo/validation_data/Instrument_FM1_T104_R129_20240803_ILO_SPIN_EU.csv +2 -0
- imap_processing/tests/mag/conftest.py +16 -0
- imap_processing/tests/mag/test_mag_decom.py +6 -4
- imap_processing/tests/mag/test_mag_l1a.py +36 -7
- imap_processing/tests/mag/test_mag_l1b.py +55 -4
- imap_processing/tests/mag/test_mag_validation.py +148 -0
- imap_processing/tests/mag/validation/L1a/T001/all_p_ones.txt +19200 -0
- imap_processing/tests/mag/validation/L1a/T001/mag-l0-l1a-t001-in.bin +0 -0
- imap_processing/tests/mag/validation/L1a/T001/mag-l0-l1a-t001-out.csv +17 -0
- imap_processing/tests/mag/validation/L1a/T002/all_n_ones.txt +19200 -0
- imap_processing/tests/mag/validation/L1a/T002/mag-l0-l1a-t002-in.bin +0 -0
- imap_processing/tests/mag/validation/L1a/T002/mag-l0-l1a-t002-out.csv +17 -0
- imap_processing/tests/mag/validation/L1a/T003/field_like.txt +19200 -0
- imap_processing/tests/mag/validation/L1a/T003/mag-l0-l1a-t003-in.bin +0 -0
- imap_processing/tests/mag/validation/L1a/T003/mag-l0-l1a-t003-out.csv +17 -0
- imap_processing/tests/mag/validation/L1a/T004/field_like.txt +19200 -0
- imap_processing/tests/mag/validation/L1a/T004/mag-l0-l1a-t004-in.bin +0 -0
- imap_processing/tests/mag/validation/L1a/T004/mag-l0-l1a-t004-out.csv +17 -0
- imap_processing/tests/mag/validation/L1a/T005/field_like_range_change.txt +19200 -0
- imap_processing/tests/mag/validation/L1a/T005/mag-l0-l1a-t005-in.bin +0 -0
- imap_processing/tests/mag/validation/L1a/T005/mag-l0-l1a-t005-out.csv +17 -0
- imap_processing/tests/mag/validation/L1a/T006/hdr_field.txt +19200 -0
- imap_processing/tests/mag/validation/L1a/T006/mag-l0-l1a-t006-in.bin +0 -0
- imap_processing/tests/mag/validation/L1a/T006/mag-l0-l1a-t006-out.csv +17 -0
- imap_processing/tests/mag/validation/L1a/T007/hdr_field_and_range_change.txt +19200 -0
- imap_processing/tests/mag/validation/L1a/T007/mag-l0-l1a-t007-in.bin +0 -0
- imap_processing/tests/mag/validation/L1a/T007/mag-l0-l1a-t007-out.csv +17 -0
- imap_processing/tests/mag/validation/L1a/T008/field_like_range_change.txt +19200 -0
- imap_processing/tests/mag/validation/L1a/T008/mag-l0-l1a-t008-in.bin +0 -0
- imap_processing/tests/mag/validation/L1a/T008/mag-l0-l1a-t008-out.csv +17 -0
- imap_processing/tests/mag/validation/L1b/T009/data.bin +0 -0
- imap_processing/tests/mag/validation/L1b/T009/field_like_all_ranges.txt +19200 -0
- imap_processing/tests/mag/validation/L1b/T009/mag-l1a-l1b-t009-in.csv +17 -0
- imap_processing/tests/mag/validation/L1b/T009/mag-l1a-l1b-t009-magi-out.csv +17 -0
- imap_processing/tests/mag/validation/L1b/T009/mag-l1a-l1b-t009-mago-out.csv +17 -0
- imap_processing/tests/mag/validation/L1b/T010/data.bin +0 -0
- imap_processing/tests/mag/validation/L1b/T010/field_like_all_ranges.txt +19200 -0
- imap_processing/tests/mag/validation/L1b/T010/mag-l1a-l1b-t010-in.csv +17 -0
- imap_processing/tests/mag/validation/L1b/T010/mag-l1a-l1b-t010-magi-out.csv +17 -0
- imap_processing/tests/mag/validation/L1b/T010/mag-l1a-l1b-t010-mago-out.csv +17 -0
- imap_processing/tests/mag/validation/L1b/T011/data.bin +0 -0
- imap_processing/tests/mag/validation/L1b/T011/field_like_all_ranges.txt +19200 -0
- imap_processing/tests/mag/validation/L1b/T011/mag-l1a-l1b-t011-in.csv +17 -0
- imap_processing/tests/mag/validation/L1b/T011/mag-l1a-l1b-t011-magi-out.csv +17 -0
- imap_processing/tests/mag/validation/L1b/T011/mag-l1a-l1b-t011-mago-out.csv +17 -0
- imap_processing/tests/spice/test_geometry.py +128 -133
- imap_processing/tests/spice/test_kernels.py +37 -37
- imap_processing/tests/spice/test_spin.py +184 -0
- imap_processing/tests/spice/test_time.py +43 -20
- imap_processing/tests/swapi/test_swapi_l1.py +11 -10
- imap_processing/tests/swapi/test_swapi_l2.py +13 -3
- imap_processing/tests/swe/test_swe_l1a.py +1 -1
- imap_processing/tests/swe/test_swe_l1b.py +20 -3
- imap_processing/tests/swe/test_swe_l1b_science.py +54 -35
- imap_processing/tests/swe/test_swe_l2.py +148 -5
- imap_processing/tests/test_cli.py +39 -7
- imap_processing/tests/test_quality_flags.py +19 -19
- imap_processing/tests/test_utils.py +3 -2
- imap_processing/tests/ultra/test_data/l0/ultra45_raw_sc_ultrarawimg_withFSWcalcs_FM45_40P_Phi28p5_BeamCal_LinearScan_phi2850_theta-000_20240207T102740.csv +3314 -3314
- imap_processing/tests/ultra/test_data/mock_data.py +161 -0
- imap_processing/tests/ultra/unit/conftest.py +73 -0
- imap_processing/tests/ultra/unit/test_badtimes.py +58 -0
- imap_processing/tests/ultra/unit/test_cullingmask.py +87 -0
- imap_processing/tests/ultra/unit/test_de.py +61 -60
- imap_processing/tests/ultra/unit/test_ultra_l1a.py +3 -3
- imap_processing/tests/ultra/unit/test_ultra_l1b.py +51 -77
- imap_processing/tests/ultra/unit/test_ultra_l1b_annotated.py +5 -5
- imap_processing/tests/ultra/unit/test_ultra_l1b_culling.py +114 -0
- imap_processing/tests/ultra/unit/test_ultra_l1b_extended.py +86 -26
- imap_processing/tests/ultra/unit/test_ultra_l1c.py +1 -1
- imap_processing/tests/ultra/unit/test_ultra_l1c_pset_bins.py +3 -3
- imap_processing/ultra/constants.py +11 -1
- imap_processing/ultra/l1a/ultra_l1a.py +2 -2
- imap_processing/ultra/l1b/badtimes.py +22 -5
- imap_processing/ultra/l1b/cullingmask.py +31 -5
- imap_processing/ultra/l1b/de.py +32 -37
- imap_processing/ultra/l1b/extendedspin.py +44 -20
- imap_processing/ultra/l1b/ultra_l1b.py +21 -22
- imap_processing/ultra/l1b/ultra_l1b_culling.py +190 -0
- imap_processing/ultra/l1b/ultra_l1b_extended.py +81 -30
- imap_processing/ultra/l1c/histogram.py +6 -2
- imap_processing/ultra/l1c/pset.py +6 -2
- imap_processing/ultra/l1c/ultra_l1c.py +2 -3
- imap_processing/ultra/l1c/ultra_l1c_pset_bins.py +4 -3
- imap_processing/ultra/utils/ultra_l1_utils.py +70 -14
- imap_processing/utils.py +2 -2
- {imap_processing-0.9.0.dist-info → imap_processing-0.11.0.dist-info}/METADATA +7 -2
- {imap_processing-0.9.0.dist-info → imap_processing-0.11.0.dist-info}/RECORD +235 -152
- imap_processing/tests/codice/data/eu_unit_lookup_table.csv +0 -101
- imap_processing/tests/codice/data/idle_export_eu.COD_NHK_20230822_122700 2.csv +0 -100
- imap_processing/tests/codice/data/idle_export_raw.COD_NHK_20230822_122700.csv +0 -100
- imap_processing/tests/codice/data/imap_codice_l0_raw_20241110_v001.pkts +0 -0
- imap_processing/tests/hi/test_data/l1a/imap_hi_l1a_45sensor-de_20250415_v000.cdf +0 -0
- imap_processing/tests/hit/test_data/sci_sample1.ccsds +0 -0
- imap_processing/tests/ultra/unit/test_spatial_utils.py +0 -125
- imap_processing/ultra/utils/spatial_utils.py +0 -221
- /imap_processing/tests/hi/{test_data → data}/l0/20231030_H45_APP_NHK.bin +0 -0
- /imap_processing/tests/hi/{test_data → data}/l0/20231030_H45_APP_NHK.csv +0 -0
- /imap_processing/tests/hi/{test_data → data}/l0/20231030_H45_SCI_CNT.bin +0 -0
- /imap_processing/tests/hi/{test_data → data}/l0/20231030_H45_SCI_DE.bin +0 -0
- /imap_processing/tests/hi/{test_data → data}/l0/H90_NHK_20241104.bin +0 -0
- /imap_processing/tests/hi/{test_data → data}/l0/H90_sci_cnt_20241104.bin +0 -0
- /imap_processing/tests/hi/{test_data → data}/l0/H90_sci_de_20241104.bin +0 -0
- /imap_processing/tests/hi/{test_data → data}/l0/README.txt +0 -0
- /imap_processing/tests/idex/{imap_idex_l0_raw_20231214_v001.pkts → test_data/imap_idex_l0_raw_20231214_v001.pkts} +0 -0
- /imap_processing/tests/idex/{impact_14_tof_high_data.txt → test_data/impact_14_tof_high_data.txt} +0 -0
- /imap_processing/tests/mag/{imap_mag_l1a_norm-magi_20251017_v001.cdf → validation/imap_mag_l1a_norm-magi_20251017_v001.cdf} +0 -0
- /imap_processing/tests/mag/{mag_l0_test_data.pkts → validation/mag_l0_test_data.pkts} +0 -0
- /imap_processing/tests/mag/{mag_l0_test_output.csv → validation/mag_l0_test_output.csv} +0 -0
- /imap_processing/tests/mag/{mag_l1_test_data.pkts → validation/mag_l1_test_data.pkts} +0 -0
- /imap_processing/tests/mag/{mag_l1a_test_output.csv → validation/mag_l1a_test_output.csv} +0 -0
- {imap_processing-0.9.0.dist-info → imap_processing-0.11.0.dist-info}/LICENSE +0 -0
- {imap_processing-0.9.0.dist-info → imap_processing-0.11.0.dist-info}/WHEEL +0 -0
- {imap_processing-0.9.0.dist-info → imap_processing-0.11.0.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
<?xml version='1.0' encoding='UTF-8'?>
|
|
2
|
+
<xtce:SpaceSystem xmlns:xtce="http://www.omg.org/space/xtce" name="ialirt">
|
|
3
|
+
<xtce:Header date="2023-08-24T07:53:00MST" version="1.0" author="IMAP SDC" />
|
|
4
|
+
<xtce:TelemetryMetaData>
|
|
5
|
+
<xtce:ParameterTypeSet>
|
|
6
|
+
<!-- This file was manually created using content from:
|
|
7
|
+
I-ALiRT Packet Definitions: https://lasp.colorado.edu/galaxy/x/44nKCQ
|
|
8
|
+
-->
|
|
9
|
+
<xtce:IntegerParameterType name="uint1" signed="false">
|
|
10
|
+
<xtce:IntegerDataEncoding sizeInBits="1" encoding="unsigned" />
|
|
11
|
+
<xtce:UnitSet />
|
|
12
|
+
</xtce:IntegerParameterType>
|
|
13
|
+
<xtce:IntegerParameterType name="uint2" signed="false">
|
|
14
|
+
<xtce:IntegerDataEncoding sizeInBits="2" encoding="unsigned" />
|
|
15
|
+
<xtce:UnitSet />
|
|
16
|
+
</xtce:IntegerParameterType>
|
|
17
|
+
<xtce:IntegerParameterType name="uint3" signed="false">
|
|
18
|
+
<xtce:IntegerDataEncoding sizeInBits="3" encoding="unsigned" />
|
|
19
|
+
<xtce:UnitSet />
|
|
20
|
+
</xtce:IntegerParameterType>
|
|
21
|
+
<xtce:IntegerParameterType name="uint6" signed="false">
|
|
22
|
+
<xtce:IntegerDataEncoding sizeInBits="6" encoding="unsigned" />
|
|
23
|
+
<xtce:UnitSet />
|
|
24
|
+
</xtce:IntegerParameterType>
|
|
25
|
+
<xtce:IntegerParameterType name="uint8" signed="false">
|
|
26
|
+
<xtce:IntegerDataEncoding sizeInBits="8" encoding="unsigned" />
|
|
27
|
+
<xtce:UnitSet />
|
|
28
|
+
</xtce:IntegerParameterType>
|
|
29
|
+
<xtce:IntegerParameterType name="uint11" signed="false">
|
|
30
|
+
<xtce:IntegerDataEncoding sizeInBits="11" encoding="unsigned" />
|
|
31
|
+
<xtce:UnitSet />
|
|
32
|
+
</xtce:IntegerParameterType>
|
|
33
|
+
<xtce:IntegerParameterType name="uint14" signed="false">
|
|
34
|
+
<xtce:IntegerDataEncoding sizeInBits="14" encoding="unsigned" />
|
|
35
|
+
<xtce:UnitSet />
|
|
36
|
+
</xtce:IntegerParameterType>
|
|
37
|
+
<xtce:IntegerParameterType name="uint16" signed="false">
|
|
38
|
+
<xtce:IntegerDataEncoding sizeInBits="16" encoding="unsigned" />
|
|
39
|
+
<xtce:UnitSet />
|
|
40
|
+
</xtce:IntegerParameterType>
|
|
41
|
+
<xtce:IntegerParameterType name="uint24" signed="false">
|
|
42
|
+
<xtce:IntegerDataEncoding sizeInBits="24" encoding="unsigned" />
|
|
43
|
+
<xtce:UnitSet />
|
|
44
|
+
</xtce:IntegerParameterType>
|
|
45
|
+
<xtce:IntegerParameterType name="uint32" signed="false">
|
|
46
|
+
<xtce:IntegerDataEncoding sizeInBits="32" encoding="unsigned" />
|
|
47
|
+
<xtce:UnitSet />
|
|
48
|
+
</xtce:IntegerParameterType>
|
|
49
|
+
<!-- Enumerated Data Types -->
|
|
50
|
+
<xtce:EnumeratedParameterType name="instrument_status" signed="false">
|
|
51
|
+
<xtce:UnitSet/>
|
|
52
|
+
<xtce:IntegerDataEncoding sizeInBits="1" encoding="unsigned"/>
|
|
53
|
+
<xtce:EnumerationList>
|
|
54
|
+
<xtce:Enumeration label="OFF-NOMINAL" value="0"/>
|
|
55
|
+
<xtce:Enumeration label="NOMINAL" value="1"/>
|
|
56
|
+
</xtce:EnumerationList>
|
|
57
|
+
</xtce:EnumeratedParameterType>
|
|
58
|
+
<xtce:EnumeratedParameterType name="swe_ops_flag" signed="false">
|
|
59
|
+
<xtce:UnitSet/>
|
|
60
|
+
<xtce:IntegerDataEncoding sizeInBits="1" encoding="unsigned"/>
|
|
61
|
+
<xtce:EnumerationList>
|
|
62
|
+
<xtce:Enumeration label="NON-HVSCI" value="0"/>
|
|
63
|
+
<xtce:Enumeration label="HVSCI" value="1"/>
|
|
64
|
+
</xtce:EnumerationList>
|
|
65
|
+
</xtce:EnumeratedParameterType>
|
|
66
|
+
</xtce:ParameterTypeSet>
|
|
67
|
+
<xtce:ParameterSet>
|
|
68
|
+
<!-- Within the ParameterSet, utilize the data types defined in the ParameterTypeSet to create variables
|
|
69
|
+
with their respective data types. -->
|
|
70
|
+
|
|
71
|
+
<!--CCSDS Header Elements-->
|
|
72
|
+
<xtce:Parameter name="VERSION" parameterTypeRef="uint3">
|
|
73
|
+
<xtce:LongDescription>CCSDS Packet Version Number (always 0)</xtce:LongDescription>
|
|
74
|
+
</xtce:Parameter>
|
|
75
|
+
<xtce:Parameter name="TYPE" parameterTypeRef="uint1">
|
|
76
|
+
<xtce:LongDescription>CCSDS Packet Type Indicator (0=telemetry)</xtce:LongDescription>
|
|
77
|
+
</xtce:Parameter>
|
|
78
|
+
<xtce:Parameter name="SEC_HDR_FLG" parameterTypeRef="uint1">
|
|
79
|
+
<xtce:LongDescription>CCSDS Packet Secondary Header Flag (always 1)</xtce:LongDescription>
|
|
80
|
+
</xtce:Parameter>
|
|
81
|
+
<xtce:Parameter name="PKT_APID" parameterTypeRef="uint11">
|
|
82
|
+
<xtce:LongDescription>CCSDS Packet Application Process ID</xtce:LongDescription>
|
|
83
|
+
</xtce:Parameter>
|
|
84
|
+
<xtce:Parameter name="SEQ_FLGS" parameterTypeRef="uint2">
|
|
85
|
+
<xtce:LongDescription>CCSDS Packet Grouping Flags (3=not part of group)</xtce:LongDescription>
|
|
86
|
+
</xtce:Parameter>
|
|
87
|
+
<xtce:Parameter name="SRC_SEQ_CTR" parameterTypeRef="uint14">
|
|
88
|
+
<xtce:LongDescription>CCSDS Packet Sequence Count (increments with each new packet)</xtce:LongDescription>
|
|
89
|
+
</xtce:Parameter>
|
|
90
|
+
<xtce:Parameter name="PKT_LEN" parameterTypeRef="uint16">
|
|
91
|
+
<xtce:LongDescription>CCSDS Packet Length (number of bytes after Packet length minus 1)</xtce:LongDescription>
|
|
92
|
+
</xtce:Parameter>
|
|
93
|
+
<!-- SWE -->
|
|
94
|
+
<xtce:Parameter name="SWE_SHCOARSE" parameterTypeRef="uint32">
|
|
95
|
+
<xtce:LongDescription>SWE SHCOARSE</xtce:LongDescription>
|
|
96
|
+
</xtce:Parameter>
|
|
97
|
+
<xtce:Parameter name="SWE_ACQ_SEC" parameterTypeRef="uint32">
|
|
98
|
+
<xtce:LongDescription>SWE Acquisition Time (sec)</xtce:LongDescription>
|
|
99
|
+
</xtce:Parameter>
|
|
100
|
+
<xtce:Parameter name="SWE_ACQ_SUB" parameterTypeRef="uint24">
|
|
101
|
+
<xtce:LongDescription>SWE Acquisition Time (sub sec)</xtce:LongDescription>
|
|
102
|
+
</xtce:Parameter>
|
|
103
|
+
<xtce:Parameter name="SWE_NOM_FLAG" parameterTypeRef="instrument_status">
|
|
104
|
+
<xtce:LongDescription>1 = nominal, 0 = off-nominal</xtce:LongDescription>
|
|
105
|
+
</xtce:Parameter>
|
|
106
|
+
<xtce:Parameter name="SWE_OPS_FLAG" parameterTypeRef="swe_ops_flag">
|
|
107
|
+
<xtce:LongDescription>1 = HVSCI mode, 0 = not HVSCI mode</xtce:LongDescription>
|
|
108
|
+
</xtce:Parameter>
|
|
109
|
+
<xtce:Parameter name="SWE_SEQ" parameterTypeRef="uint6">
|
|
110
|
+
<xtce:LongDescription>Sequence Number corresponds to 15 2-spin sectors times 4 sets.</xtce:LongDescription>
|
|
111
|
+
</xtce:Parameter>
|
|
112
|
+
<xtce:Parameter name="SWE_CEM1_E1" parameterTypeRef="uint8">
|
|
113
|
+
<xtce:LongDescription>Electron counts for CEM1 energy 1.</xtce:LongDescription>
|
|
114
|
+
</xtce:Parameter>
|
|
115
|
+
<xtce:Parameter name="SWE_CEM1_E2" parameterTypeRef="uint8">
|
|
116
|
+
<xtce:LongDescription>Electron counts for CEM1 energy 2.</xtce:LongDescription>
|
|
117
|
+
</xtce:Parameter>
|
|
118
|
+
<xtce:Parameter name="SWE_CEM1_E3" parameterTypeRef="uint8">
|
|
119
|
+
<xtce:LongDescription>Electron counts for CEM1 energy 3.</xtce:LongDescription>
|
|
120
|
+
</xtce:Parameter>
|
|
121
|
+
<xtce:Parameter name="SWE_CEM1_E4" parameterTypeRef="uint8">
|
|
122
|
+
<xtce:LongDescription>Electron counts for CEM1 energy 4.</xtce:LongDescription>
|
|
123
|
+
</xtce:Parameter>
|
|
124
|
+
<xtce:Parameter name="SWE_CEM2_E1" parameterTypeRef="uint8">
|
|
125
|
+
<xtce:LongDescription>Electron counts for CEM2 energy 1.</xtce:LongDescription>
|
|
126
|
+
</xtce:Parameter>
|
|
127
|
+
<xtce:Parameter name="SWE_CEM2_E2" parameterTypeRef="uint8">
|
|
128
|
+
<xtce:LongDescription>Electron counts for CEM2 energy 2.</xtce:LongDescription>
|
|
129
|
+
</xtce:Parameter>
|
|
130
|
+
<xtce:Parameter name="SWE_CEM2_E3" parameterTypeRef="uint8">
|
|
131
|
+
<xtce:LongDescription>Electron counts for CEM2 energy 3.</xtce:LongDescription>
|
|
132
|
+
</xtce:Parameter>
|
|
133
|
+
<xtce:Parameter name="SWE_CEM2_E4" parameterTypeRef="uint8">
|
|
134
|
+
<xtce:LongDescription>Electron counts for CEM2 energy 4.</xtce:LongDescription>
|
|
135
|
+
</xtce:Parameter>
|
|
136
|
+
<xtce:Parameter name="SWE_CEM3_E1" parameterTypeRef="uint8">
|
|
137
|
+
<xtce:LongDescription>Electron counts for CEM3 energy 1.</xtce:LongDescription>
|
|
138
|
+
</xtce:Parameter>
|
|
139
|
+
<xtce:Parameter name="SWE_CEM3_E2" parameterTypeRef="uint8">
|
|
140
|
+
<xtce:LongDescription>Electron counts for CEM3 energy 2.</xtce:LongDescription>
|
|
141
|
+
</xtce:Parameter>
|
|
142
|
+
<xtce:Parameter name="SWE_CEM3_E3" parameterTypeRef="uint8">
|
|
143
|
+
<xtce:LongDescription>Electron counts for CEM3 energy 3.</xtce:LongDescription>
|
|
144
|
+
</xtce:Parameter>
|
|
145
|
+
<xtce:Parameter name="SWE_CEM3_E4" parameterTypeRef="uint8">
|
|
146
|
+
<xtce:LongDescription>Electron counts for CEM3 energy 4.</xtce:LongDescription>
|
|
147
|
+
</xtce:Parameter>
|
|
148
|
+
<xtce:Parameter name="SWE_CEM4_E1" parameterTypeRef="uint8">
|
|
149
|
+
<xtce:LongDescription>Electron counts for CEM4 energy 1.</xtce:LongDescription>
|
|
150
|
+
</xtce:Parameter>
|
|
151
|
+
<xtce:Parameter name="SWE_CEM4_E2" parameterTypeRef="uint8">
|
|
152
|
+
<xtce:LongDescription>Electron counts for CEM4 energy 2.</xtce:LongDescription>
|
|
153
|
+
</xtce:Parameter>
|
|
154
|
+
<xtce:Parameter name="SWE_CEM4_E3" parameterTypeRef="uint8">
|
|
155
|
+
<xtce:LongDescription>Electron counts for CEM4 energy 3.</xtce:LongDescription>
|
|
156
|
+
</xtce:Parameter>
|
|
157
|
+
<xtce:Parameter name="SWE_CEM4_E4" parameterTypeRef="uint8">
|
|
158
|
+
<xtce:LongDescription>Electron counts for CEM4 energy 4.</xtce:LongDescription>
|
|
159
|
+
</xtce:Parameter>
|
|
160
|
+
<xtce:Parameter name="SWE_CEM5_E1" parameterTypeRef="uint8">
|
|
161
|
+
<xtce:LongDescription>Electron counts for CEM5 energy 1.</xtce:LongDescription>
|
|
162
|
+
</xtce:Parameter>
|
|
163
|
+
<xtce:Parameter name="SWE_CEM5_E2" parameterTypeRef="uint8">
|
|
164
|
+
<xtce:LongDescription>Electron counts for CEM5 energy 2.</xtce:LongDescription>
|
|
165
|
+
</xtce:Parameter>
|
|
166
|
+
<xtce:Parameter name="SWE_CEM5_E3" parameterTypeRef="uint8">
|
|
167
|
+
<xtce:LongDescription>Electron counts for CEM5 energy 3.</xtce:LongDescription>
|
|
168
|
+
</xtce:Parameter>
|
|
169
|
+
<xtce:Parameter name="SWE_CEM5_E4" parameterTypeRef="uint8">
|
|
170
|
+
<xtce:LongDescription>Electron counts for CEM5 energy 4.</xtce:LongDescription>
|
|
171
|
+
</xtce:Parameter>
|
|
172
|
+
<xtce:Parameter name="SWE_CEM6_E1" parameterTypeRef="uint8">
|
|
173
|
+
<xtce:LongDescription>Electron counts for CEM6 energy 1.</xtce:LongDescription>
|
|
174
|
+
</xtce:Parameter>
|
|
175
|
+
<xtce:Parameter name="SWE_CEM6_E2" parameterTypeRef="uint8">
|
|
176
|
+
<xtce:LongDescription>Electron counts for CEM6 energy 2.</xtce:LongDescription>
|
|
177
|
+
</xtce:Parameter>
|
|
178
|
+
<xtce:Parameter name="SWE_CEM6_E3" parameterTypeRef="uint8">
|
|
179
|
+
<xtce:LongDescription>Electron counts for CEM6 energy 3.</xtce:LongDescription>
|
|
180
|
+
</xtce:Parameter>
|
|
181
|
+
<xtce:Parameter name="SWE_CEM6_E4" parameterTypeRef="uint8">
|
|
182
|
+
<xtce:LongDescription>Electron counts for CEM6 energy 4.</xtce:LongDescription>
|
|
183
|
+
</xtce:Parameter>
|
|
184
|
+
<xtce:Parameter name="SWE_CEM7_E1" parameterTypeRef="uint8">
|
|
185
|
+
<xtce:LongDescription>Electron counts for CEM7 energy 1.</xtce:LongDescription>
|
|
186
|
+
</xtce:Parameter>
|
|
187
|
+
<xtce:Parameter name="SWE_CEM7_E2" parameterTypeRef="uint8">
|
|
188
|
+
<xtce:LongDescription>Electron counts for CEM7 energy 2.</xtce:LongDescription>
|
|
189
|
+
</xtce:Parameter>
|
|
190
|
+
<xtce:Parameter name="SWE_CEM7_E3" parameterTypeRef="uint8">
|
|
191
|
+
<xtce:LongDescription>Electron counts for CEM7 energy 3.</xtce:LongDescription>
|
|
192
|
+
</xtce:Parameter>
|
|
193
|
+
<xtce:Parameter name="SWE_CEM7_E4" parameterTypeRef="uint8">
|
|
194
|
+
<xtce:LongDescription>Electron counts for CEM7 energy 4.</xtce:LongDescription>
|
|
195
|
+
</xtce:Parameter>
|
|
196
|
+
<!-- SWE -->
|
|
197
|
+
</xtce:ParameterSet>
|
|
198
|
+
<!-- End metadata -->
|
|
199
|
+
<xtce:ContainerSet>
|
|
200
|
+
<xtce:SequenceContainer name="CCSDSPacket" >
|
|
201
|
+
<xtce:EntryList>
|
|
202
|
+
<xtce:ParameterRefEntry parameterRef="VERSION" />
|
|
203
|
+
<xtce:ParameterRefEntry parameterRef="TYPE" />
|
|
204
|
+
<xtce:ParameterRefEntry parameterRef="SEC_HDR_FLG" />
|
|
205
|
+
<xtce:ParameterRefEntry parameterRef="PKT_APID" />
|
|
206
|
+
<xtce:ParameterRefEntry parameterRef="SEQ_FLGS" />
|
|
207
|
+
<xtce:ParameterRefEntry parameterRef="SRC_SEQ_CTR" />
|
|
208
|
+
<xtce:ParameterRefEntry parameterRef="PKT_LEN" />
|
|
209
|
+
</xtce:EntryList>
|
|
210
|
+
</xtce:SequenceContainer>
|
|
211
|
+
<xtce:SequenceContainer name="IALiRTPacket">
|
|
212
|
+
<xtce:BaseContainer containerRef="CCSDSPacket">
|
|
213
|
+
<xtce:RestrictionCriteria>
|
|
214
|
+
<xtce:Comparison parameterRef="PKT_APID" value="1360" useCalibratedValue="false" />
|
|
215
|
+
</xtce:RestrictionCriteria>
|
|
216
|
+
</xtce:BaseContainer>
|
|
217
|
+
<xtce:EntryList>
|
|
218
|
+
<!-- SWE -->
|
|
219
|
+
<xtce:ParameterRefEntry parameterRef="SWE_SHCOARSE"/>
|
|
220
|
+
<xtce:ParameterRefEntry parameterRef="SWE_ACQ_SEC"/>
|
|
221
|
+
<xtce:ParameterRefEntry parameterRef="SWE_ACQ_SUB"/>
|
|
222
|
+
<xtce:ParameterRefEntry parameterRef="SWE_NOM_FLAG"/>
|
|
223
|
+
<xtce:ParameterRefEntry parameterRef="SWE_OPS_FLAG"/>
|
|
224
|
+
<xtce:ParameterRefEntry parameterRef="SWE_SEQ"/>
|
|
225
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM1_E1"/>
|
|
226
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM1_E2"/>
|
|
227
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM1_E3"/>
|
|
228
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM1_E4"/>
|
|
229
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM2_E1"/>
|
|
230
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM2_E2"/>
|
|
231
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM2_E3"/>
|
|
232
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM2_E4"/>
|
|
233
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM3_E1"/>
|
|
234
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM3_E2"/>
|
|
235
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM3_E3"/>
|
|
236
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM3_E4"/>
|
|
237
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM4_E1"/>
|
|
238
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM4_E2"/>
|
|
239
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM4_E3"/>
|
|
240
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM4_E4"/>
|
|
241
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM5_E1"/>
|
|
242
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM5_E2"/>
|
|
243
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM5_E3"/>
|
|
244
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM5_E4"/>
|
|
245
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM6_E1"/>
|
|
246
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM6_E2"/>
|
|
247
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM6_E3"/>
|
|
248
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM6_E4"/>
|
|
249
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM7_E1"/>
|
|
250
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM7_E2"/>
|
|
251
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM7_E3"/>
|
|
252
|
+
<xtce:ParameterRefEntry parameterRef="SWE_CEM7_E4"/>
|
|
253
|
+
<!-- SWE -->
|
|
254
|
+
</xtce:EntryList>
|
|
255
|
+
</xtce:SequenceContainer>
|
|
256
|
+
</xtce:ContainerSet>
|
|
257
|
+
</xtce:TelemetryMetaData>
|
|
258
|
+
</xtce:SpaceSystem>
|
|
@@ -11,10 +11,10 @@ import typing
|
|
|
11
11
|
from typing import Union
|
|
12
12
|
|
|
13
13
|
import numpy as np
|
|
14
|
-
import spiceypy
|
|
14
|
+
import spiceypy
|
|
15
15
|
from numpy import ndarray
|
|
16
16
|
|
|
17
|
-
from imap_processing.spice.geometry import SpiceBody
|
|
17
|
+
from imap_processing.spice.geometry import SpiceBody, SpiceFrame, imap_state
|
|
18
18
|
from imap_processing.spice.kernels import ensure_spice
|
|
19
19
|
from imap_processing.spice.time import et_to_utc, str_to_et
|
|
20
20
|
|
|
@@ -22,30 +22,6 @@ from imap_processing.spice.time import et_to_utc, str_to_et
|
|
|
22
22
|
logger = logging.getLogger(__name__)
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
@typing.no_type_check
|
|
26
|
-
def calculate_doppler(
|
|
27
|
-
observation_time: Union[float, np.ndarray],
|
|
28
|
-
) -> Union[int, ndarray[float]]:
|
|
29
|
-
"""
|
|
30
|
-
Calculate the doppler shift. Placeholder for now.
|
|
31
|
-
|
|
32
|
-
Parameters
|
|
33
|
-
----------
|
|
34
|
-
observation_time : float or np.ndarray
|
|
35
|
-
Time at which the state of the target relative to the observer
|
|
36
|
-
is to be computed. Expressed as ephemeris time, seconds past J2000 TDB.
|
|
37
|
-
|
|
38
|
-
Returns
|
|
39
|
-
-------
|
|
40
|
-
doppler : float or np.ndarray[float]
|
|
41
|
-
Doppler shift. Currently a throwaway value.
|
|
42
|
-
"""
|
|
43
|
-
if isinstance(observation_time, np.ndarray):
|
|
44
|
-
return np.ones(len(observation_time), dtype=float)
|
|
45
|
-
else:
|
|
46
|
-
return 1
|
|
47
|
-
|
|
48
|
-
|
|
49
25
|
@typing.no_type_check
|
|
50
26
|
@ensure_spice
|
|
51
27
|
def latitude_longitude_to_ecef(
|
|
@@ -77,15 +53,14 @@ def latitude_longitude_to_ecef(
|
|
|
77
53
|
# Retrieve Earth's radii from SPICE
|
|
78
54
|
# https://spiceypy.readthedocs.io/en/main/documentation.html#spiceypy.spiceypy.bod
|
|
79
55
|
# (url cont.) vrd
|
|
80
|
-
radii =
|
|
56
|
+
radii = spiceypy.bodvrd("EARTH", "RADII", 3)[1]
|
|
81
57
|
equatorial_radius = radii[0] # Equatorial radius in km
|
|
82
58
|
polar_radius = radii[2] # Polar radius in km
|
|
83
59
|
flattening = (equatorial_radius - polar_radius) / equatorial_radius
|
|
84
60
|
|
|
85
61
|
# Convert geodetic coordinates to rectangular coordinates
|
|
86
|
-
# https://spiceypy.readthedocs.io/en/main/documentation.html#spiceypy.spiceypy.
|
|
87
|
-
|
|
88
|
-
rect_coords = spice.georec(
|
|
62
|
+
# https://spiceypy.readthedocs.io/en/main/documentation.html#spiceypy.spiceypy.georec
|
|
63
|
+
rect_coords = spiceypy.georec(
|
|
89
64
|
longitude_radians, latitude_radians, altitude, equatorial_radius, flattening
|
|
90
65
|
)
|
|
91
66
|
|
|
@@ -99,7 +74,7 @@ def calculate_azimuth_and_elevation(
|
|
|
99
74
|
latitude: float,
|
|
100
75
|
altitude: float,
|
|
101
76
|
observation_time: Union[float, np.ndarray],
|
|
102
|
-
target:
|
|
77
|
+
target: str = SpiceBody.IMAP.name,
|
|
103
78
|
) -> tuple:
|
|
104
79
|
"""
|
|
105
80
|
Calculate azimuth and elevation.
|
|
@@ -127,7 +102,9 @@ def calculate_azimuth_and_elevation(
|
|
|
127
102
|
elevation : np.ndarray
|
|
128
103
|
Elevation in degrees.
|
|
129
104
|
"""
|
|
130
|
-
|
|
105
|
+
ground_station_position_ecef = latitude_longitude_to_ecef(
|
|
106
|
+
longitude, latitude, altitude
|
|
107
|
+
)
|
|
131
108
|
|
|
132
109
|
if not isinstance(observation_time, np.ndarray):
|
|
133
110
|
observation_time = [observation_time]
|
|
@@ -137,14 +114,14 @@ def calculate_azimuth_and_elevation(
|
|
|
137
114
|
|
|
138
115
|
# https://spiceypy.readthedocs.io/en/main/documentation.html#spiceypy.spiceypy.azlcpo
|
|
139
116
|
for timestamp in observation_time:
|
|
140
|
-
azel_results =
|
|
117
|
+
azel_results = spiceypy.azlcpo(
|
|
141
118
|
method="Ellipsoid", # Only method supported
|
|
142
119
|
target=target, # target ephemeris object
|
|
143
120
|
et=timestamp, # time of observation
|
|
144
121
|
abcorr="LT+S", # Aberration correction
|
|
145
122
|
azccw=False, # Azimuth measured clockwise from the positive y-axis
|
|
146
123
|
elplsz=True, # Elevation increases from the XY plane toward +Z
|
|
147
|
-
obspos=
|
|
124
|
+
obspos=ground_station_position_ecef, # observer pos. to center of motion
|
|
148
125
|
obsctr="EARTH", # Name of the center of motion
|
|
149
126
|
obsref="IAU_EARTH", # Body-fixed, body-centered reference frame wrt
|
|
150
127
|
# observer's center
|
|
@@ -152,12 +129,66 @@ def calculate_azimuth_and_elevation(
|
|
|
152
129
|
azimuth.append(np.rad2deg(azel_results[0][1]))
|
|
153
130
|
elevation.append(np.rad2deg(azel_results[0][2]))
|
|
154
131
|
|
|
155
|
-
# TODO: potentially use the velocity components returned from azlcpo to
|
|
156
|
-
# TODO: calculate doppler
|
|
157
|
-
|
|
158
132
|
return np.asarray(azimuth), np.asarray(elevation)
|
|
159
133
|
|
|
160
134
|
|
|
135
|
+
@typing.no_type_check
|
|
136
|
+
def calculate_doppler(
|
|
137
|
+
longitude: float,
|
|
138
|
+
latitude: float,
|
|
139
|
+
altitude: float,
|
|
140
|
+
observation_time: Union[float, np.ndarray],
|
|
141
|
+
) -> Union[float, ndarray[float]]:
|
|
142
|
+
"""
|
|
143
|
+
Calculate the doppler velocity.
|
|
144
|
+
|
|
145
|
+
Notes about the spkezr function (wrapped in imap_state):
|
|
146
|
+
The function returns the state of the target (state) and the light time.
|
|
147
|
+
The first three components of state represent the x-, y- and z-components of the
|
|
148
|
+
target's position; the last three components form the corresponding velocity vector.
|
|
149
|
+
|
|
150
|
+
Parameters
|
|
151
|
+
----------
|
|
152
|
+
longitude : float
|
|
153
|
+
Longitude in decimal degrees. Positive east of prime meridian,
|
|
154
|
+
negative to west.
|
|
155
|
+
latitude : float
|
|
156
|
+
Latitude in decimal degrees. Positive north of equator, negative
|
|
157
|
+
to south.
|
|
158
|
+
altitude : float
|
|
159
|
+
Altitude in kilometers.
|
|
160
|
+
observation_time : float or np.ndarray
|
|
161
|
+
Time at which the state of the target relative to the observer
|
|
162
|
+
is to be computed. Expressed as ephemeris time, seconds past J2000 TDB.
|
|
163
|
+
|
|
164
|
+
Returns
|
|
165
|
+
-------
|
|
166
|
+
doppler : float or np.ndarray[float]
|
|
167
|
+
Doppler velocity in kilometers per second.
|
|
168
|
+
"""
|
|
169
|
+
ground_station_position_ecef = latitude_longitude_to_ecef(
|
|
170
|
+
longitude, latitude, altitude
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
# find position and velocity relative to the center of the earth using spice spkezr
|
|
174
|
+
# https://spiceypy.readthedocs.io/en/main/documentation.html#spiceypy.spiceypy.spkezr
|
|
175
|
+
state = imap_state(
|
|
176
|
+
et=observation_time,
|
|
177
|
+
ref_frame=SpiceFrame.ITRF93,
|
|
178
|
+
abcorr="LT+S",
|
|
179
|
+
observer=SpiceBody.EARTH,
|
|
180
|
+
)
|
|
181
|
+
# shifting position by subtracting ground station location relative to the center
|
|
182
|
+
# of the earth
|
|
183
|
+
state[..., 0:3] -= ground_station_position_ecef
|
|
184
|
+
# calculate radial velocity
|
|
185
|
+
doppler = np.sum(state[..., 3:6] * state[..., 0:3], axis=-1) / np.linalg.norm(
|
|
186
|
+
state[..., 0:3], axis=-1
|
|
187
|
+
)
|
|
188
|
+
|
|
189
|
+
return np.asarray(doppler)
|
|
190
|
+
|
|
191
|
+
|
|
161
192
|
def build_output(
|
|
162
193
|
longitude: float,
|
|
163
194
|
latitude: float,
|
|
@@ -193,8 +224,7 @@ def build_output(
|
|
|
193
224
|
stop_et_input = str_to_et(time_endpoints[1])
|
|
194
225
|
time_range = np.arange(start_et_input, stop_et_input, time_step)
|
|
195
226
|
|
|
196
|
-
# For now, assume that kernel management will be handled by
|
|
197
|
-
# for obs_time in np.arange(start_et_input, stop_et_input, time_step):
|
|
227
|
+
# For now, assume that kernel management will be handled by ensure_spice
|
|
198
228
|
azimuth, elevation = calculate_azimuth_and_elevation(
|
|
199
229
|
longitude, latitude, altitude, time_range
|
|
200
230
|
)
|
|
@@ -202,7 +232,9 @@ def build_output(
|
|
|
202
232
|
output_dict["time"] = et_to_utc(time_range, format_str="ISOC")
|
|
203
233
|
output_dict["azimuth"] = azimuth
|
|
204
234
|
output_dict["elevation"] = elevation
|
|
205
|
-
output_dict["doppler"] = calculate_doppler(
|
|
235
|
+
output_dict["doppler"] = calculate_doppler(
|
|
236
|
+
longitude, latitude, altitude, time_range
|
|
237
|
+
)
|
|
206
238
|
|
|
207
239
|
logger.info(
|
|
208
240
|
f"Calculated azimuth, elevation and doppler for time range from "
|