Skip to main content

sega

Segment Evaluation & Generation Application

ci coverage documentation pypi version


Evaluate data quality conditions on detector channel data and produce IGWN XML segment files or publish directly to DQSegDB. SEGA is built on the SGN streaming pipeline framework and driven by declarative YAML configuration.

Resources

Installation

pip install sega

Where to Start

  • Tutorial -- New to SEGA? Write a config file and generate your first segments step by step.
  • User Guide -- Configuration, condition types, data sources, output modes, and the CLI.
  • API Reference -- API documentation.

Features

  • Declarative YAML configuration with includes, defaults, and bulk expansion
  • Per-sample threshold, range, and bitwise condition checks
  • Aggregate statistics (mean, RMS) with trend detection
  • Boolean condition logic with arbitrary nesting (all_of, any_of, not)
  • Infix expression syntax for complex boolean conditions (a & !b | c)
  • Multiple data sources: gravitational wave frames, Arrakis, or synthetic data
  • Output to IGWN XML segment files or DQSegDB
  • Dry-run mode for config validation

Quickstart

Write a configuration file

Create a file called config.yaml:

meta:
  ifo: H1
  subsystem: DQ

conditions:
  calibrated:
    operator: bits_set
    channel: H1:GDS-CALIB_STATE_VECTOR
    bits: [0, 6]

  low_noise:
    operator: below
    channel: H1:PEM-CS_ACC_BEAMTUBE_X_DQ
    threshold: 500.0

  science_ready:
    operator: boolean
    expr: "calibrated & low_noise"

segments:
  H1:DQ-SCIENCE_READY:
    condition: science_ready
    version: 1
    limit: 16
    comment: "Calibrated and low noise"

Run from frame files

sega --config config.yaml --source frames \
     --frames /path/to/H-H1_R-*.gwf \
     --start 1187000000 --end 1187001000

This evaluates the conditions over the specified time range and writes an XML segment file to the current directory.

Validate a config without running

sega --config config.yaml --source fake --dry-run

The --dry-run flag parses and validates the configuration, printing a summary table of conditions and output segments. Use -v to include the full segment listing.

Stream from Arrakis

sega --config config.yaml --source arrakis

Without --start and --end, SEGA streams live data continuously. Press Ctrl+C to stop.

Publish to DQSegDB

sega --config config.yaml --source arrakis \
     --output-mode dqsegdb \
     --segment-server https://segments.ligo.org

Boolean expressions

Boolean conditions support infix notation with & (AND), | (OR), and ! (NOT), with standard precedence:

conditions:
  calibrated:
    operator: bits_set
    channel: H1:GDS-CALIB_STATE_VECTOR
    bits: [0, 6]

  injecting:
    operator: bits_set
    channel: H1:GDS-CALIB_STATE_VECTOR
    bits: [5]

  low_noise:
    operator: below
    channel: H1:PEM-CS_ACC_BEAMTUBE_X_DQ
    threshold: 500.0

  analysis_ready:
    operator: boolean
    expr: "calibrated & !injecting & low_noise"

This is equivalent to the explicit form:

  analysis_ready:
    operator: boolean
    all_of:
      - calibrated
      - not: injecting
      - low_noise

Download files

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

Source Distribution

sega-0.4.0.tar.gz (344.7 kB view details)

Uploaded Source

Built Distribution

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

sega-0.4.0-py3-none-any.whl (135.1 kB view details)

Uploaded Python 3

File details

Details for the file sega-0.4.0.tar.gz.

File metadata

  • Download URL: sega-0.4.0.tar.gz
  • Upload date:
  • Size: 344.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.13.12 HTTPX/0.28.1

File hashes

Hashes for sega-0.4.0.tar.gz
Algorithm Hash digest
SHA256 fe9933669d307e4d1902e0a2c94b1e524f80925bdd657894a3df5a4850d73b21
MD5 242d0f86808f89b176b128a5dc1c87a6
BLAKE2b-256 92e160a53d1aa7de216c7b2e6159b2458ef901ffde0d783e6271e4792d0f794d

See more details on using hashes here.

File details

Details for the file sega-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: sega-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 135.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.13.12 HTTPX/0.28.1

File hashes

Hashes for sega-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7a4a808157eb8a47f1addebb28f6fd068ccb5ff68c6327fd6d6bdecfe80e0477
MD5 d0cb9e0faa0df4aeefa8fdf63b108dba
BLAKE2b-256 79f6aa179c9671c13d7203384ad8377681b386ae63ab675f440c22705a3b9770

See more details on using hashes here.

Release history Release notifications | RSS feed

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

This release

0.4.0 This release

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

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