keteutils.propagate.calc_geometries
keteutils.propagate.calc_geometries(
simulstates,
center=10,
do_alpha=True,
do_dists=True,
do_radec=True,
do_hel_ecl=True,
do_obs_ecl=True,
do_galactic=True,
rates_in_arcsec_per_min=True,
pole=None,
spin=None,
do_lunar_elong=True,
)Calculate phase angle alpha, elongations, distances, and lon/lats.
Requires kete: This function needs kete to be installed. Install with: pip install skyloc[kete]
Parameters
simulstates :~kete.SimultaneousStates-
The simultaneous states of the objects.
center : int, default = 10-
The center of the light source. Default is 10 (Sun).
do_alpha : bool, default = True-
If
True, calculate the phase angle, heliocentric/observer-centric distances, right ascension and declination, heliocentric ecliptic coordinates, observer-centric ecliptic coordinates, and galactic coordinates, respectively. Default isTruefor all. Note that ifdo_alpha=True, distances (r_hel, r_obs) are always computed and included in the output because they are required for the phase angle calculation. do_dists : bool, default = True-
If
True, calculate the phase angle, heliocentric/observer-centric distances, right ascension and declination, heliocentric ecliptic coordinates, observer-centric ecliptic coordinates, and galactic coordinates, respectively. Default isTruefor all. Note that ifdo_alpha=True, distances (r_hel, r_obs) are always computed and included in the output because they are required for the phase angle calculation. do_radec : bool, default = True-
If
True, calculate the phase angle, heliocentric/observer-centric distances, right ascension and declination, heliocentric ecliptic coordinates, observer-centric ecliptic coordinates, and galactic coordinates, respectively. Default isTruefor all. Note that ifdo_alpha=True, distances (r_hel, r_obs) are always computed and included in the output because they are required for the phase angle calculation. do_hel_ecl : bool, default = True-
If
True, calculate the phase angle, heliocentric/observer-centric distances, right ascension and declination, heliocentric ecliptic coordinates, observer-centric ecliptic coordinates, and galactic coordinates, respectively. Default isTruefor all. Note that ifdo_alpha=True, distances (r_hel, r_obs) are always computed and included in the output because they are required for the phase angle calculation. do_obs_ecl : bool, default = True-
If
True, calculate the phase angle, heliocentric/observer-centric distances, right ascension and declination, heliocentric ecliptic coordinates, observer-centric ecliptic coordinates, and galactic coordinates, respectively. Default isTruefor all. Note that ifdo_alpha=True, distances (r_hel, r_obs) are always computed and included in the output because they are required for the phase angle calculation. do_galactic : bool, default = True-
If
True, calculate the phase angle, heliocentric/observer-centric distances, right ascension and declination, heliocentric ecliptic coordinates, observer-centric ecliptic coordinates, and galactic coordinates, respectively. Default isTruefor all. Note that ifdo_alpha=True, distances (r_hel, r_obs) are always computed and included in the output because they are required for the phase angle calculation. rates_in_arcsec_per_min : bool, default = True-
If
True, the rates of right ascension and declination will be converted to arcsec/min. Default isTrue. IfFalse, they will be in degrees/day (kete default). pole :~skyloc.geometry.Pole, default = None-
Spin-axis pole. If provided,
subsol_latandsubobs_latare added to output. spin :~skyloc.geometry.IAUSpin, dict, orNone, default = None-
IAU spin model, or spin/pole models keyed by state designation. Complete
~skyloc.geometry.IAUSpinmodels addsubsol_lon,subobs_lon, anddhour_obs(degrees, afternoon-positive in the frozen-Sun convention of~skyloc.geometry.calc_subpoints);~skyloc.geometry.Polemodels add latitude columns only. Epochs follow input state epochs; normal skyloc/Kete ephemeris states are already observer-light-time corrected. Unmatched mapping entries do not add subpoint columns. do_lunar_elong : bool, default = True-
If
True, addlunar_elong. This needs three Kete SPICE Moon lookups per call (geometric, then two light-time iterations). Default isTrue.
Returns
geoms : dict-
The geometries of the objects, including the following:
- alpha : np.ndarray The phase angles (Sun-Object-Observer) in degrees.
- elong : np.ndarray The solar elongation angles (Target-Observer-Sun) in degrees, in the range
[0, 180]. - elong_lead : np.ndarray Boolean leading/trailing flag.
Truemeans that the target is west of the Sun in RA as seen from the observer,wrap180(RA_target - RA_sun) < 0(morning sky; the target rises before the Sun). This matches the Horizons “/L” flag.Falsematches “/T”. - lunar_elong : np.ndarray The lunar elongation angles (Target-Observer-Moon) in degrees, in the range
[0, 180]. Only ifdo_lunar_elongisTrue. - r_hel, r_obs : np.ndarray The heliocentric and observer-centric distances in AU.
- ra, dec : np.ndarray The observer-centric (J2000) right ascension and declination in degrees.
- racosdec_rate, dec_rate : np.ndarray The observer-centric (J2000) right ascension and declination rates in degrees per day (or arcsec/min if
rates_in_arcsec_per_minisTrue). - hel_ecl_lons, hel_ecl_lats : np.ndarray The heliocentric ecliptic longitudes and latitudes in degrees.
- obs_ecl_lons, obs_ecl_lats : np.ndarray The observer-centric ecliptic longitudes and latitudes in degrees (e.g., the observer is the Earth).
- glx_lon, glx_lat : np.ndarray Galactic longitude (l, in [0, 360)) and latitude (b) in degrees.
- sky_motion, sky_motion_pa : np.ndarray The apparent angular rate of the target in the plane-of-sky in degrees/day (or arcsec/min if
rates_in_arcsec_per_minisTrue), and the position angle in degrees. PA is positive if RA rate is positive (i.e., measured counter-clockwise from the apparent of-date north pole direction, which is identical to JPL Horizons) - sun_target_pa : np.ndarray The position angle of the Sun-to-target direction as seen from the observer, projected onto the plane of sky at the object’s position. Measured East-of-North in degrees, with the same sign convention as
sky_motion_pa(i.e., positive toward East). Only computed whendo_radec=True. Equivalent to thesunTargetPAcolumn in JPL Horizons.
Notes
Takes ~1 ms for 1000 objects (MBP 14” [2024, macOS 15.2, M4Pro(8P+4E/G20c/N16c/48G)])
The ecliptic-to-equatorial rotation used for sun_target_pa is performed by ecl2eq (from skyloc.keteutils.statevec), which applies the IAU 1976 mean obliquity at J2000.0 (84381.448 arcsec), the value of SPICE’s ECLIPJ2000 frame.
For lunar_elong, the Moon position is taken at the observer epoch minus the observer-Moon light time, the same light-time convention as the target states. Two light-time iterations leave a Moon position error of at most about 0.4 mm. Stellar aberration is not applied, as for the targets.
Kete computes the observer-to-target vector as the target’s heliocentric position at the emission time minus the observer’s heliocentric position at the observation time. The Sun moves around the solar-system barycenter during the light travel time, and this motion is not included. The resulting RA/Dec error is the Sun’s barycentric velocity component perpendicular to the line of sight, divided by c. It does not depend on r_hel or r_obs. The Sun’s barycentric speed is 8.5-16.1 m/s over 1900-2100 (DE440s), so the error is at most 11 mas. skyloc does not correct it.