core.SpiceLocator

core.SpiceLocator(
    fovs,
    targets=None,
    include_planets=True,
    include_asteroids=True,
)

A class to locate objects in a given Field of View (FOV) using SPICE.

This locator uses SPICE kernels to compute ephemerides for planets, satellites, and the major asteroids. It bypasses N-body propagation, which can produce NaN for objects that are also perturbers, such as the major asteroids.

Parameters

fovs : FOVCollection, or iterable of kete.FOV

Field of View(s) to check against.

targets : list of str, default = None

List of target names to locate. These must be SPICE-resolvable names (planets, satellites, or the major asteroids). If None, uses default targets from get_default_spice_targets(). Default is None.

include_planets : bool, default = True

If True and targets is None, include default planets. Default is True.

include_asteroids : bool, default = True

If True and targets is None, include the major asteroids. Default is True.

Attributes

targets : list of str

The target names being located.

fov_check_simstates : list of kete.SimultaneousStates

Results from fov_spice_check after calling fov_spice_check().

fov_check_fov2objs : dict

Mapping of FOV designations to lists of visible object names.

fov_check_objids : list of str

Unique object names visible in at least one FOV.

Methods

Name Description
calc_ephems Calculate ephemerides for SPICE objects in the FOVs.
fov_spice_check Check which SPICE targets are visible in the FOVs.
load_spice Load additional SPK kernels on top of the loaded kernels.

calc_ephems

core.SpiceLocator.calc_ephems(
    sort_by=['vmag'],
    compact=True,
    add_obsid=True,
    drop_obsindex=True,
    add_jds=True,
    output=None,
    overwrite=False,
    spins=None,
    lunar_elong=True,
)

Calculate ephemerides for SPICE objects in the FOVs.

Parameters

sort_by : list, default = ['vmag']

Columns to sort by. Default is ["vmag"].

compact : bool, default = True

If True, apply advanced compression using ~skyloc.ioutils.ephemeris.compact_ephem_parq_cols before saving. The saved file can be loaded with ~skyloc.ioutils.ephemeris.load_compact_parq_ephem. Default is True.

add_obsid : bool, default = True

If True, add “obsid” column. Default is True.

drop_obsindex : bool, default = True

If True, drop “obsindex” column. Default is True.

add_jds : bool, default = True

If True, add “jd_tdb” and “jd_utc” columns. Default is True.

output : str or Path, default = None

Output parquet file path. Default is None.

overwrite : bool, default = False

If True, overwrite existing output file. Default is False.

spins : Mapping or None, default = None

Opt-in spin/pole models keyed by target designation as emitted in the SPICE states (for example lowercase "ceres" or "vesta" for the major asteroids, or "mars barycenter"). Keys must match the emitted state designations exactly; unmatched mapping keys are ignored, consistent with calc_geometries. Complete ~skyloc.geometry.IAUSpin instances populate sub-solar and sub-observer coordinates (subsol_lat, subobs_lat, subsol_lon, subobs_lon, dhour_obs). ~skyloc.geometry.Pole instances populate subpoint latitudes only. Target-state epochs retarded by light-time are preserved during spin orientation evaluation. Sequences or non-mapping inputs raise TypeError. Default is None.

lunar_elong : bool, default = True

If True, add the "lunar_elong" column (Target-Observer-Moon angle in degrees). Default is True.

fov_spice_check

Check which SPICE targets are visible in the FOVs.

Uses kete.fov.fov_spice_check() to determine visibility of planets, satellites, and the major asteroids.

Results are stored in:

  • self.fov_check_simstates: List of SimultaneousStates
  • self.fov_check_fov2objs: Dict mapping FOV desig -> list of visible objects
  • self.fov_check_objids: List of unique visible object names

load_spice

Load additional SPK kernels on top of the loaded kernels.

Parameters

fpaths : str, Path, or list of str or Path

Path(s) to SPK (.bsp) files, e.g., planetary satellite kernels.

Notes

Kete has no public function that adds SPK files without first clearing all kernels (kete.spice.kernel_reload clears them), so this calls kete._core.spk_load, which exists in kete_ipac (v1.x) and kete (>=3.3). Where an added file and a loaded kernel cover the same object and time, kete (>=3.3) uses the file loaded last and kete_ipac (v1.x) uses the file loaded first.