1111from imap_data_access import SPICEFilePath
1212from numpy .typing import NDArray
1313
14- from imap_processing .spice .geometry import SpiceFrame , frame_transform
14+ from imap_processing .spice import IMAP_SC_ID
15+ from imap_processing .spice .geometry import SpiceBody , SpiceFrame , frame_transform
1516from imap_processing .spice .repoint import get_repoint_data
1617from imap_processing .spice .time import (
1718 TICK_DURATION ,
@@ -217,10 +218,6 @@ def calculate_pointing_attitude_segments(
217218 f"Extracting mean spin axes for all Pointings that are"
218219 f" fully covered by the CK files: { [p .name for p in ck_paths ]} "
219220 )
220- # Get IDs.
221- # https://spiceypy.readthedocs.io/en/main/documentation.html#spiceypy.spiceypy.gipool
222- id_imap_sclk = spiceypy .gipool ("CK_-43000_SCLK" , 0 , 1 )
223- id_imap_spacecraft = spiceypy .gipool ("FRAME_IMAP_SPACECRAFT" , 0 , 1 )
224221
225222 # This job relies on the batch starter to provide all the correct CK kernels
226223 # to cover the time range of the new repoint table.
@@ -230,7 +227,7 @@ def calculate_pointing_attitude_segments(
230227 et_end = - np .inf
231228 for ck_path in ck_paths :
232229 ck_cover = spiceypy .ckcov (
233- str (ck_path ), int ( id_imap_spacecraft ) , True , "INTERVAL" , 0 , "TDB"
230+ str (ck_path ), SpiceBody . IMAP_SPACECRAFT . value , True , "INTERVAL" , 0 , "TDB"
234231 )
235232 num_intervals = spiceypy .wncard (ck_cover )
236233 individual_ck_start , _ = spiceypy .wnfetd (ck_cover , 0 )
@@ -308,10 +305,10 @@ def calculate_pointing_attitude_segments(
308305 # https://spiceypy.readthedocs.io/en/main/documentation.html#spiceypy.spiceypy.sce2c
309306 # Convert start and end times to SCLK ticks.
310307 pointing_segments [i_pointing ]["start_sclk_ticks" ] = spiceypy .sce2c (
311- int ( id_imap_sclk ) , pointing_start_et
308+ IMAP_SC_ID , pointing_start_et
312309 )
313310 pointing_segments [i_pointing ]["end_sclk_ticks" ] = spiceypy .sce2c (
314- int ( id_imap_sclk ) , pointing_end_et
311+ IMAP_SC_ID , pointing_end_et
315312 )
316313
317314 return pointing_segments
0 commit comments