Auxiliary Functions

gwtails.auxiliary.compute_tail_exponent(t, f, use_filter=True, window_length=800, polyorder=4)[source]

Compute tail exponent p from time series data.

Parameters:

tarray-like

Time array

farray-like

Strain/psi4 amplitude data

use_filterbool, default True

Whether to apply Savgol filter to the computed exponent

window_lengthint, default 800

Length of filter window (must be odd)

polyorderint, default 4

Order of polynomial used in filtering

Returns:

parray-like

Tail exponent (filtered if use_filter=True)

gwtails.auxiliary.compute_frequency(t, h, method='spline', s=0.01, window_length=800, polyorder=4)[source]

Computes orbital frequency of a given gravitational wave time-series.

Parameters:

tarray-like

Time array

harray-like

Waveform mode array or psi4 array

methodstr, default ‘spline’

Method for computing frequency: ‘spline’ or ‘savgol’

sfloat, default 0.01

Smoothing parameter for spline interpolation

window_lengthint, default 800

Window length for Savgol filter (used if method=’savgol’)

polyorderint, default 4

Polynomial order for Savgol filter

Returns:

freqarray-like

Orbital frequency

gwtails.auxiliary.find_tail_start(t, h, freq_threshold=0.001, consecutive_zeros=5, method='spline', merger_time=10, **freq_kwargs)[source]

Find the start of the tail by detecting consecutive frequency zeros.

Parameters:

tarray-like

Time array

harray-like

Strain/psi4 data

freq_thresholdfloat, default 1e-4

Threshold below which absolute frequency is considered zero

consecutive_zerosint, default 5

Number of consecutive zero frequencies required

methodstr, default ‘spline’

Method for frequency computation (‘spline’ or ‘savgol’)

merger_timefloat, default 10

Time before which data is ignored (ensures tail is after merger)

**freq_kwargsdict

Additional arguments for compute_frequency function

Returns:

tail_start_timefloat

Time at which tail starts

tail_start_indexint

Index at which tail starts (in original array)

frequencyarray

Computed normalized frequency array

zero_maskarray

Boolean mask showing where frequency is considered zero

gwtails.auxiliary.calculate_chi_square(data, model, sigma)[source]

Calculate chi-square statistic.

gwtails.auxiliary.reduced_chi2(data, model, sigma, n_params)[source]

Calculate reduced chi-square (chi2 / degrees of freedom).