Skip to main content

SGN pipeline for GW superevent creation with GraceDB integration

Project description

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:

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sgnllai-0.1.1.tar.gz (40.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sgnllai-0.1.1-py3-none-any.whl (35.6 kB view details)

Uploaded Python 3

File details

Details for the file sgnllai-0.1.1.tar.gz.

File metadata

  • Download URL: sgnllai-0.1.1.tar.gz
  • Upload date:
  • Size: 40.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for sgnllai-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9c21882498554fc6e4840ed1d7b2ba4c3ededde7369c18c671fea4659f253de5
MD5 7589f86fea62d05cf29d06a6b13c277a
BLAKE2b-256 af261d4f746e86a1756f7057ef5e875314ee4ff92100d0ea27f0d17dc5c60774

See more details on using hashes here.

File details

Details for the file sgnllai-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: sgnllai-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 35.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for sgnllai-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c4d4d3506c4083bf789fba508bdda0016089f90ff5cf74123253fb7a38cb3919
MD5 b389a126e249c4a9392b22da1d61cbf4
BLAKE2b-256 97bff714ba4900efab5bd2ee171f5bbde9e86e7512a6d27c5abf3517ecaeda85

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page