core.SSOLocator
core.SSOLocator(
fovs,
orb,
simstates=None,
non_gravs=True,
copy_orb=False,
drop_major_asteroids=True,
spice_asteroid_orb=None,
spins=None,
)A class to locate Solar System Objects (SSOs) in a given Field of View (FOV).
This class provides methods to propagate orbits, check if objects are in the FOV, and calculate ephemerides for the objects.
Attributes
fovs : FOVCollection-
A collection of FOVs to check against.
Methods
| Name | Description |
|---|---|
| init | |
| propagate_n_body | Propagate the orbits to the start epoch jd0. |
| fov_state_check | Check which objects are in the FOVs after propagation. |
| calc_ephems | Calculate ephemerides for the objects in the FOVs. |
init
core.SSOLocator.__init__(
fovs,
orb,
simstates=None,
non_gravs=True,
copy_orb=False,
drop_major_asteroids=True,
spice_asteroid_orb=None,
spins=None,
)Parameters
fovs : FOVCollection, or iterable ofkete.fov.FOV-
Field of View(s) to check the propagated states against.
orb :pandas.DataFrame-
Orbit file with columns of orbital elements. See
query.fetch_orb(). simstates :~kete.SimultaneousStates, path-like, orNone, default = None-
Pre-propagated states at a common epoch, or a Parquet path read by
~skyloc.keteutils.load_simstates.propagate_n_bodyreuses them when itsjd0isNoneor withinjd0_tolof their epoch; otherwise it starts fromorb. File paths load without catalog-fingerprint validation. IfNone, callpropagate_n_bodybeforefov_state_check. Default isNone. non_gravs : sequence or bool, default = True-
An explicit sequence contains one
kete.NonGravModelorNoneper row of either the inputorbor the N-body orbit table after dropping the major asteroids. Use the row order of the corresponding table. Models for dropped rows are unused. IfTrue,keteutils.make_nongravs_modelswill be used, i.e., objects with non-gravitational terms will have non-gravitational models bykete.NonGravModel.new_comet(). IfFalse, no non-gravitational terms will be used for any object. Default isTrue. copy_orb : bool, default = False-
If
True, copy theorbDataFrame. Default isFalse. drop_major_asteroids : bool, default = True-
If
True, the major asteroids (1 Ceres, 2 Pallas, 4 Vesta, 10 Hygiea, and 704 Interamnia) are dropped fromorbbefore N-body propagation. Their orbits are stored inself._spice_asteroid_orband checked via SPICE infov_state_check(whenuse_spice_for_loaded=True). Default isTrue. spice_asteroid_orb :pandas.DataFrameorNone, default = None-
Orbit rows for the SPICE-loadable asteroids, used instead of extracting them automatically from
orb. Useful in the 2nd pass oflocator_twiceto pass an already-filtered subset. IfNone, rows are extracted fromorbby designation. Default isNone. spins : dict or sequence orNone, default = None-
Spin/pole models for sub-observer/sub-solar point calculation. Mapping keys are
"desig"values inorb. Sequences are row-aligned toorband normalized at construction time;Noneentries are ignored. Spin/pole models do not affect propagation.
propagate_n_body
core.SSOLocator.propagate_n_body(
jd0=None,
jd0_tol=1e-05,
suppress_errors=True,
include_asteroids=False,
objmask=None,
output=None,
overwrite=False,
)Propagate the orbits to the start epoch jd0.
Parameters
jd0 : float, callable, or None, default = None-
Start epoch (TDB JD). A float is the epoch itself, and a callable (e.g.,
np.mean) computes it from the FOV epochs,self.fovc.fov_jds.Noneuses the states that already exist, at their own epoch: first the states of this locator (fromsimstatesor an earlier call, unlessjd0_tolis0), then an existingoutputfile (unlessoverwrite). If there are none, the epoch is the earliest FOV epoch with kete (>=3.3), and the middle of the FOV epochs,(min + max) / 2, with kete_ipac (v1.x). See Notes for why. Default isNone. jd0_tol : float, default = 1e-05-
Finite, non-negative epoch tolerance in days. Reuse existing states when their epoch differs from
jd0by strictly less than this value andobjmaskisNone.0disables this reuse. Default is1e-5days (0.864 seconds). Reused states retain their epoch; this is not a positional accuracy guarantee. Existingoutputfiles still load whenoverwrite=False. suppress_errors : bool, default = True-
If
True, errors during propagation will return NaN for the relevant state vectors, but propagation will continue. Default isTrue. include_asteroids : bool, default = False-
If
True, include asteroids in the propagation. Default isFalse. objmask : array-like, default = None-
A boolean mask to select which objects to propagate. It will select such as
self.states_from_orb[objmask]to run the propagation on subset of the objects. Thus, it must have the length same asself.states_from_orb, i.e., same asself.orb. Default isNone. output : str or~pathlib.Path, default = None-
If provided, save the propagated states to a Parquet file with
~skyloc.keteutils.save_simstates. Default isNone. overwrite : bool, default = False-
If
True, re-do the calculation and overwrite the existing output file if it exists. IfFalse, theoutputwill be loaded if it exists. Default isFalse.
Notes
Default epoch. The FOV check of kete (>=3.3) first propagates every object to the earliest FOV epoch, so starting there saves one N-body run. The FOV check of kete_ipac (v1.x) uses a 2-body step for each FOV within dt_limit days of the state epoch, and the middle of the FOV epochs makes the longest such step as short as possible.
Output file. If output is provided and the file already exists, and overwrite is False, the function will load the existing file instead of redoing the calculation. The loaded states keep the epoch of the file. A float or callable jd0 that differs from it by jd0_tol days or more raises ValueError. Nothing else is checked, so a completely meaningless result can be returned if the file is not up to date.
fov_state_check
core.SSOLocator.fov_state_check(
dt_limit=None,
include_asteroids=False,
use_spice_for_loaded=True,
include_planets=False,
spice_targets=None,
)Check which objects are in the FOVs after propagation.
Parameters
dt_limit : float or None, default = None-
Time span in days within which kete_ipac (v1.x) replaces N-body with a 2-body step.
Nonemeans3.0days with kete_ipac (v1.x). kete (>=3.3) is exact N-body and ignores it, with aUserWarningif a value is given. Default isNone. include_asteroids : bool, default = False-
If
True, passinclude_asteroids=Truetokete.fov.fov_state_check, enabling perturbation by the major asteroids during N-body propagation. Default isFalse. use_spice_for_loaded : bool, default = True-
If
Trueanddrop_major_asteroids=True, use SPICE kernels to locate the major asteroids in the FOVs. Has no effect whendrop_major_asteroids=Falsebecause those asteroids were already propagated N-body and will be found (or not) via the N-body FOV check. Default isTrue. include_planets : bool, default = False-
If
True, also check planets via SPICE usingget_default_spice_targets(include_planets=True). Default isFalse. spice_targets : list of str, default = None-
Additional SPICE-resolvable target names or IDs to check via
kete.fov.fov_spice_check. Deduplicated against other targets. Default isNone.
Notes
Sets the following attributes after the check:
self.fov_check_simstates : list of kete.SimultaneousStates Combined N-body and SPICE results (all FOVs with any object).
self.fov_check_spice_simstates : list of kete.SimultaneousStates SPICE-only results; empty list if no SPICE targets were checked.
self.fov_check_fov2objs : dict Maps each FOV designation (str) to a list of object designations visible in that FOV.
self.fov_check_objids : list of str Unique object designations visible in at least one FOV.
self.fov_mask_hasobj : np.ndarray of bool Boolean mask over self.fovc selecting FOVs that contain objects.
self.fovc_hasobj : FOVCollection Sub-collection of FOVs that contain at least one object.
self.orb_infov_mask : np.ndarray of bool Boolean mask over self.orb for objects found in any FOV.
self.spice_asteroid_infov_mask : np.ndarray of bool Boolean mask over self._spice_asteroid_orb for the major asteroids found in any FOV.
calc_ephems
core.SSOLocator.calc_ephems(
gpar_default=0.15,
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 the objects in the FOVs.
add_obsid : bool, optional If True, the ephemerides will have a column “obsid” with the observer designations. This may increase memory usage significantly, especially if there are many str obsids for millions of rows. Default is True.
drop_obsindex : bool, optional If True, the “obsindex” column will be dropped from the ephemerides. This is useful especially if add_obsid is True. Default is True.
spins : dict or sequence or None, optional Per-call spin/pole model override. If None, constructor spins are used. Mapping keys are "desig" values; sequences are row-aligned to the original constructor orb.
lunar_elong : bool, optional If True, add the "lunar_elong" column (Target-Observer-Moon angle in degrees). Default is True.