MPChecker#

The public interface to the mpchecker functions.

jorbit.mpchecker.interface.animate_region(coordinate, times, coord_table, radius, frame_interval=50)[source]#

Animate the results of nearest_asteroid.

Parameters:
  • coordinate (SkyCoord) – The coordinate to search around.

  • times (Time) – The times to search at.

  • coord_table (Table) – The table of minor planets that fell within the search radius at any time. Computed via nearest_asteroid.

  • radius (Quantity) – The radius to search within when computing total magntiude/flagging individual asteroids. Must be a unit of angle (e.g. u.arcsec, u.deg, etc.).

  • frame_interval (int) – The interval between frames in milliseconds.

Returns:

The animation of the minor planets passing through the region of the sky. If running in a Jupyter notebook, should render in the cell. Can be saved as a gif via animate_region(…).save(‘animation.gif’, writer=’pillow’).

Return type:

FuncAnimation

jorbit.mpchecker.interface.mpchecker(coordinate, time, radius=<Quantity 20. arcmin>, extra_precision=False, observer='geocentric', extra_precision_gravity='newtonian solar system', chunk_coefficients=None)[source]#

Find the minor planets within a given radius of a coordinate at a given time.

This is a local implementation of the MPC’s ‘mpchecker’ service. It uses a cached integration that began with particle states taken from JPL Horizons and were evolved using Jorbit and Newtonian gravity (but all major solar system perturbers). Instead of saving the cartesian positions, we saved the on-sky coordinates of each particle at each time step as seen by a geocentric observer. Between this assumption and the neglect of GR effects, the cached positions are only accurate to within ~an arcsec. However, if using “extra_precision”, this will first run the quick/coarse search, figure out which minor planets fell within the radius, then actually run an N-body integration using Jorbit to get their positions as seen from a specific observer. These positions should agree with Horizons to ~1 mas if using extra_precision_gravity=”default solar system”.

Parameters:
  • coordinate (SkyCoord) – The coordinate to search around.

  • time (Time) – The time to search at.

  • radius (Quantity) – The radius to search within. Note that for the coarse search, speed shouldn’t depend too strongly on radius, but the speed of the extra precision search will depend on the number of particles that need to be integrated. Must be a unit of angle (e.g. u.arcsec, u.deg, etc.).

  • extra_precision (bool) – Whether to run the extra precision search. This will be slower, but more accurate. Will be “true” if the observer is not geocentric.

  • observer (str) – The observatory from which the observations are made. Can be a string name or Horizons-style @399 code.

  • extra_precision_gravity (str | Callable) – The gravity model to use for the extra precision search. Must be a valid argument for “gravity” in System. Default is “newtonian solar system”.

  • chunk_coefficients (Array | None) – Optionally pass the relevant chunk coefficients to avoid I/O operations if running this repeatedly.

Returns:

A table of the minor planets within the given radius of the coordinate at the given time. The exact columns depend on whether extra precision was requested.

Return type:

Table

jorbit.mpchecker.interface.nearest_asteroid(coordinate, times, precomputed=None, radius=<Quantity 2. arcmin>, compute_contamination=False, observer='geocentric', extra_precision_gravity='newtonian solar system')[source]#

Identify minor planets passing through a region of the sky at a series of times.

This is a more dynamic version of the mpchecker function that’s designed to find the nearest minor planet to a given coordinate at a series of times. If one wants to do a quick check to see if any minor planets got close to a given coordinate over a series of times, they can leave compute_contamination as False. This will return a limited amount of information about the nearest minor planet at each time, but will not compute their magnitudes or re-integrate their orbits for higher precision. If compute_contamination is True, it will first run the coarse search, then re-integrate the orbits of all minor planets that fell within the search radius at any time, compute their on-sky coordinates and Vmags as seen from a specific observer, and produce more detailed tables of the results.

Parameters:
  • coordinate (SkyCoord) – The coordinate to search around.

  • times (Time) – The times to search at. Can handle arbitrary length Times, but speed will depend on the total length.

  • precomputed (tuple | None) – Optionally pass the relevant chunk coefficients to avoid I/O operations if running this repeatedly.

  • radius (Quantity) – The radius to search within when computing total magntiude/flagging individual asteroids. Must be a unit of angle (e.g. u.arcsec, u.deg, etc.).

  • compute_contamination (bool) – Whether to compute the total magntiude of all asteroids within the search radius at each time. Uses the same formula as Horizons for converting H and G to Vmags, and each asteroids’ individual H and G values from the MPCORB.DAT table that the cached ephemeris was built from.

  • observer (str) – The observatory from which the observations are made. Can be a string name or Horizons-style @399 code.

  • extra_precision_gravity (str | Callable) – The gravity model to use for the extra precision search. Must be a valid argument for “gravity” in System. Default is “newtonian solar system”.

Returns:

If compute_contamination is False, returns a tuple of the distance to the nearest minor planet at each time and a table of the minor planets that fell within the search radius at any time. If compute_contamination is True, returns a tuple of the distance to the nearest minor planet at each time, a table of the minor planets that fell within the search radius at any time, a table of the coordinates of all minor planets within the search radius at each time, a table of the Vmags of all minor planets within the search radius at each time, and a table of the total Vmags of all minor planets within the search radius at each time.

Return type:

tuple