201.9. MPCORB table¶
201.9. MPCORB table¶
Data Release: Data Preview 1
Container Size: large
LSST Science Pipelines version: r29.1.1
Last verified to run: 2025-06-20
Repository: github.com/lsst/tutorial-notebooks
Learning objective: To understand the contents of the MPCORB
table and how to access it.
LSST data products: MPCORB
Packages: lsst.rsp
Credit: Originally developed by the Rubin Community Science team. Please consider acknowledging them if this notebook is used for the preparation of journal articles, software releases, or other notebooks.
Get Support: Everyone is encouraged to ask questions or raise issues in the Support Category of the Rubin Community Forum. Rubin staff will respond to all questions posted there.
1. Introduction¶
The MPCORB
table contains orbit information from the Minor Planet Center (MPC) for all known solar system objects, including detections and discoveries made by Rubin. It includes the ssObjectId
for each unique Solar System object and MPC-style orbit information.
- TAP table name:
dp1.MPCORB
- columns: 10
- rows: 1,425,362
Related tutorials: The TAP data access services are demonstrated in the 100-level "How to" tutorials.
1.1. Import packages¶
Import standard python package numpy
.
From the lsst
package, import modules for the TAP service and the butler.
import matplotlib.pyplot as plt
from lsst.rsp import get_tap_service
1.2. Define parameters and functions¶
Create an instance of the TAP service, and assert that it exists.
service = get_tap_service("tap")
assert service is not None
2. Schema (columns)¶
To browse the table schema visit the Rubin schema browser, or use the TAP service via the Portal Aspect or as demonstrated in Section 2.1.
2.1. Retrieve table schema¶
To retrieve the table schema, define a query for the schema columns of the MPCORB
table and run the query job.
query = "SELECT column_name, datatype, description, unit " \
"FROM tap_schema.columns " \
"WHERE table_name = 'dp1.MPCORB'"
job = service.submit_job(query)
job.run()
job.wait(phases=['COMPLETED', 'ERROR'])
print('Job phase is', job.phase)
if job.phase == 'ERROR':
job.raise_if_error()
Job phase is COMPLETED
Retrieve the query results and display them as an astropy
table with the to_table()
attribute.
assert job.phase == 'COMPLETED'
results = job.fetch_result().to_table()
results
column_name | datatype | description | unit |
---|---|---|---|
str64 | str64 | str512 | str64 |
e | double | MPCORB: Orbital eccentricity | |
epoch | double | MPCORB: Epoch (in MJD, .0 TT) | d |
incl | double | MPCORB: Inclination to the ecliptic, J2000.0 (degrees) | deg |
mpcDesignation | char | MPCORB: Number or provisional designation (in packed form) | |
mpcH | float | MPCORB: Absolute magnitude, H | mag |
node | double | MPCORB: Longitude of the ascending node, J2000.0 (degrees) | deg |
peri | double | MPCORB: Argument of perihelion, J2000.0 (degrees) | deg |
q | double | MPCORB: Perihelion distance (AU) | AU |
ssObjectId | long | LSST unique identifier (if observed by LSST) | |
t_p | double | MPCORB: MJD of pericentric passage | d |
The table displayed above has been truncated.
Option to print every column name as a list.
# for col in results['column_name']:
# print(col)
Delete the job, but not the results
.
del query
job.delete()
2.2.2. MPC designation¶
The object number or provisional designation (unpacked format):
mpcDesignation
2.2.3. Orbital elements¶
The osculating orbital elements:
q
,e
,incl
,peri
,node
The semimajor axis does not appear as a column in the MPCORB
table, but it can be computed using the perihelion and eccentricity with the following expression: a = q*(1-e)
.
3. Data access¶
The MPCORB
table is only available via the TAP service.
3.1. TAP (Table Access Protocol)¶
The MPCORB
table is stored in Qserv and accessible via the TAP services using ADQL queries.
3.1.1. Demo query¶
Define a query to return the three columns from Section 2.3.
query = "SELECT ssObjectId, mpcDesignation, q, e, incl "\
"FROM dp1.MPCORB " \
"ORDER BY ssObjectId ASC "
job = service.submit_job(query)
job.run()
job.wait(phases=['COMPLETED', 'ERROR'])
print('Job phase is', job.phase)
if job.phase == 'ERROR':
job.raise_if_error()
Job phase is COMPLETED
Fetch the results as an astropy
table.
assert job.phase == 'COMPLETED'
results = job.fetch_result().to_table()
print(len(results))
1425363
Option to display the table.
# results
job.delete()
del results
3.1.2. Joinable tables¶
The MPCORB
table can be joined to the SSObject
table on the column ssObjectId
.
The SSObject
table contains linked Solar System objects (groupings of difference image detections) from Rubin. The DP1 release SSObject
table contains 430 unique Solar System objects detected by Rubin.
The following query joins the MPCORB
and SSObject
tables.
Columns returned include the MPCORB
and SSObject
unique identifiers,
the MPC designation, orbital elements, and
the number of observations and discovery submission date from the SSObject
table.
query = "SELECT mpc.ssObjectId, mpc.mpcDesignation, "\
"mpc.q, mpc.e, mpc.incl, "\
"sso.numObs, sso.discoverySubmissionDate "\
"FROM dp1.MPCORB AS mpc " \
"JOIN dp1.SSObject AS sso ON mpc.ssObjectId = sso.ssObjectId " \
"ORDER BY mpc.ssObjectId ASC"
job = service.submit_job(query)
job.run()
job.wait(phases=['COMPLETED', 'ERROR'])
print('Job phase is', job.phase)
if job.phase == 'ERROR':
job.raise_if_error()
Job phase is COMPLETED
assert job.phase == 'COMPLETED'
results = job.fetch_result().to_table()
print(len(results))
431
Option to display the table.
# results
Plot the semimajor axis versus eccentricity and a histogram of the number of observations for each DP1 Solar System object.
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(9, 4))
ax1.scatter((results['q']/(1-results['e'])), results['e'], s=0.5)
ax2.hist(results['numObs'])
ax1.set_xlabel('Semimajor axis (au)')
ax1.set_ylabel('Eccentricity')
ax2.set_xlabel('Number of observations')
plt.show()
Figure 1: Semimajor axis versus eccentricity and a histogram of the number of observations for each DP1 Solar System object.
Clean up.
job.delete()
del results