Skip to main content

NOMAD: NOn-stationary Modulation-Aware Denoiser for sgn

Project description

NOMAD

NOn-stationary Modulation-Aware Denoiser — an sgn-based reimplementation of NonSENS (Vajente et al., PRD 101, 042003) streaming noise subtraction for gravitational-wave strain data.

NOMAD measures excess noise in a target strain channel from auxiliary "noise witness" channels that couple into strain through transfer functions whose amplitude is modulated in time by slow "modulation witness" channels. The noise estimate is a sum of terms alpha_i(f) * s_i(t), where each s_i is a modulated signal (noise witness × products of modulation witnesses) and each alpha_i is an optimal filter learned offline. The stationary case (modulation_order = 0) is plain multi-channel Wiener filtering.

NOMAD's primary production role is the noise measurement: the SGN calibration pipeline's CAL-NOLINES → CAL-CLEAN stage is a plain subtractor that needs some other process to compute what to subtract (in O4 this was the NonSENS front-end installation). nomad-subtract --measure-only --publish-noise is that process, publishing the noise-estimate channel to arrakis on witnesses alone. It can also do the subtraction itself and publish or frame the cleaned channel directly.

Status

  • v0.1: streaming application of trained models as an sgn pipeline, reading witness and target channels from arrakis (or frame files) and publishing the noise estimate and/or subtracted strain back to arrakis (or frames).
  • v0.2: native model training (nomad-train, scipy L-BFGS over the analytic cost/gradient — no TensorFlow), plus conversion of original nonsens pickles (nomad-convert-model).

Installation

pip install .            # runtime
pip install .[convert]   # + dill, for converting original nonsens pickles

Usage

Train a model (or convert an existing NonSENS pickle):

nomad-train --config lho_isc.yaml --data-source frames \
  --frame-cache O4.cache --start 1400000000 --end 1400000600 \
  --output lho_isc.h5

nomad-convert-model lho_isc.pickle lho_isc.h5   # legacy pickles

The training config's target defaults to {ifo}:GDS-CALIB_STRAIN_NOLINES: the noise estimate is consumed downstream of the line subtraction, so training against NOLINES keeps already-removed lines out of the CSD estimates. Set target in the config (or pass --target) to train against any other channel, e.g. raw GDS-CALIB_STRAIN — as in the original nonsens, the target is simply whatever channel you name. A minimal config:

ifo: H1
noise_witnesses: [ASC-DHARD_P_OUT_DQ, ASC-DHARD_Y_OUT_DQ, 60.0]  # numbers = synthesized lines
modulation_witnesses: []
fs: 1024
t_fft: 10
fband: [8, 256]
n_sos: 10
glitches: {band: [15, 20], threshold: 3.0e-20}

Production: measure the excess noise and publish the estimate for the calibration pipeline's CLEAN subtractor (no target channel needed):

export ARRAKIS_SERVER=grpc://...
nomad-subtract --model lho_isc.h5 --data-source arrakis --queue-timeout 30 \
  --measure-only --publish-noise --publisher-id nomad-h1 \
  --noise-channel-name H1:CAL-NOMAD_NOISE_ESTIMATE

Standalone cleaning — arrakis in, subtracted strain out:

nomad-subtract --model lho_isc.h5 --data-source arrakis --queue-timeout 30 \
  --publish-arrakis --publisher-id nomad-h1 \
  --output-channel-name H1:GDS-CALIB_STRAIN_NOMAD

Published channels must be pre-registered with the arrakis server under the given --publisher-id, at the target sample rate (float64). Note the noise estimate carries the model's FIR high-pass group delay (length/2 seconds) as stream latency; timestamps are true GPS times, so a timestamp-aligned downstream subtractor handles it naturally.

Run offline — frames in, frames out:

nomad-subtract --model lho_isc.h5 --data-source frames \
  --frame-cache O3.cache --start 1242441180 --end 1242443180 \
  --frame-output-path '{instruments}-{description}-{gps_start_time}-{duration}.gwf'

Channels rarely share a frame type (strain lives in HOFT frames, witnesses in raw R frames); pass each extra cache with --auxiliary-cache (repeatable). Cache entries are grouped by frame type, one file per type is probed for its channels, and each channel is read from whichever frame type provides it — a single concatenated mixed cache works too. This applies to nomad-train as well.

Development

hatch test           # run the test suite
hatch run check      # mypy

Golden-comparison tests against the original nonsens implementation are skipped unless NOMAD_GOLDEN=1 is set and nonsens is importable.

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

gw_nomad-0.1.0.tar.gz (247.6 kB view details)

Uploaded Source

Built Distribution

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

gw_nomad-0.1.0-py3-none-any.whl (82.1 kB view details)

Uploaded Python 3

File details

Details for the file gw_nomad-0.1.0.tar.gz.

File metadata

  • Download URL: gw_nomad-0.1.0.tar.gz
  • Upload date:
  • Size: 247.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for gw_nomad-0.1.0.tar.gz
Algorithm Hash digest
SHA256 eac8144b77df59760a15a21cd5451517255c364b66f09da917b3d034079359b2
MD5 f6ad92741118e84d5fd5bc8c15166a19
BLAKE2b-256 07f78a5469f5f631ef089eff12b82e02ea23e98bd2ff1122f93488e32af9f2e3

See more details on using hashes here.

File details

Details for the file gw_nomad-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gw_nomad-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 82.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for gw_nomad-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3eee1b0933ef8456506d2f3230b539f694325b1e14cd804a77b17ae8fa2b7c04
MD5 2a7f42a2abbefc45b8f5fbc00e9796aa
BLAKE2b-256 c0b468afc97f08e1a6b9fa52b81a4b2ba57431deaeb0c07d510c92c9cd39723f

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