sage.data.primer.get_psds

Filename : get_psds.py Description : Short description of the file

Created on 2025-12-16 15:44:10

__author__ = Narenraju Nagarajan __copyright__ = Copyright 2025, ProjectName __license__ = MIT Licence __version__ = 0.0.1 __maintainer__ = Narenraju Nagarajan __affiliation__ = N/A __email__ = N/A __status__ = [‘inProgress’, ‘Archived’, ‘inUsage’, ‘Debugging’]

GitHub Repository: NULL

Documentation: NULL

Classes

EstimatePSD

Estimate a fiducial PSD by sampling noise from the active noise pipeline.

Module Contents

class EstimatePSD(*, detector, num_samples=200000, psd_method=None, blackout_policy=None, store_psds_as_hdf5=False, store_psds_as_bin=False, apply_inverse_spectrum_truncation=False, max_filter_len=None, low_frequency_cutoff=15.0, trunc_method='hann', interpolate_psd=False, training_sample_length=None, psd_smoothener=None, **kwargs)[source]

Estimate a fiducial PSD by sampling noise from the active noise pipeline.

Parameters:
  • detector (str)

  • num_samples (int)

  • store_psds_as_hdf5 (bool)

  • store_psds_as_bin (bool)

  • apply_inverse_spectrum_truncation (bool)

  • max_filter_len (int | None)

  • low_frequency_cutoff (float | None)

  • trunc_method (str)

  • interpolate_psd (bool)

cfg = None[source]
data_cfg = None[source]
detector[source]
num_samples = 200000[source]
psd_method = None[source]
blackout_policy[source]
store_psds_as_hdf5 = False[source]
store_psds_as_bin = False[source]
apply_ist = False[source]
max_filter_len = None[source]
low_frequency_cutoff = 15.0[source]
trunc_method = 'hann'[source]
interpolate_psd = False[source]
training_sample_length = None[source]
psd_smoothener = None[source]
taper(freqs, psd, psd_floor=3.16e-23)[source]

Apply a cosine roll-off below the low-frequency cutoff.

Smoothly transitions the PSD from psd_floor at DC to the measured value at low_frequency_cutoff, imposing C¹ continuity and reducing time-domain ringing.

Parameters:
  • freqs (numpy.ndarray) – Frequency array (Hz).

  • psd (numpy.ndarray) – PSD array to be tapered (modified in-place).

  • psd_floor (float) – Noise floor value applied at DC (default 3.16e-23).

Returns:

Tapered PSD (same object as psd).

Return type:

numpy.ndarray

estimate_raw_psds(*, noise_sampler, duration, return_fiducial=False)[source]

Run PSD estimation to get recolour and fiducial psds

estimate_segment_psds(*, noise_segments_file)[source]

Compute Welch PSD for each noise segment in a bin file.

Parameters:
  • noise_segments_file – path to noise .bin file

  • output_dir – directory to write PSD bin + metadata