lisa_noise.modelled.window

Taper-convolved (“windowed”) covariance.

The data are tapered before the FFT, d = rfft(w · x), so the covariance of frequency bin i is the model covariance convolved with the squared spectral window (Burke et al., “Zurückbleiben bitte”, Eq. 91):

C_w[i] = Σ_m k[m] · C[i − m],      k[m] = |fft(w)[m]|² / N²

with C(−f) = conj C(f). Where C is smooth over the width of k this is just mean(w²) · C. It differs at the TDI nulls and at the steep low-frequency end, so WindowedModel scales every bin and convolves only the patches of bins where the two differ.

Attributes

Classes

WindowedModel

Taper-convolved covariance k ⊛ C of any covariance model.

Functions

build_window(name, n_samples[, alpha]) → numpy.ndarray

The time-domain taper MojitoProcessor applied, from its recorded kwargs.

spectral_kernel(window) → numpy.ndarray

k[m] = |fft(w)[m]|² / N² at lags 0 .. N//2 (k is even).

kernel_half_width(kernel[, tol]) → int

Smallest lag that leaves a fraction tol of the kernel sum outside.

relative_deviation(a, b[, local_max_bins])

Per-bin largest |a − b| over the 3×3 entries, relative to the PSDs of b.

bins_to_convolve(deviation, tol, half_width, i_lo)

Mask of the bins where deviation > tol, widened by half the kernel width.

mask_to_patches(mask, max_len) → list[tuple[int, int]]

(start, stop) of every run of True, cut into equal parts of at most

Module Contents

lisa_noise.modelled.window.WINDOW_METHODS = ('patches', 'exact')
lisa_noise.modelled.window.MAX_PATCH = 3
lisa_noise.modelled.window.U_AET
lisa_noise.modelled.window.build_window(name: str, n_samples: int, alpha: float | None = None) → numpy.ndarray

The time-domain taper MojitoProcessor applied, from its recorded kwargs.

lisa_noise.modelled.window.spectral_kernel(window: numpy.ndarray) → numpy.ndarray

k[m] = |fft(w)[m]|² / N² at lags 0 .. N//2 (k is even).

lisa_noise.modelled.window.kernel_half_width(kernel: numpy.ndarray, tol: float = 1e-10) → int

Smallest lag that leaves a fraction tol of the kernel sum outside.

lisa_noise.modelled.window.relative_deviation(a: numpy.ndarray, b: numpy.ndarray, local_max_bins: int = 0)

Per-bin largest |a − b| over the 3×3 entries, relative to the PSDs of b.

With local_max_bins the PSDs are replaced by their running maximum over ±local_max_bins, which measures a null against its surroundings.

lisa_noise.modelled.window.bins_to_convolve(deviation: numpy.ndarray, tol: float, half_width: int, i_lo: int)

Mask of the bins where deviation > tol, widened by half the kernel width.

The low-frequency end grows with the fitted slope, so it is doubled in frequency.

lisa_noise.modelled.window.mask_to_patches(mask: numpy.ndarray, max_len: int) → list[tuple[int, int]]

(start, stop) of every run of True, cut into equal parts of at most max_len bins (short transforms keep the FFT round-off small).

class lisa_noise.modelled.window.WindowedModel(make_model: Any, freq: numpy.ndarray, window: numpy.ndarray, delta_t: float, seeds: Any, xp: Any = np, method: str = 'patches', patch_tol: float = 1e-05, kernel_tol: float = 1e-10)

Taper-convolved covariance k ⊛ C of any covariance model.

Parameters:
  • make_model (callable) – make_model(freq) returns a model(freq, params) -> (Nf, 3, 3) bound to freq (which may include DC; that row must be zero).

  • freq ((Nf,) array) – Science grid: a contiguous slice of np.fft.rfftfreq(N, delta_t).

  • window ((N,) array) – Time-domain taper applied to the data.

  • delta_t (float) – Sample interval in seconds.

  • seeds (sequence of arrays) – Parameter vectors at which the bins to convolve are located. The first is also used for the self-check.

  • xp (module, optional) – numpy or jax.numpy.

  • method ({"patches", "exact"}, optional) – "exact" convolves every bin.

  • patch_tol (float, optional) – Relative deviation from mean(w²) C above which a bin is convolved.

  • kernel_tol (float, optional) – Fraction of the kernel sum neglected beyond the guard band.

name = 'window'
inner
info
describe() → str

One-line summary for the log.