202.4. SS Object table#
202.4. SSObject table¶
For the Rubin Science Platform at data.lsst.cloud.
Data Release: Prompt Products
Container Size: Large
LSST Science Pipelines version: r30.0.11
Last verified to run: 2026-11-30
Repository: github.com/lsst/tutorial-notebooks
DOI: 10.11578/rubin/dc.20250909.20
Learning objective: To understand the contents of the SSObject table and how to access it.
LSST data products: SSObject
Packages: lsst.rsp, lsst.utils.plotting
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 SSObject table contains linked Solar System objects (groupings of Rubin-image detections). It includes the ssObjectId for each unique Solar System object and Rubin-computed per-object quantities, including the number of Rubin observations (nObs) for each Solar System object, Earth MOID (Minimum orbit intersection distance; MOIDEarth), and extendedness values derived from the corresponding SSObservations. The SSObservation table contains only Rubin detections that have been submitted to the Minor Planet Center (MPC) and have been associated by the MPC to a known moving object or a new discovery.
Therefore the SSObject table will only contain information on objects and observations accepted by the MPC.
Warning: The
NearbySSOtable containsDiaSourcesthat have been associated to known moving objects by Solar System prompt processing, but have not yet been accepted by MPC. Therefore the objects inNearbySSOmay not be present inSSObject.
The SSObject table also includes per band information, including number of observations, and phase curve parameters from the Muinonen et al. 2010 two parameter model. These include, best-fit absolute magnitudes and errors, best-fit G12 slope parameters and errors, H–G12 covariance, number of data points used and Chi^2 statistic for the phase curve fit with a flag for phase curve fit failures, and minimum and maximum observed phase angles.
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.
import numpy as np
import matplotlib.pyplot as plt
from lsst.rsp import RSPDiscovery
from lsst.utils.plotting import (get_multiband_plot_colors,
get_multiband_plot_symbols,
set_rubin_plotstyle)
1.2. Define parameters and functions¶
Create an instance of the TAP service.
discovery = RSPDiscovery("prompt")
service = discovery.get_tap_client()
Define the colors and symbols to represent the LSST filters in plots.
set_rubin_plotstyle()
filter_colors = get_multiband_plot_colors()
filter_names = filter_colors.keys()
filter_symbols = get_multiband_plot_symbols()
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 SSObject table and run the query job.
query = """SELECT column_name, datatype, description, unit
FROM tap_schema.columns
WHERE table_name = 'ppdb.SSObject'"""
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 |
| g_G12Err | float | Error in the estimate of G12 (g band). | |
| ssObjectId | long | Unique identifier. | |
| designation | char | The unpacked primary provisional designation for this object. | |
| nObs | int | Total number of LSST observations of this object. | |
| arc | double | Timespan ("arc") of all LSST observations, t_{last} - t_{first} | d |
| firstObservationMjdTai | double | The time of the first LSST observation of this object (could be precovered), TAI. | d |
| MOIDEarth | float | Minimum orbit intersection distance to Earth. | AU |
| MOIDEarthDeltaV | float | DeltaV at the MOID point. | km/s |
| MOIDEarthEclipticLongitude | float | Ecliptic longitude of the MOID point (Earth's orbit). | deg |
| ... | ... | ... | ... |
| y_H | float | Best fit absolute magnitude (y band). | mag |
| y_HErr | float | Error in the estimate of H (y band). | mag |
| y_G12 | float | Best fit G12 slope parameter (y band). | |
| y_G12Err | float | Error in the estimate of G12 (y band). | |
| y_H_y_G12_Cov | float | H–G12 covariance (y band). | mag**2 |
| y_nObsUsed | int | The number of data points used to fit the phase curve (y band). | |
| y_Chi2 | float | Chi^2 statistic of the phase curve fit (y band). | |
| y_phaseAngleMin | float | Minimum phase angle observed (y band). | deg |
| y_phaseAngleMax | float | Maximum phase angle observed (y band). | deg |
| y_slope_fit_failed | boolean | G12 fit failed in y band. G12 contains a fiducial value used to fit H. NULL when y_nObs = 0 (no data in this band). |
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. Key columns¶
The DP2 data release SSObject table contains 80 columns. Several of these will be most commonly used.
2.2.1. Solar System Object Identifiers¶
The long integer that uniquely identifies each Solar System object:
ssObjectId
The unpacked primary provisional designation assigned by the MPC:
designation
2.2.2. Number of observations¶
The number of LSST observations for each Solar System object, including per band quantities:
nObs[band]_nObs
2.2.5. Extendedness¶
The minimum, median, and maximum extendedness values derived from the corresponding DiaSources:
extendednessMinextendednessMedianextendednessMax
2.2.6. Absolute magnitude¶
The best fit absolute magnitude H per band:
[band]_H
The error in the estimate of H per band:
[band]_HErr
2.2.7. Phase curve parameters¶
The best fit G12 slope parameter per band (Muinonen et al. 2010):
[band]_G12
The error in the estimate of G12 per band:
[band]_G12Err
The Chi^2 statistic of the phase curve fit per band:
[band]_Chi2
The minimum and maximum phase angles observed per band:
[band]_phaseAngleMin[band]_phaseAngleMax
Flag to indicate if the phase curve fit was successful:
[band]_slope_fit_failed
3. Data access¶
The SSObject table is available via the TAP service.
3.1. TAP (Table Access Protocol)¶
The SSObject table accessible via the TAP services using ADQL queries.
3.1.1. Demo query - number of observations per ssObjectId¶
Define a query to return the ssObjectId and nObs key columns from Section 2.2.
query = """SELECT ssObjectId, nObs
FROM ppdb.SSObject
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))
307254
Option to display the table.
# results
Show that there is an average of $\sim27$ source measurements for each object.
print('Mean number of source measurements per object:', np.round(results['nObs'].mean(), 1))
Mean number of source measurements per object: 26.6
Plot a histogram of the number of observations for all Solar System objects.
fig, ax = plt.subplots(figsize=(6, 4))
ax.hist(results['nObs'], bins=100, edgecolor='none', alpha=0.85)
ax.axvline(results['nObs'].mean(), c="r")
ax.set_xlabel('Total nObs')
ax.set_ylabel('Count')
ax.set_title('Observation count')
ax.set_yscale("log")
plt.tight_layout()
plt.show()
Figure 1: Histograms of the number of observations for all PPDB Solar System objects. The mean number of observations per object in indicated by the vertical line.
Clean up.
job.delete()
del query, results
3.1.2. Demo query - distribution of absolute magnitudes by band¶
The phase curve parameters include the absolute magnitude, H, which is the apparent magnitude of an asteroid that is 1 au from the Sun and observer and at a phase angle of zero degrees. Rubin Solar System Processing (SSP) attempts to fit a phase curve to the SSObservations in each band separately. The phase curve fit will not always succeed, for example due to low numbers of observations or poor phase angle coverage. In such cases the flag [band]_slope_fit_failed = TRUE is set and H is fitted with a default value of [band]_G12 = 0.5. When [band]_nObs = 0 the corresponding phase curve parameters are set to NULL.
The query below retrieves the absolute magnitudes from SSObject across the Rubin bandpasses.
query = """SELECT ssObjectId, u_H, g_H, r_H, i_H, z_H, y_H
FROM ppdb.SSObject
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
assert job.phase == 'COMPLETED'
results = job.fetch_result().to_table()
print(len(results))
307254
Option to display the table.
# results
Plot histograms of the per-band absolute magnitude ($H$) estimates, marking the median $H$-mag for each band. To avoid a UserWarning message, specify to use only values of the results table that are unmasked.
unmasked_results = results.filled(0)
fig, axes = plt.subplots(2, 3, figsize=(15, 9))
for i, b in enumerate(filter_names):
ax = axes.flat[i]
h = unmasked_results[unmasked_results[f'{b}_H'] > 0][f'{b}_H']
ax.hist(h.clip(5, 28), bins=120, color=filter_colors[b],
alpha=0.85, edgecolor='none')
ax.set_xlabel(f'{b}-band H mag')
ax.set_ylabel('Count')
ax.set_title(f'{b}-band (N={len(h):,})')
ax.axvline(np.median(h), color='0.3', linestyle='--', lw=1.2)
ax.text(0.95, 0.92, f'median = {np.median(h): .1f}',
transform=ax.transAxes, ha='right', fontsize=11,
fontstyle='italic')
plt.suptitle('Absolute Magnitude Distributions', fontsize=15, y=1.01)
plt.tight_layout()
plt.show()
Figure 2: Histograms of the absolute magnitude ($H$) estimates per band for all PPDB Solar System objects. The median $H$-mag for each band is marked and labeled. The titles indicate the band and the total number of objects with an $H$ magnitude in that band.
Clean up.
job.delete()
del query, results, unmasked_results
3.1.3. Joinable tables¶
The SSObject table can be joined to the SSObservation table on the column ssObjectId.
The SSObservation table contains single-epoch solar system source information corresponding to a specific detection on either a difference or science image. These are observations that have been accepted by the MPC and reliably associated to a moving object.
The following query joins the SSObject and SSObservation tables.
Columns returned include the SSObject and SSObservation unique identifiers,
the number of observations from the SSObject table,
and the heliocentric and topocentric distances from the SSObservation table.
query = """SELECT TOP 100 sso.ssObjectId, sso.nObs,
ssobs.helioRange, ssobs.topoRange
FROM ppdb.SSObject AS sso
JOIN ppdb.SSObservation AS ssobs ON sso.ssObjectId = ssobs.ssObjectId
WHERE ssobs.helioRange < 4.0"""
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 and convert to a pandas dataframe.
assert job.phase == 'COMPLETED'
results = job.fetch_result()
result_df = results.to_table().to_pandas()
Option to display the results.
# result_df
Plot number of observations as a function of heliocentric and topocentric distances for the TOP 100 Solar System object sources.
fig, ax = plt.subplots(figsize=(5, 4))
ax.scatter(result_df['helioRange'], result_df['nObs'],
marker='o', alpha=0.6, label='Heliocentric')
ax.scatter(result_df['topoRange'], result_df['nObs'],
marker='s', alpha=0.6, label='Topocentric')
plt.xlabel('Distance (au)')
plt.ylabel('Number of observations')
plt.tight_layout()
ax.legend(bbox_to_anchor=(1.01, 1), loc='upper left', handletextpad=0.1)
plt.show()
Figure 2: Number of observations versus heliocentric and topocentric distances for the TOP 100 Solar System object sources.
Clean up.
job.delete()
del query, results, result_df
The SSObject table can be joined to mpc_orbits using the designation in order to get the orbital parameters for each object.
The query below selects the number of observations for the top 100 SSObjects, alongside the perihelion and eccentricity orbital elements from MPC. We limit the query to orbits with perihelion between 1.5 and 3.5 au.
query = """SELECT TOP 100 sso.ssObjectId, sso.Designation, sso.nObs, mpc.q, mpc.e
FROM ppdb.SSObject AS sso
JOIN ppdb.mpc_orbits AS mpc ON sso.designation = mpc.designation
WHERE (mpc.q > 1.5) AND (mpc.q < 3.5)"""
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 and convert to a pandas dataframe.
assert job.phase == 'COMPLETED'
results = job.fetch_result()
result_df = results.to_table().to_pandas()
Option to display the results.
# result_df
Plot orbital eccentricity and perihelion for the selected Solar System object sources, with number of SSObservations for each object indicated by marker color.
fig, ax = plt.subplots(figsize=(6, 4))
s = ax.scatter(result_df['q'], result_df['e'], alpha=0.6,
c=np.log10(result_df["nObs"]))
cbar = plt.colorbar(s)
plt.xlabel('Perihelion (au)', fontsize=15)
plt.ylabel('Eccentricity', fontsize=15)
cbar.set_label('log(Number of Observations)', fontsize=15)
plt.tight_layout()
plt.show()
Figure 3: Eccentricity versus perihelion for the TOP 100 Solar System object sources with perihelia between 1.5 and 3.5 au. The color bar indicates the number of
SSObservationsfor each object.
3.2. Butler¶
The PPDB SSObject table is not currently available via the Butler.