Client library for interacting with an MPC observations database
Project description
mpcq
A Python package by the Asteroid Institute, a program of the B612 Foundation
mpcq is a powerful Python client library for querying and analyzing Minor Planet Center (MPC) data through Google BigQuery. This package provides efficient access to a BigQuery instance of the Small Bodies Node (SBN) replica of the MPC's Small Bodies Node database, maintained by the Asteroid Institute.
Features
- BigQuery Integration: Direct access to a complete replica of the MPC database through Google BigQuery
- Efficient Queries: Optimized query patterns for common asteroid data access patterns
- Rich Data Access: Query observations, orbits, submission history, and more
- Cross-Matching: Tools for matching observations and finding duplicates
- ADES Support: Integration with ADES format for modern asteroid data exchange
BigQuery Dataset Access
The Asteroid Institute maintains a BigQuery replica of the Minor Planet Center's Small Bodies Node database. The dataset is available through Google Cloud's Analytics Hub and requires subscription to two listings:
To access the dataset, you'll need:
- A Google Cloud Platform account
- BigQuery API access enabled
- Subscription to both Analytics Hub listings
- Google Cloud credentials configured
Queries will be billed according to your Google Cloud Platform account's BigQuery pricing.
Installation
pip install mpcq
Quick Start
from mpcq.client import BigQueryMPCClient
# Initialize client with your subscribed dataset IDs
client = BigQueryMPCClient(
dataset_id="your_subscribed_main_dataset_id",
views_dataset_id="your_subscribed_views_dataset_id"
)
# Query observations for a specific object
observations = client.query_observations(["2013 RR165"])
# Convert to pandas DataFrame for analysis
from mpcq.utils import observations_to_dataframe
df = observations_to_dataframe(observations)
print(df.head())
Advanced Usage
Query Submission History
# Get submission history for an object
submissions = client.query_submission_history(["2013 RR165"])
Cross-Match Observations
# Cross-match ADES observations with MPC database
matched = client.cross_match_observations(
ades_observations,
obstime_tolerance_seconds=30,
arcseconds_tolerance=2.0
)
Find Duplicates
# Find potential duplicate observations
duplicates = client.find_duplicates(
"2013 RR165",
obstime_tolerance_seconds=30,
arcseconds_tolerance=2.0
)
Documentation
For complete documentation, including detailed API reference and examples, visit our ReadTheDocs page.
BigQuery Dataset Schema
The dataset (moeyens-thor-dev.mpc_sbn_aurora) contains several key tables:
public_obs_sbn: Primary observations tablepublic_current_identifications: Current object identificationspublic_numbered_identifications: Numbered asteroid identificationspublic_orbits: Orbital elements
You can explore these tables and their schemas directly in the BigQuery Console.
Contributing
We welcome contributions! Please see our Contributing Guide for details.
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Acknowledgments
The Asteroid Institute acknowledges the Minor Planet Center and the Small Bodies Node for their invaluable work in maintaining the authoritative small bodies database.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mpcq-0.4.0.tar.gz.
File metadata
- Download URL: mpcq-0.4.0.tar.gz
- Upload date:
- Size: 65.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e287de9f04e8132cd9cc48c0102e24e9a7d9b70f85904547c85e0f85a62c989
|
|
| MD5 |
13a0a913562545d8ee6877952dcad8d7
|
|
| BLAKE2b-256 |
bbf6f9649ba773e924cec1c032b766ab15f957b5983391880c8fb90aca5af132
|
Provenance
The following attestation bundles were made for mpcq-0.4.0.tar.gz:
Publisher:
publish.yaml on B612-Asteroid-Institute/mpcq
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mpcq-0.4.0.tar.gz -
Subject digest:
9e287de9f04e8132cd9cc48c0102e24e9a7d9b70f85904547c85e0f85a62c989 - Sigstore transparency entry: 172212308
- Sigstore integration time:
-
Permalink:
B612-Asteroid-Institute/mpcq@48ad51e179154fb2e1c00e16b6c0c50d270015c5 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/B612-Asteroid-Institute
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@48ad51e179154fb2e1c00e16b6c0c50d270015c5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mpcq-0.4.0-py3-none-any.whl.
File metadata
- Download URL: mpcq-0.4.0-py3-none-any.whl
- Upload date:
- Size: 65.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09b5e1c9dd249b8b744985e99e1d6d851ed2882ddde9f40e299caca493381f81
|
|
| MD5 |
c48a60f453f732ea44c851e2fceac6de
|
|
| BLAKE2b-256 |
e0723196ee9b56bceef37e1a1b777e868977972225766a2dd4148cf2b829f7f2
|
Provenance
The following attestation bundles were made for mpcq-0.4.0-py3-none-any.whl:
Publisher:
publish.yaml on B612-Asteroid-Institute/mpcq
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mpcq-0.4.0-py3-none-any.whl -
Subject digest:
09b5e1c9dd249b8b744985e99e1d6d851ed2882ddde9f40e299caca493381f81 - Sigstore transparency entry: 172212309
- Sigstore integration time:
-
Permalink:
B612-Asteroid-Institute/mpcq@48ad51e179154fb2e1c00e16b6c0c50d270015c5 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/B612-Asteroid-Institute
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@48ad51e179154fb2e1c00e16b6c0c50d270015c5 -
Trigger Event:
push
-
Statement type: