light_curve
- QhX.light_curve.generate_tiktok_signal(time_instances, initial_period, damping_factor_amplitude, damping_factor_frequency)[source]
Generates a ‘tik-tok’ signal based on the given parameters.
Parameters:
time_instances (array): Array of time instances for the signal generation.
initial_period (float): Initial period of the signal.
damping_factor_amplitude (float): Damping factor for the amplitude.
damping_factor_frequency (float): Damping factor for the frequency.
Returns:
array: Generated tik-tok signal values corresponding to the time instances.
- QhX.light_curve.get_lc22(data_manager, set1, include_errors=True)[source]
Process and return light curves with an option to include magnitude errors for a given set ID. This version is for fixed filters ranging from 0 to 3 and preserves MJD precision.
Parameters:
set1 (str): The object ID for which light curves are to be processed.
include_errors (bool, optional): Flag to include magnitude errors in the time series. Defaults to True.
Returns:
- tuple: Contains the processed time series with or without magnitude errors for each filter (0 to 3),
along with their respective sampling rates.
- QhX.light_curve.get_lctiktok(data_manager, set1, initial_period, damping_factor_amplitude, damping_factor_frequency, snr=None, inject_signal=False)[source]
Processes light curve data and optionally injects a tik-tok signal based on specified parameters.
Parameters:
set1: Identifier for the dataset to process.
initial_period (float): Initial period of the tik-tok signal.
damping_factor_amplitude (float): Damping factor affecting the amplitude of the tik-tok signal.
damping_factor_frequency (float): Damping factor affecting the frequency of the tik-tok signal.
snr (float, optional): Signal-to-noise ratio for the tik-tok signal.
inject_signal (bool): Flag to determine whether to inject the tik-tok signal into the light curve.
Returns:
tuple: Processed time and magnitude data for multiple filters, their sampling rates, and tik-tok signals if injected.
- QhX.light_curve.inject_tiktok_to_light_curve(real_times, real_light_curve, initial_period, damping_factor_amplitude, damping_factor_frequency, snr=None, inject_signal=False)[source]
Injects a tik-tok signal into a real light curve.
Parameters:
real_times (array): Array of time instances for the light curve.
real_light_curve (array): Original light curve data.
initial_period (float): Initial period of the tik-tok signal.
damping_factor_amplitude (float): Damping factor for the amplitude of the tik-tok signal.
damping_factor_frequency (float): Damping factor for the frequency of the tik-tok signal.
snr (float, optional): Signal-to-noise ratio for scaling the tik-tok signal.
inject_signal (bool): Flag to decide whether to inject the tik-tok signal or not.
Returns:
tuple: Modified light curve with tik-tok signal injected and the interpolated tik-tok signal.
- QhX.light_curve.outliers(time, flux, err_flux=None)[source]
Identifies and removes outliers from a light curve based on a Z-score threshold. This function applies a Z-score method to identify and remove outliers from light curve data. If flux error values are provided, the function considers these for a more nuanced outlier detection.
Parameters:
time (array): Array of time values.
flux (array): Array of flux values corresponding to the time values.
err_flux (array, optional): Array of flux error values. If provided, the function considers error-weighted Z-scores for outlier detection.
Returns:
tuple: A tuple consisting of arrays of time and flux values with outliers removed. If ‘err_flux’ is provided, returns a third array of flux error values with outliers removed.
Example:
Assuming time, flux, and err_flux are arrays with light curve data: >>> clean_time, clean_flux = outliers(time, flux) >>> clean_time, clean_flux, clean_err_flux = outliers(time, flux, err_flux)
- QhX.light_curve.outliers_mad(time, flux, err_flux=None, threshold_factor=3.0)[source]
Identifies and removes outliers from a light curve data set using Median Absolute Deviation (MAD). This function applies the MAD method to identify and remove outliers in light curve data. It can optionally consider errors in flux measurements for a more nuanced outlier detection. The outlier detection threshold is determined as a multiple of the MAD, with an optional inclusion of median error for adjustment.
Parameters:
time (array): Array of time values corresponding to light curve measurements.
flux (array): Array of flux values corresponding to the light curve.
err_flux (array, optional): Array of errors associated with flux measurements. If provided, these values adjust the outlier detection threshold.
threshold_factor (float, optional): A multiplier used with MAD to set the threshold for outlier detection. Default is 3.0. Smaller values imply stricter outlier removal.
Returns:
clean_time (array): Array of time values with outliers removed.
clean_flux (array): Array of flux values with outliers removed.
clean_err_flux (array, optional): Array of error flux values with outliers removed, returned only if err_flux is provided.
Example:
Assuming time, flux, and err_flux are arrays with light curve data:
>>> clean_time, clean_flux = outliers_mad(time, flux) >>> clean_time, clean_flux, clean_err_flux = outliers_mad(time, flux, err_flux)