query_horizons_small_bodies¶
- grizli.horizons.query_horizons_small_bodies(assoc='j100028p0218_cosmos-1-f1800w_00157', coords=None, mjd_range=None, prefix='user', with_db=True, sb_ident_params='&two-pass=true&suppress-first-pass=true', query_arcmin=15, ephem_steps=256, make_plot=True, plot_all_tracks=False)[source]¶
Query the Horizons Small Body Identification tool at the epoch and pointing location of the exposures in a grizli/dja association.
The script first queries Horizons to “observe” the spacecraft from the Earth geocenter to get its time-dependent position, then queries the sb_ident API.
The spacecraft is specified in the
SPACECRAFT_BODY_CODEandSPACECRAFT_MPCglobal variables, where the first is used to retrieve the spacecraft geocentric position and velocity vectors and the latter is used to generate the SB ephemerides as observed by the spacecraft. The defaults are set for JWST:JWST_MPC = "500@-170"andJWST_BODY_CODE = "2021-130A".Note
Note that the sb_ident query can take several minutes to complete. It also seems to timeout if more than ~2 queries are sent simultaneously.
- Parameters
- assocstr
Association name
- coords(float, float), None
Coordinates to query. Both
coordsandmjd_rangemust be specified for manual input- mjd_range[float, float]
Begginning and end MJD times to query. The spacecraft location is computed at
mean(mjd_range).- prefixstr
File prefix for output when
coordsandmjd_rangeprovided- with_dbbool
Get assoc data with a DB query, otherwise use the API at https://grizli-cutout.herokuapp.com/assoc_json?name={assoc}
- sb_ident_paramsstr
Parameters for the horizons sb_ident API
- query_arcminfloat
Radius of the query from the pointing center. Probably set this a bit larger than the expected instrumental FoV.
- ephem_stepsint
Number of steps requested in the body ephemeris. If
ephem_steps < 0interpret as a step size in seconds and calculate fromnsteps = (mjd_range[1] - mjd_range[0]) * 86400 / abs(ephem_steps).- make_plotbool
Make a simple diagnostic plot
- plot_all_tracksbool
Plot all nearby tracks, or only those that intersect with the exposure footprints
- Returns
- fig
matplotlib.Figure Footprint + tracks plot
- fephemdict
Dictionary of SB ephemerides
- keeplist
Boolean list of elements in
fephemthat intersect with the exposure footprints
- fig