sage.data.non_astrophysical

Non-astrophysical (decoherent) two-detector sample generation for training the multi-detector consistency heads to reject incoherent coincidences.

A real astrophysical signal is coherent across detectors: a shared source gives a shared chirp mass and arrival times within the light-travel time. The two astrophysical training classes are therefore:

  • signal + signal (coherent injection) -> class 1, both detectors supervised

  • noise + noise (pure noise) -> class 0, neither supervised

To teach the network that coincidence alone is not detection, a small fraction of the batch is replaced by non-astrophysical pairs. Crucially these are background (class 0): they must eat into the noise budget, never the signal budget, or they would unbalance the classes. They are therefore built from a separate pool of extra injections (extra_batch on the signal sampler) and dropped into noise slots, not carved out of the coherent signals.

Two non-astrophysical flavours (split 50/50, fixed):

  • signal + noiseone detector carries a real chirp, the other is left as

    pure noise. Mask = [1, 0] / [0, 1]; class 0.

  • signal + signal’each detector carries a chirp from a different event

    (independent masses, independent arrival time). Mask = [1, 1] (each detector toward its own truth); class 0.

The thing that actually trips up a coincidence network is a non-astrophysical pair whose chirps sit in the real tc band — looking time-coincident while being mass-inconsistent. So each detector’s arrival time is re-drawn from a mixture that favours the real tc prior band and otherwise spreads across the whole analysis window, and the waveform is re-timed by a frequency-domain phase shift exp(-2 pi i f dt) (same convention as sage.data.waveform.project.GravitationalWaveProjection.forward()). All bounds are derived (real band from the tc prior, window from the data config) — nothing is hardcoded.

The per-detector mask (which detector carries a supervisable signal) is kept separate from the class label (whether the pair is a coherent astrophysical event): a decohered pair still has per-detector parameter targets while being labelled “not a detection”.

This is a TRAINING-ONLY augmentation; it must not be applied during validation. Currently implemented for the two-detector case (general D supported).

Classes

NonAstrophysicalMasker

Turn a pool of independent injections into non-astrophysical class-0 pairs.

Module Contents

class NonAstrophysicalMasker(delta_f, tc_bounds, analysis_length_s, p_signal_noise=0.5, w_in_band=0.5, edge_margin_s=0.1, seed=None)[source]

Turn a pool of independent injections into non-astrophysical class-0 pairs.

Parameters:
  • delta_f (float) – Frequency resolution (Hz) of the pool’s frequency-domain strain. The strain lives on a uniform real-FFT grid starting at DC, so the re-timing phase uses f[k] = k * delta_f over the data’s own bin count — this is exactly the grid the projection applies its own delay on. Take it from the signal sampler (signal_sampler.df).

  • tc_bounds (tuple(float, float)) – The real tc prior band (lo, hi) (derived from the parameter sampler). Re-drawn arrival times are weighted to favour this band.

  • analysis_length_s (float) – Length of the analysis window in seconds (data_cfg.sample_length_in_s). The full re-timing span is [edge_margin_s, analysis_length_s - edge_margin_s].

  • p_signal_noise (float) – Fraction of the pool made signal+noise (the rest signal+signal'). Fixed at 0.5 by design; exposed only for testing.

  • w_in_band (float) – Per-detector probability that a re-drawn tc lands in the real band rather than the full window. Higher -> more hard, time-coincident pairs.

  • edge_margin_s (float) – Keep-out margin (seconds) from the window edges for re-drawn tc.

  • seed (int or None) – Optional RNG seed (a device generator is created lazily on first call).

delta_f[source]
full_lo[source]
full_hi[source]
p_sn[source]
w_in_band[source]