light_curve
- 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.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)