wwtz

QhX.algorithms.wavelets.wwtz.compute_frequency_grid(Nn, minfq=None, maxfq=None)[source]

Computes the frequency grid for wavelet analysis given the periodis corresponding to minimum and maximum frequencies.

Parameters:

  • Nn (int): Number of grid points for the frequency axis.

  • minfq (float, optional): period correspoding to the Minimum frequency value. If None, a default value should be defined elsewhere.

  • maxfq (float, optional): period corresponding to the Maximum frequency value. If None, a default value should be defined elsewhere.

Returns:

tuple: Contains the frequency step (df), minimum frequency (fmin), and maximum frequency (fmax) for the grid.

Note:

  • The function assumes the input periods are in days so that freqeuncies are in days ^-1 (1/days).

  • If minfq or maxfq is None, ensure default values are set or passed to this function.

  • The function returns frequencies in the same units as periods corresponding to the minfq and maxfq.

QhX.algorithms.wavelets.wwtz.estimate_wavelet_periods(time_series, ngrid, known_period=None)[source]

Estimate minimum and maximum periods for wavelet analysis.

Parameters:

  • time_series (array): Array of time points in your data.

  • sampling_rate (float): The sampling rate of your data (data points per time unit).

  • known_period (float, optional): A known period in your data, if any.

Returns:

tuple: (min_period, max_period) estimated periods for analysis.

QhX.algorithms.wavelets.wwtz.hybrid2d(tt, mag, ntau, ngrid, minfq, maxfq, parallel=False, f=2, method='linear')[source]

Perform a hybrid 2D analysis involving WWZ (Weighted Wavelet Z-transform) and auto-correlation on light curve data.

This function computes the WWZ transformation of the input light curve data and then performs an auto-correlation analysis on the result. The frequency range for the analysis can be specified, as well as the decay constant and interpolation method for WWZ.

Parameters:

  • tt: array_like

    Array of time data for the light curve.

  • mag: array_like

    Array of magnitude values corresponding to the time data.

  • ntau: int

    Number of time divisions for the WWZ analysis.

  • ngrid: int

    Number of grid points (frequency resolution) for the WWZ analysis.

  • minfq: float

    Minimum frequency (or corresponding period) for WWZ analysis.

  • maxfq: float

    Maximum frequency (or corresponding period) for WWZ analysis.

  • f: float, optional

    Decay constant for the analyzing wavelet in WWZ, by default 2.

  • method: str, optional

    Interpolation method used in WWZ (‘linear’ or ‘octave’), by default ‘linear’.

Returns:

A tuple containing:

  • WWZ matrix: The WWZ analysis result.

  • Auto-correlation matrix: The result of auto-correlation analysis.

  • Frequency range extent: The extent of the frequency range for plotting.

Examples:

>>> tt = [0, 1, 2, 3, 4]
>>> mag = [10, 11, 12, 13, 14]
>>> wwz_result, acorr_result, freq_extent = hybrid2d(tt, mag, 100, 50, 0.1, 1.0)
QhX.algorithms.wavelets.wwtz.inp_param(ntau, ngrid, minfq, maxfq, parallel=False, f=2)[source]

Calculate the input parameters for WWZ (Weighted Wavelet Z-transform) analysis.

Parameters:

  • ntau (int): Number of time delays to use in the wavelet analysis.

  • ngrid (int): Number of grid points for frequency analysis.

  • minfq (float): period corresponding to the Minimum frequency for analysis.

  • maxfq (float): period corresponding to the Maximum frequency for analysis.

  • f (float): Frequency multiplier for calculating the decay constant. Default is 2.

Returns:

  • ntau (int): Number of time delays.

  • frequency_parameters (list): List containing frequency parameters [freq_low, freq_high, freq_step, override].

  • decay_constant (float): Decay constant for the wavelet.

  • parallel (bool): Flag to enable parallel processing, will use all available cores.

Note:

  • The decay constant is calculated based on the frequency ‘f’ and is used to define the shape of the analyzing wavelet.

QhX.algorithms.wavelets.wwtz.wwt1(tt, mag, ntau, ngrid, minfq, maxfq, parallel=False, f=2, method='linear')[source]

Calculate the Weighted Wavelet Z-transform (WWZ) of a given time series signal.

Parameters:

  • tt (list): List of time data points.

  • mag (list): List of magnitude values corresponding to time points in ‘tt’.

  • ntau (int): Number of time divisions for WWZ analysis.

  • ngrid (int): Grid size for frequency analysis in WWZ.

  • minfq (float): period corresponidng to the Minimum frequency for WWZ analysis.

  • maxfq (float): period corresponidng to the maximum frequency for WWZ analysis.

  • f (float): Frequency multiplier for calculating the decay constant in WWZ. Default is 2.

  • method (str): Method for frequency analysis, either ‘linear’ or ‘octave’. Default is ‘linear’.

Returns:

  • WWZ matrix coefficients: The result of WWZ analysis as provided by the ‘libwwz’ library.

Notes:

  • The ‘method’ parameter allows selection between linear and octave frequency scaling.