core.calc_ephems

core.calc_ephems(
    orb,
    simulstates,
    gpar_default=0.15,
    rates_in_arcsec_per_min=True,
    add_jds=False,
    sort_by=['vmag'],
    compact=True,
    output='eph.parq',
    overwrite=False,
    spins=None,
    lunar_elong=True,
    *,
    add_obsid=False,
    drop_obsindex=False,
    **kwargs,
)

Calculate ephemerides for the objects in the FOV. Run _calc_ephem for multiple SimultaneousStates

Parameters

orb : ~pandas.DataFrame

Orbit data with columns of orbital elements.

simulstates : iterable of ~kete.SimultaneousStates

Simultaneous states of the objects in the FOV. It is recommended each element has .fov.observer.desig.

gpar_default : float, default = 0.15

Default slope parameter (G in the IAU H, G model) for the objects. Default is 0.15.

rates_in_arcsec_per_min : bool, default = True

If True, the rates will be in arcsec/min instead of degrees/day. Default is True.

add_jds : bool, default = False

If True, add two columns "jd_tdb", "jd_utc" for the Julian date (TDB) and (UTC) to the output DataFrame. Default is False. Many times it is redundant to calculate both, but because general users prefer UTC while all N-body calculations are done in TDB, generating both at the same time makes code easier. Depending on the disk/ram usage, the user can drop the unnecessary column.

sort_by : list, default = ['vmag']

List of columns to sort the output DataFrame by. Default is ["vmag"].

compact : bool, default = True

If True, apply advanced compression to the output DataFrame using ~skyloc.ioutils.ephemeris.compact_ephem_parq_cols (integer scaling + HEALPix coordinate encoding) before saving. This significantly reduces file size at the cost of precision (typically sub-arcsecond for coordinates, <1 mmag for vmag). The saved file can be loaded with ~skyloc.ioutils.ephemeris.load_compact_parq_ephem. Default is True.

output : str or ~pathlib.Path, default = 'eph.parq'

Path to the output file where the ephemerides will be saved in Parquet format. Default is "eph.parq". If None, no output file is saved.

overwrite : bool, default = False

If True, overwrite the output file if it already exists. Default is False.

spins : dict or None, default = None

Spin/pole models keyed by object designation. If provided, matching objects receive sub-observer/sub-solar point columns.

lunar_elong : bool, default = True

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

add_obsid : bool, default = False

Include observer designations and omit the integer observer index, respectively, in both the returned and saved ephemerides. Both default to False.

drop_obsindex : bool, default = False

Include observer designations and omit the integer observer index, respectively, in both the returned and saved ephemerides. Both default to False.

**kwargs : dict

Additional keyword arguments to pass to pandas.DataFrame.to_parquet().

Returns

dfs : ~pandas.DataFrame

DataFrame containing the ephemerides of the objects in the FOV.

obsids : list of str

List of observer designations for “obsindex” column in dfs. The true designation can be found as dfs["obsindex"].apply(lambda x: obsids[x]). But doing this might increase the memory usage a lot because of long strings in the obsids list.

Notes

Included columns are:: - alpha : The phase angles (Sun-Object-Observer) in degrees. - elong : The solar elongation angles (Target-Observer-Sun) in degrees, in the range [0, 180]. - elong_lead : Boolean leading/trailing flag. True means 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. False matches “/T”. - lunar_elong : The lunar elongation angles (Target-Observer-Moon) in degrees, in the range [0, 180]. Only if lunar_elong is True. - r_hel, r_obs : The heliocentric and observer-centric distances in AU. - ra, dec : The observer-centric (J2000) right ascension and declination in degrees. - racosdec_rate, dec_rate : The observer-centric (J2000) right ascension and declination rates in degrees per day (or arcsec/min if rates_in_arcsec_per_min is True). - hel_ecl_lons, hel_ecl_lats : The heliocentric ecliptic longitudes and latitudes in degrees. - obs_ecl_lons, obs_ecl_lats : The observer-centric ecliptic longitudes and latitudes in degrees (e.g., the observer is the Earth). - sky_motion, sky_motion_pa : The apparent angular rate of the target in the plane-of-sky in degrees/day (or arcsec/min if rates_in_arcsec_per_min is True), 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 : 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. Equivalent to JPL Horizons’ sunTargetPA column. - vmag : The apparent magnitude of the object in V-band based on IAU H, G magnitude system or comet N-/T-mag system from Horizons. nanmin of those values will be used (i.e., T-mag for comets whenever possible). - obsindex : The index of the observer of simulstates, starting from 0. - jd_tdb, jd_utc : The Julian date (TDB) and (UTC) in days. (only if add_jds is True)