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 ofkete.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 fromget_default_spice_targets(). Default isNone. include_planets : bool, default = True-
If
Trueand targets isNone, include default planets. Default isTrue. include_asteroids : bool, default = True-
If
Trueand targets isNone, include the major asteroids. Default isTrue.
Attributes
targets : list of str-
The target names being located.
fov_check_simstates : list ofkete.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_colsbefore saving. The saved file can be loaded with~skyloc.ioutils.ephemeris.load_compact_parq_ephem. Default isTrue. add_obsid : bool, default = True-
If
True, add “obsid” column. Default isTrue. drop_obsindex : bool, default = True-
If
True, drop “obsindex” column. Default isTrue. add_jds : bool, default = True-
If
True, add “jd_tdb” and “jd_utc” columns. Default isTrue. output : str or Path, default = None-
Output parquet file path. Default is
None. overwrite : bool, default = False-
If
True, overwrite existing output file. Default isFalse. 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 withcalc_geometries. Complete~skyloc.geometry.IAUSpininstances populate sub-solar and sub-observer coordinates (subsol_lat,subobs_lat,subsol_lon,subobs_lon,dhour_obs).~skyloc.geometry.Poleinstances populate subpoint latitudes only. Target-state epochs retarded by light-time are preserved during spin orientation evaluation. Sequences or non-mapping inputs raiseTypeError. Default isNone. lunar_elong : bool, default = True-
If
True, add the"lunar_elong"column (Target-Observer-Moon angle in degrees). Default isTrue.
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 SimultaneousStatesself.fov_check_fov2objs: Dict mapping FOV desig -> list of visible objectsself.fov_check_objids: List of unique visible object names
load_spice
core.SpiceLocator.load_spice(fpaths)Load additional SPK kernels on top of the loaded kernels.
Parameters
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.