Skip to main content

SGN-LLAI

SGN pipelines for gravitational wave event processing with GraceDB integration.

Quick Start

Prerequisites: sgn-sdk running with Kafka, GraceDB, InfluxDB, and Grafana.

# 1. Install
pip install -e .

# 2. Create Kafka topics
make topics-reset

# 3. Set up Grafana dashboards
make grafana-setup

# 4. Run pipeline (Terminal 1)
make run

# 5. Publish mock events (Terminal 2)
make publish

# 6. Run Bayestar (Terminal 3)
make run-bayestar

Verify:

  • GraceDB: http://127.0.0.1:8080 (events G######, superevents S######)
  • Grafana: http://localhost:3000 (login: admin/sgnl)

For all available commands: make help

Pipelines

Superevent Pipeline (make run)

Clusters GW events by GPS time and creates superevents in GraceDB:

MockGWEventSource → Kafka → SuperEventCreator → Kafka (superevents)
                                   │           → Kafka (skipped)
                                   ↓
                              GraceDB API
                                   │
                                   ↓
                          ScaldMetricsSink → InfluxDB → Grafana

Bayestar Pipeline (make run-bayestar)

Generates sky localization maps for superevents:

Kafka (superevents) → BayestarProcessor → GraceDB (skymap upload)
                             │
                             ↓
                     ScaldMetricsSink → InfluxDB → Grafana

Run both pipelines together:

# Terminal 1
make run

# Terminal 2
make run-bayestar

# Terminal 3
make publish

Configuration

Override defaults with make arguments:

make run KAFKA_SERVER=localhost:9092
make publish PUBLISH_RATE=10.0
Variable Default Description
KAFKA_SERVER 127.0.0.1:9196 Kafka bootstrap server
GRACEDB_URL http://127.0.0.1:8080/api/ GraceDB API URL
PUBLISH_RATE 20.0 Seconds between mock events
INFLUXDB_HOST localhost InfluxDB host
INFLUXDB_PORT 8086 InfluxDB port
INFLUXDB_DB sgnllai_metrics InfluxDB database
GRAFANA_URL http://localhost:3000 Grafana URL
GRAFANA_AUTH admin:sgnl Grafana credentials

Bayestar-specific:

Variable Default Description
BAYESTAR_WORKERS 4 Parallel localization workers
BAYESTAR_F_LOW 30.0 Low frequency cutoff (Hz)
BAYESTAR_WAVEFORM IMRPhenomD Waveform approximant

Kafka Topics

Topic Description
gw-event-topic Input: raw GW event candidates
gw-superevent-topic Output: superevents (uploaded to GraceDB)
gw-skipped-topic Output: events skipped (lower SNR)
make topics        # create
make topics-reset  # delete and recreate
make topics-list   # list all

Monitor topics:

make listen-events   # input
make listen-supers   # superevents
make listen-skipped  # skipped

Output Formats

Superevents (gw-superevent-topic)

On creation:

{
  "action": "created",
  "superevent_id": "S241009abc",
  "preferred_event": "G123456",
  "t_0": 1412546713.52,
  "gw_events": ["G123456"],
  "g_event": {"graceid": "G123456", "snr": 12.5, "pipeline": "gstlal"}
}

On update (higher SNR arrived):

{
  "action": "updated",
  "superevent_id": "S241009abc",
  "preferred_event": "G123457",
  "previous_preferred": "G123456",
  "gw_events": ["G123456", "G123457"],
  "g_event": {"graceid": "G123457", "snr": 15.0, "pipeline": "pycbc"}
}

Skipped Events (gw-skipped-topic)

{
  "gpstime": 1412546713.60,
  "pipeline": "spiir",
  "snr": 10.0,
  "reason": "lower_snr",
  "superevent_id": "S241009abc",
  "preferred_snr": 12.5
}

Development

make test       # run tests
make lint       # run linter
make format     # format code
make all        # all checks

Troubleshooting

# Reset Kafka topics
make topics-reset

# Check sgn-sdk services
cd ../sgn-sdk && docker compose ps

# Restart if needed
docker compose down && docker compose up -d

Metadata

Release files for sgnllai 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sgnllai 0.1.1
File Size Uploaded Provenance Actions
sgnllai-0.1.1.tar.gz 40.8 kB Without provenance Details for sgnllai-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sgnllai 0.1.1
File Interpreter ABI Platform Actions
sgnllai-0.1.1-py3-none-any.whl Python 3 none any Details for sgnllai-0.1.1-py3-none-any.whl

Total release size: 76.4 kB

Release files / sgnllai-0.1.1.tar.gz

Download URL sgnllai-0.1.1.tar.gz
Size 40.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9c21882498554fc6e4840ed1d7b2ba4c3ededde7369c18c671fea4659f253de5
BLAKE2b-256 checksum
How to use checksums
af261d4f746e86a1756f7057ef5e875314ee4ff92100d0ea27f0d17dc5c60774
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Release files / sgnllai-0.1.1-py3-none-any.whl

Download URL sgnllai-0.1.1-py3-none-any.whl
Size 35.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c4d4d3506c4083bf789fba508bdda0016089f90ff5cf74123253fb7a38cb3919
BLAKE2b-256 checksum
How to use checksums
97bff714ba4900efab5bd2ee171f5bbde9e86e7512a6d27c5abf3517ecaeda85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Security for sgnllai 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page