Skip to content

Ingest ssSource designation data from the LSST alert stream#497

Open
thomasculino wants to merge 1 commit into
boom-astro:mainfrom
thomasculino:lsst-ssobject-ingestion
Open

Ingest ssSource designation data from the LSST alert stream#497
thomasculino wants to merge 1 commit into
boom-astro:mainfrom
thomasculino:lsst-ssobject-ingestion

Conversation

@thomasculino

Copy link
Copy Markdown
Contributor

This pull request adds support for Rubin/LSST Solar System object (SSO) metadata in alert handling, specifically by introducing the SsSource struct to represent per-detection SSO ephemeris and designation information. The changes ensure that SSO data is parsed, stored, indexed, and exposed throughout the alert ingestion, enrichment, and filtering pipelines, and are accompanied by new tests for correct deserialization and handling of SSO fields.

Support for Solar System Object metadata:

  • Added the new SsSource struct to represent Solar System object ephemeris and designation data, with full parsing and (de)serialization support in src/alert/lsst.rs. This struct is now included in the LsstRawAvroAlert, LsstAlert, and LsstObject types, and is handled during alert ingestion and enrichment.
  • The SSO designation is now persisted in the auxiliary collection for each object, updated independently of cross-survey matches, and indexed for efficient lookup by designation.

Pipeline and API changes:

  • The alert enrichment and filtering pipelines have been updated to propagate the new ss_source field, making SSO metadata available for downstream consumers and APIs.

Testing and validation:

  • Added tests to verify correct deserialization of the new SsSource struct, including edge cases where the field is absent. Existing tests and fixtures were updated to include or expect the new fields where appropriate.

These changes collectively enable robust handling and querying of Solar System object information in LSST alert data, paving the way for more advanced moving object science use cases.

The idea behind this PR is to query by ssObjectId in the future

Copilot AI review requested due to automatic review settings June 23, 2026 19:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds end-to-end support for Rubin/LSST Solar System Object (SSO) per-detection metadata by introducing an SsSource record, propagating it through alert ingestion/enrichment/filtering, and persisting SSO designations for queryability.

Changes:

  • Introduces SsSource and wires it into LsstRawAvroAlert, LsstAlert, and the enrichment/filter pipelines.
  • Persists MPC designation to the LSST aux collection and adds an index to support designation lookups.
  • Updates tests/fixtures to account for new LSST fields (ss_source, designation).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_babamul.rs Updates test alert/object construction for new LSST fields.
tests/api/test_babamul.rs Updates API test expectations for the new designation field.
src/utils/db.rs Adds LSST-specific indexes, including new designation index.
src/filter/lsst.rs Projects ss_source in the LSST filter pipeline output.
src/enrichment/lsst.rs Projects/deserializes ss_source for enrichment worker processing.
src/alert/mod.rs Re-exports SsSource from the alert module.
src/alert/lsst.rs Defines SsSource, parses ssSource, persists designation, and adds tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/utils/db.rs
Comment on lines +106 to 113
// if survey is LSST, create an index on the ss_object_id field of the alerts collection,
// and on the designation field of the aux collection (used to look up a moving object by
// its MPC designation, independent of any cross-survey position match)
if survey == &Survey::Lsst {
let index = doc! {
"ss_object_id": 1,
};
create_index(&alerts_collection, index, false).await?;
Comment thread src/alert/lsst.rs
Comment on lines +1409 to +1420
// The designation is only known once a diaSource is linked to an ssObject; keep it
// current on the aux doc independent of whichever branch above ran, and regardless of
// any ZTF cross-match (an LSST-only or ZTF-only ssObject is a normal outcome).
if let Some(designation) = &designation {
self.alert_aux_collection
.update_one(
doc! { "_id": &object_id },
doc! { "$set": { "designation": designation } },
)
.await
.inspect_err(as_error!())?;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants