Skip to content

Add Babamul alert broker DataService - #1666

Open
DKilkenny wants to merge 5 commits into
TOMToolkit:devfrom
DKilkenny:feature/babamul-dataservice
Open

DKilkenny wants to merge 5 commits into
TOMToolkit:devfrom
DKilkenny:feature/babamul-dataservice

Conversation

@DKilkenny

Copy link
Copy Markdown

Adds a DataService for Babamul, the public service of the BOOM alert broker for ZTF and LSST alerts.

Supports cone search and lookup by object id. Photometry is read from the object endpoint, which carries the full light curve: detections are stored as brightness and prv_nondetections as limits.

The API key is read from DATA_SERVICES, following the TNS pattern.

Refs issue #1405

Adds a DataService for Babamul, the public service of the BOOM alert
broker for ZTF and LSST alerts.

Supports cone search and lookup by object id. Photometry is read from
the object endpoint, which carries the full light curve: detections are
stored as brightness and prv_nondetections as limits. The most recent
detection appears in both candidate and prv_candidates, so detections
are deduplicated by candidate id.

Reduced datums are looked up on the fields covered by the model's
uniqueness constraint, so that a later sync reporting a different
uncertainty updates nothing rather than failing to match and raising.

The API key is read from DATA_SERVICES, following the TNS pattern.

Refs TOMToolkit#1405
@DKilkenny

Copy link
Copy Markdown
Author

I have two questions:

  1. Every detection I'm seeing carries isdiffpos: false and I'm currently ingesting all of them. The way I understand it is that a negative subtraction usually gets excluded from a light curve, so if that's the convention, I should be filtering them out.
  2. How much enrichment do you want surfaced? Right now the only extra I save is survey since it decides which endpoint a later photometry update queries. I noticed the services here have two approaches.
  • ALeRCE stores every field that isn't on the Target model
  • MPC, NED, Simbad and TNS store nothing at all
    The object record has a lot available if you want it including ACAI and BTSbot classification scores and boolean flags. I chose the ZTF option for now, but I'm happy to implement the ALeRCE pattern instead.

@jchate6 jchate6 moved this to Needs Review in TOM Toolkit Sep 10, 2026
@jchate6 jchate6 added Data Services Data Services User Issue Raised by a user labels Sep 10, 2026
The scheduled canary job runs with no secrets, so a hardcoded
placeholder api_key would fail against the live API with a 401. Skip
the test unless BABAMUL_API_KEY is set.

@Fingel Fingel 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.

I tested this locally. Searching by name works, ra/dec works, saving the query works and creating targets. Looks good to me!

@DKilkenny

Copy link
Copy Markdown
Author

I was checking on this PR, and I noticed a couple of tests that ran exactly the same ingest or query and just checked different parts so I consolidated them. Also, the duplicate detection test was already covered because the detection count fails when the dedup is removed.

If there's anything else I can do to help merge this PR in, happy to do so!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Data Services Data Services User Issue Raised by a user

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

3 participants