sbdb

This module provides two independent interfaces to JPL’s Small-Body Database (SBDB). SBDBquery queries one object and exposes its properties. SBDBbatch downloads or loads the catalogue as a table; its get method filters that table by primary MPC designation without making another request. The interface is based on the astroquery [57] Python package.

For example, a catalogue query can select an object and save the table for later reuse:

from tudatpy.data_input.environment_data.sbdb import SBDBbatch

batch = SBDBbatch(fields=["pdes", "name"])
vesta = batch.get(4)
batch.to_csv("sbdb.csv")
reloaded = SBDBbatch(csv_path="sbdb.csv")

For direct environment setup, SBDB data are used by central_sbdb() and central_sbdb_density() to create point-mass gravity field settings for small bodies. The SBDBquery class can be used directly when these physical properties need to be inspected before constructing the environment.

Classes

SBDBbatch([csv_path, fields, page_size, timeout])

Access the JPL Small-Body Database catalogue as a table.

SBDBquery(MPCcode, *args, **kwargs)

Small-Body Database Query for retrieving various properties of a small body.

class SBDBbatch(csv_path: str | os.PathLike | None = None, fields: Iterable[str] | None = None, page_size: int = 100000, timeout: float = 120)[source]

Bases: object

Access the JPL Small-Body Database catalogue as a table.

Load a saved CSV file, or fetch all catalogue rows from JPL through requests of at most page_size rows each. Use get() to select rows by primary MPC designation (the pdes field).

Parameters:
  • csv_path (str or os.PathLike, optional) – Path to a previously saved CSV file. When provided, the catalogue is read from this file instead of queried from JPL.

  • fields (iterable of str, optional) – SBDB fields to request when downloading. If omitted, all fields advertised by the API are requested. Include "pdes" to use get().

  • page_size (int, optional) – Maximum number of rows requested per JPL request. Default is 100,000.

  • timeout (float, optional) – HTTP timeout in seconds for each request. Default is 120.

dataframe

The downloaded or loaded catalogue.

Type:

pandas.DataFrame

get(mpc_codes: str | int | Iterable[str | int]) → pandas.DataFrame[source]

Select catalogue rows by primary MPC designation.

Parameters:

mpc_codes (str, int, or iterable of str or int) – One or more designations to match against the pdes column.

Returns:

Matching rows, or an empty table if no designation matches.

Return type:

pandas.DataFrame

to_csv(path: str | os.PathLike) → None[source]

Save the loaded catalogue to a CSV file for offline reuse.

Parameters:

path (str or os.PathLike) – Output CSV path. The DataFrame index is not written.

class SBDBquery(MPCcode: str | int, *args, **kwargs)[source]

Bases: object

Small-Body Database Query for retrieving various properties of a small body. Useful for retrieving names and masses in conjunction with the MPC module.

estimated_spherical_gravitational_parameter(density: float) → float[source]

Calculate a very simple gravitational parameter by estimating the object’s mass using a given density. Will raise an error if the body’s diameter is not available on SBDB.

Parameters:

density (float) – Density of the object in kg m^-3

Returns:

Simplified estimation for the object’s gravitational parameter

Return type:

float

estimated_spherical_mass(density: float) → float[source]

Calculate a very simple mass by estimating the object’s mass using a given density. Will raise an error if the body’s diameter is not available on SBDB.

Parameters:

density (float) – Density of the object in kg m^-3

Returns:

Simplified estimation for the object’s mass

Return type:

float

property Dt

read-only

Asymmetric cometary non-gravitational model parameter DT in seconds.

property codes_300_spkid

read-only

Returns spice kernel number for the codes_300ast_20100725.bsp spice kernel.

Some objects may return a name instead of a number. These are objects specifically specified by name in the codes_300ast_20100725.bsp kernel.

See https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/asteroids/aa_summaries.txt for a list of exceptions

property diameter

read-only

Returns diameter of the small body if available

property first_obs

read-only

Epoch of the first observation used in the orbit solution, in seconds since J2000.

property gravitational_parameter

read-only

Returns the gravitational parameter for the small body if available

property last_obs

read-only

Epoch of the last observation used in the orbit solution, in seconds since J2000.

property moid

read-only

Small body’s minimum orbital intersection distance with Earth, in metres.

property moid_jup

read-only

Small body’s minimum orbital intersection distance with Jupiter, in metres.

property name

read-only

Short name in the format: MPC NAME DESIGNATION

property nongrav_params

read-only

Cometary non-gravitational model parameters A1, A2 and A3 in m/s². Missing parameters are returned as zero.

property object_classification

read-only

Returns the orbit class of the object for example Amor Group for Eros

property object_info

read-only

Returns info about the object, including its designation and orbit class

property perihelion

read-only

Perihelion distance in metres.

property shortname

read-only

Short name in the format: MPC NAME

property spkid

read-only

Returns the JPL SPKID, the related codes_300_spkid method returns a modified ID for the Tudat standard kernel

property time_perihelion

read-only

Perihelion epoch in seconds since J2000.