sage.data.noise.mlmdc_noise

Filename = Foobar.py Description = Lorem ipsum dolor sit amet

Created on Fri Mar 25 13:06:22 2022

__author__ = nnarenraju __copyright__ = Copyright 2021, ProjectName __credits__ = nnarenraju __license__ = MIT Licence __version__ = 0.0.1 __maintainer__ = nnarenraju __email__ = nnarenraju@gmail.com __status__ = [‘inProgress’, ‘Archived’, ‘inUsage’, ‘Debugging’]

Github Repository: NULL

Documentation: NULL

Attributes

BLOCK_SAMPLES

Classes

NoiseGenerator

Legacy MLGWSC-1 noise generator using PyCBC-coloured Gaussian noise.

Module Contents

BLOCK_SAMPLES = 1638400[source]
class NoiseGenerator(dataset, seed=42, delta_f=0.04, sample_rate=2048.0, low_frequency_cutoff=15, detectors=['H1', 'L1'], asds=None)[source]

Bases: object

Legacy MLGWSC-1 noise generator using PyCBC-coloured Gaussian noise.

Generates noise coloured by amplitude spectral densities (ASDs) for a given dataset type (D1–D4 of MLGWSC-1), reproducing the exact noise model used in the challenge. Noise is generated per-detector with seeded reproducibility via NumPy’s RandomState.

Parameters:
  • dataset (str) – Dataset identifier (e.g. "D1", "D2", "D3", "D4").

  • seed (int) – Master random seed (default 42).

  • delta_f (float) – PSD frequency resolution in Hz (default 0.04).

  • sample_rate (float) – Sample rate in Hz (default 2048.0).

  • low_frequency_cutoff (float) – High-pass cutoff; PSD bins below this are zeroed (default 15).

  • detectors (list[str]) – Detector names (default ['H1', 'L1']).

  • asds (dict or None) – Pre-loaded ASD objects; if None they are computed from the dataset type.

dataset[source]
sample_rate = 2048.0[source]
low_frequency_cutoff = 15[source]
detectors = ['H1', 'L1'][source]
fixed_asds[source]
delta_f = 0.04[source]
plen = 1[source]
rs[source]
seed[source]
asd_options = None[source]
get(start, end, generate_duration=None)[source]

Generate coloured noise for all detectors for the requested GPS interval.

Parameters:
  • start (float) – GPS start and end times (seconds).

  • end (float) – GPS start and end times (seconds).

  • generate_duration (float or None) – Unused override for duration (kept for interface compatibility).

Returns:

Per-detector coloured-noise time-series.

Return type:

dict[str, pycbc.TimeSeries]

colored_noise(asd, start_time, end_time, seed=42, sample_rate=2048.0, filter_duration=128)[source]

Create noise from a PSD

Return noise from the chosen PSD. Note that if unique noise is desired a unique seed should be provided.

Parameters:
  • asd (pycbc.types.FrequencySeries) – ASD to color the noise

  • start_time (int) – Start time in GPS seconds to generate noise

  • end_time (int) – End time in GPS seconds to generate noise

  • seed ({None, int}) – The seed to generate the noise.

  • sample_rate ({16384, float}) – The sample rate of the output data. Keep constant if you want to ensure continuity between disjoint time spans.

  • filter_duration ({128, float}) – The duration in seconds of the coloring filter

Returns:

noise – A TimeSeries containing gaussian noise colored by the given psd.

Return type:

TimeSeries

normal(start, end, sample_rate=2048.0, seed=0)[source]

Generate data with a white Gaussian (normal) distribution

Parameters:
  • start_time (int) – Start time in GPS seconds to generate noise

  • end_time (int) – End time in GPS seconds to generate noise

  • sample-rate (float) – Sample rate to generate the data at. Keep constant if you want to ensure continuity between disjoint time spans.

  • seed ({None, int}) – The seed to generate the noise.

Returns:

noise – A TimeSeries containing gaussian noise

Return type:

TimeSeries

block(seed, sample_rate)[source]

Return block of normal random numbers

Parameters:
  • seed ({None, int}) – The seed to generate the noise.sd

  • sample_rate (float) – Sets the variance of the white noise

Returns:

noise – Array of random numbers

Return type:

numpy.ndarray