MicroLIA.features

Created on Thu Jan 12 14:30:12 2017

@author: danielgodinez

Module Contents

Functions

abs_energy(→ float)

Compute the absolute energy of a light curve.

abs_sum_changes(→ float)

Compute the absolute sum of changes in a light curve.

above1(→ float)

Fraction of points more than 1σ above the median.

above3(→ float)

Fraction of points more than 3σ above the median.

above5(→ float)

Fraction of points more than 5σ above the median.

amplitude(→ float)

Estimate the amplitude of a light curve using clipped percentiles.

AndersonDarling(→ float)

Compute the Anderson–Darling statistic as a measure of normality.

auto_corr(→ float)

Compute the lag-1 autocorrelation of a light curve.

below1(→ float)

Fraction of points more than 1σ below the median.

below3(→ float)

Fraction of points more than 3σ below the median.

below5(→ float)

Fraction of points more than 5σ below the median.

benford_correlation(→ float)

Correlation with Benford's Law based on first significant digit frequencies.

c3(→ float)

Third-order autocorrelation statistic (C₃) of a light curve.

check_for_duplicate(→ float)

Check for duplicate or nearly duplicate light curve values.

check_for_max_duplicate(→ float)

Check for duplicate maximum values in a light curve.

check_for_min_duplicate(→ float)

Check for duplicate minimum values in a light curve.

check_max_last_loc(→ float)

Relative position of the last occurrence of the maximum value in a light curve.

check_min_last_loc(→ float)

Relative position of the last occurrence of the minimum value in a light curve.

complexity(→ float)

Estimate the local complexity of a light curve using root-mean-square of differences.

con_above1(→ float)

Fraction of clusters of ≥3 consecutive significantly bright points.

con_above3(→ float)

Fraction of clusters of ≥3 consecutive significantly bright points.

con_above5(→ float)

Fraction of clusters of ≥3 consecutive significantly bright points.

con_below1(→ float)

Fraction of clusters of ≥3 consecutive significantly dim points.

con_below3(→ float)

Fraction of clusters of ≥3 consecutive significantly dim points.

con_below5(→ float)

Fraction of clusters of ≥3 consecutive significantly dim points.

count_above(→ float)

Fraction of light curve points above the median.

count_below(→ float)

Fraction of light curve points below the median.

cusum(→ float)

Cumulative sum (CUSUM) variability index.

first_loc_max(→ float)

Normalized location of the first occurrence of the maximum value.

first_loc_min(→ float)

Normalized location of the first occurrence of the minimum value.

FluxPercentileRatioMid20(→ float)

Flux percentile ratio for the middle 20% of the light curve.

FluxPercentileRatioMid35(→ float)

Flux percentile ratio for the middle 35% of the light curve.

FluxPercentileRatioMid50(→ float)

Flux percentile ratio for the middle 50% of the light curve.

FluxPercentileRatioMid65(→ float)

Flux percentile ratio for the middle 65% of the light curve.

FluxPercentileRatioMid80(→ float)

Flux percentile ratio for the middle 80% of the light curve.

Gskew(→ float)

Robust skewness estimator using extreme quantiles (G-skew).

half_mag_amplitude_ratio(→ float)

Ratio of variability amplitude above vs. below the median.

index_mass_quantile(→ float)

Index at which a given fraction of the absolute cumulative flux is reached.

integrate(→ float)

Numerical integration of the light curve using the trapezoidal rule.

kurtosis(→ float)

Weighted or unweighted kurtosis of the light curve.

large_standard_deviation(→ float)

Binary indicator for large standard deviation relative to dynamic range.

LinearTrend(→ float)

Slope of the best-fit linear trend in the light curve.

longest_strike_above(→ float)

Longest consecutive run of points significantly above the median.

longest_strike_below(→ float)

Longest consecutive run of points significantly below the median.

MaxSlope(→ float)

Maximum or weighted average absolute slope between consecutive light curve points.

mean_abs_change(→ float)

Mean or weighted mean of absolute changes between consecutive light curve points.

mean_change(→ float)

Mean or weighted mean of signed changes between consecutive light curve points.

meanMag(→ float)

Mean or weighted mean of the light curve values.

mean_n_abs_max(→ float)

Mean or weighted mean of the top-N largest absolute light curve values.

mean_second_derivative(→ float)

Mean or weighted mean of the discrete second derivative in a light curve.

medianAbsDev(→ float)

Median Absolute Deviation (MAD) of the light curve.

median_buffer_range(→ float)

Fraction of light curve points within ±10% of the semi-amplitude around the central value.

median_distance(→ float)

Median Euclidean distance between consecutive light curve points in time-magnitude space.

number_cwt_like_peaks(→ float)

Normalized count of CWT-like peaks in a light curve using simple prominence and width criteria.

number_of_crossings(→ float)

Fraction of sign changes relative to the median of the light curve.

PairSlopeTrend(→ float)

Trend fraction based on slopes of recent consecutive magnitude pairs.

PercentAmplitude(→ float)

Maximum percent deviation from the (weighted) median magnitude.

PercentDifferenceFluxPercentile(→ float)

Inter-percentile range divided by the median: (F95 − F5) / median.

permutation_entropy(→ float)

Permutation entropy of the light curve.

prominence_peaks(→ float)

Detects prominent peaks in a light curve using slope changes and thresholding.

quantile_5(→ float)

5th percentile value of the light curve. This is useful for describing the brightness distribution

quantile_25(→ float)

25th percentile value of the light curve. This is useful for describing the brightness distribution

quantile_50(→ float)

Median (50th percentile) value of the light curve. This is useful for describing the brightness distribution

quantile_75(→ float)

75th percentile value of the light curve. This is useful for describing the brightness distribution

quantile_95(→ float)

95th percentile value of the light curve. This is useful for describing the brightness distribution

ratio_recurring_points(→ float)

Ratio of recurring values in the light curve.

root_mean_squared(→ float)

Root-mean-square (RMS) deviation of the light curve magnitudes.

sample_entropy(→ float)

Sample entropy of the light curve.

shannon_entropy(→ float)

Shannon–type entropy of a light curve.

shapiro_wilk(→ float)

Shapiro–Wilk normality test statistic for light-curve data.

skewness(→ float)

Weighted or unweighted skewness of the light-curve distribution.

std_over_mean(→ float)

Coefficient of variation (σ / μ) of the light-curve values.

stetsonJ(→ float)

Stetson's J variability index.

stetsonK(→ float)

Stetson's K variability index.

stetsonL(→ float)

Stetson's L variability index.

sum_values(→ float)

Mean value of the light curve (weighted or unweighted).

symmetry_looking(→ float)

Symmetry indicator based on mean–median agreement.

time_reversal_asymmetry(→ float)

Time-reversal asymmetry statistic with τ-lag.

time_reversal_asymmetry_normalized(→ float)

Normalized time-reversal asymmetry (TREV) statistic.

variance(→ float)

Weighted/unweighted variance of the light curve.

variance_larger_than_standard_deviation(→ float)

Binary test: is variance greater than standard deviation?

variation_coefficient(→ float)

Coefficient of variation (σ / μ).

vonNeumannRatio(→ float)

Von Neumann's η statistic: ratio of successive differences to variance.

windowed_peak_fraction(→ float)

Normalized number of local peaks in the light curve.

MicroLIA.features.abs_energy(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Compute the absolute energy of a light curve.

This statistic measures the total signal energy, defined as the sum of squared amplitudes. It is useful as a general indicator of overall variability, but does not consider time structure.

Parameters:
  • time (array-like) – Time values corresponding to each measurement. Not used in this function, but included for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Measurement uncertainties associated with mag.

  • apply_weights (bool, optional (default=True)) – Whether to apply inverse-variance weighting using magerr.

Returns:

Absolute energy of the light curve.

Return type:

float

Notes

  • If apply_weights=True, the energy is computed as a weighted sum using weights ∝ 1 / magerr².

  • Input can be magnitudes or fluxes, but normalized flux (e.g., min-max scaling) is recommended to ensure consistent interpretation across objects.

  • This feature is insensitive to time sampling and does not require even sampling.

MicroLIA.features.abs_sum_changes(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Compute the absolute sum of changes in a light curve.

This metric quantifies the total variation by summing the absolute differences between consecutive measurements. It serves as a simple indicator of short-timescale variability.

Parameters:
  • time (array-like) – Time values corresponding to each measurement. Not used in this function, but included for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Measurement uncertainties associated with mag.

  • apply_weights (bool, optional (default=True)) – If True, differences are weighted by the inverse uncertainty in each pair of measurements (1 / sqrt(σ_i² + σ_{i+1}²)).

Returns:

Sum of absolute changes, optionally weighted by uncertainty.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

  • Useful for identifying short-term variability or stochastic behavior.

  • Not robust to outliers unless pre-processed or normalized.

MicroLIA.features.above1(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Fraction of points more than 1σ above the median.

This statistic measures the proportion of light curve points that lie more than one standard deviation above the median value. It can be used as a simple indicator of asymmetric variability or outburst-like behavior.

Parameters:
  • time (array-like) – Time values for the light curve. Not used in the calculation but retained for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Measurement uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, computes a weighted fraction using inverse-variance weighting.

Returns:

Fraction of data points that are >1σ above the median.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Best used with normalized flux, but compatible with magnitudes or raw flux values.

  • Sensitive to outliers and skewed distributions; robust normalization is recommended if noise is high.

MicroLIA.features.above3(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Fraction of points more than 3σ above the median.

This statistic quantifies the fraction of light curve values that exceed the median by more than three times the local uncertainty (3σ). It highlights strong positive deviations that may correspond to flares, outbursts, or anomalies.

Parameters:
  • time (array-like) – Time values for the light curve. Not used in the calculation but retained for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Measurement uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, computes a weighted fraction using inverse-variance weighting.

Returns:

Fraction of data points that are >3σ above the median.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Best used with normalized flux, but compatible with magnitudes or raw flux values.

  • Sensitive to outliers and skewed distributions; robust normalization is recommended if noise is high.

MicroLIA.features.above5(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Fraction of points more than 5σ above the median.

This statistic calculates the proportion of light curve values that are more than five standard deviations above the median. It is useful for identifying extreme positive outliers such as strong flares, transients, or artifacts.

Parameters:
  • time (array-like) – Time values for the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Measurement uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, computes a weighted fraction using inverse-variance weighting.

Returns:

Fraction of data points that are >5σ above the median.

Return type:

float

Notes

  • Suitable for light curves with uneven sampling, since time information is not used.

  • Best used with normalized flux, but compatible with magnitudes or raw flux values.

  • Sensitive to outliers and skewed distributions; robust normalization is recommended if noise is high.

MicroLIA.features.amplitude(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True, pct_clip: float = 1.0) float[source]

Estimate the amplitude of a light curve using clipped percentiles.

This statistic computes the difference between the upper and lower percentile bounds of the light curve, which serves as a robust proxy for amplitude. The percentile clipping (e.g., 1st–99th) reduces the influence of outliers.

Parameters:
  • time (array-like) – Time values corresponding to each measurement. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Measurement uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, applies inverse-variance weighting when computing percentiles.

  • pct_clip (float, optional (default=1.0)) – Lower and upper percentiles used to define amplitude. For example, pct_clip=1.0 computes the 1st–99th percentile range. Must be between 0 and 50.

Returns:

Estimated amplitude (difference between high and low clipped percentiles).

Return type:

float

Notes

  • Robust to noise and outliers due to percentile-based clipping.

  • Suitable for unevenly sampled light curves; time is not used.

  • Best used with normalized flux, but compatible with magnitudes or raw flux values.

  • If magerr is poorly estimated or zero everywhere, unweighted percentiles are used.

MicroLIA.features.AndersonDarling(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Compute the Anderson–Darling statistic as a measure of normality.

This function evaluates how well the distribution of light curve values fits a Gaussian profile, using the Anderson–Darling test. A logistic transformation is applied to the statistic to bound the output between 0 and 1, with higher values indicating stronger deviation from normality.

Parameters:
  • time (array-like) – Time values for the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Measurement uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, the Anderson–Darling test is applied to the standardized residuals using inverse-variance weights.

Returns:

A logistic-transformed Anderson–Darling score between 0 and 1, where higher values indicate greater deviation from normality.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Best applied to normalized flux to reduce scaling sensitivity.

  • The output is nonlinearly scaled using a logistic transformation of the A² statistic, bounding it between 0 and 1.

  • When apply_weights=True, the test uses weighted estimates for the mean and variance.

MicroLIA.features.auto_corr(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Compute the lag-1 autocorrelation of a light curve.

This metric measures the correlation between adjacent points in the light curve, i.e., how similar each value is to its immediate neighbor. A high value indicates smooth, slowly varying behavior; a low or negative value suggests more random or rapidly changing signals.

Parameters:
  • time (array-like) – Time values for the light curve. Not used in the calculation but retained for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Measurement uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, applies inverse-variance weighting when computing the autocorrelation.

Returns:

Lag-1 autocorrelation coefficient. Returns NaN if the input is too short or the denominator is zero.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Best used with normalized flux, but compatible with magnitudes or raw flux values.

  • If apply_weights=True, weighted means and covariances are used.

MicroLIA.features.below1(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Fraction of points more than 1σ below the median.

This statistic measures the proportion of light curve values that lie more than one standard deviation below the median. It serves as an indicator of dimming events or asymmetric variability skewed toward fainter fluxes.

Parameters:
  • time (array-like) – Time values for the light curve. Not used in the calculation but retained for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Measurement uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, computes a weighted fraction using inverse-variance weighting.

Returns:

Fraction of data points that are >1σ fainter than the median.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.below3(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Fraction of points more than 3σ below the median.

This statistic measures the proportion of light curve values that are more than three standard deviations fainter than the median. It is designed to capture deep dimming events, eclipses, or significant negative outliers.

Parameters:
  • time (array-like) – Time values for the light curve. Not used in the calculation but retained for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Measurement uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, computes a weighted fraction using inverse-variance weighting.

Returns:

Fraction of data points that are >3σ fainter than the median.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.below5(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Fraction of points more than 5σ below the median.

This statistic measures the proportion of light curve values that are more than five standard deviations fainter than the median. It is particularly useful for detecting rare or extreme dimming events such as deep eclipses or dropouts.

Parameters:
  • time (array-like) – Time values for the light curve. Not used in the calculation but retained for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Measurement uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, computes a weighted fraction using inverse-variance weighting.

Returns:

Fraction of data points that are >5σ fainter than the median.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.benford_correlation(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Correlation with Benford’s Law based on first significant digit frequencies.

This statistic compares the distribution of first significant digits in the light curve values to the expected distribution from Benford’s Law. A high correlation indicates that the data follow Benford-like behavior, which has been proposed as a signature of natural, noise-like variability.

Parameters:
  • time (array-like) – Time values for the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Measurement uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, computes weighted digit frequencies using inverse-variance weights.

Returns:

Pearson correlation coefficient between the observed digit distribution and the theoretical Benford distribution. Returns NaN if input is empty or contains no valid digits.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Best used with raw or log-transformed fluxes; normalized flux may suppress digit diversity.

  • First significant digits are extracted by computing: floor(|x| / 10^floor(log10(|x|))) for each nonzero, finite value x in mag. For example: 345.2 –> 3, 0.012 –> 1

  • Benford’s Law expects first digits to follow a logarithmic distribution: P(d) = log10(1 + 1/d), for d ∈ {1,…,9}.

  • May serve as a statistical regularity check or anomaly detector.

MicroLIA.features.c3(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True, lag: int = 1) float[source]

Third-order autocorrelation statistic (C₃) of a light curve.

This feature measures the average product of triplets of light curve values separated by a fixed lag. It captures higher-order temporal structure, such as phase correlations and coherent trends beyond simple pairwise autocorrelation.

Parameters:
  • time (array-like) – Time values for the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Measurement uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, each triplet is weighted by the inverse variance of the combined uncertainty.

  • lag (int, optional (default=1)) – Time step (in array index units) between elements in the triplet. The function evaluates the product of values at positions (i, i+lag, i+2*lag).

Returns:

Mean third-order product of lagged triplets, optionally weighted. Returns NaN if the array is too short for the specified lag.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

  • Can detect asymmetries and nonlinear temporal correlations not captured by standard autocorrelation.

  • Requires at least 2 * lag + 1 points to be valid.

MicroLIA.features.check_for_duplicate(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Check for duplicate or nearly duplicate light curve values.

This function detects whether the input light curve contains repeated values. If apply_weights=True, values are considered duplicates if they are indistinguishable within photometric uncertainty using a tolerance-based comparison.

Parameters:
  • time (array-like) – Time values for the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Measurement uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, uses a tolerance-based comparison that accounts for measurement errors. If False, checks for exact duplicates.

Returns:

1 if any duplicates are detected, 0 otherwise.

Return type:

int

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Useful for detecting flat or non-variable signals.

MicroLIA.features.check_for_max_duplicate(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Check for duplicate maximum values in a light curve.

This function determines whether the maximum value in the light curve appears more than once. If apply_weights=True, values are considered equal if they are within 3σ of each other, accounting for photometric uncertainty.

Parameters:
  • time (array-like) – Time values for the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Measurement uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, duplicates of the maximum value are detected within a tolerance of 3 times the corresponding measurement error. If False, an exact match is required.

Returns:

1 if the maximum value (within tolerance) appears more than once, 0 otherwise.

Return type:

int

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

  • Useful for detecting plateau-like maxima or saturation effects in light curves.

MicroLIA.features.check_for_min_duplicate(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Check for duplicate minimum values in a light curve.

This function determines whether the minimum value in the light curve appears more than once. If apply_weights=True, values are considered equal if they are within 3σ of each other, accounting for photometric uncertainty.

Parameters:
  • time (array-like) – Time values for the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Measurement uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, duplicates of the minimum value are detected within a tolerance of 3 times the corresponding measurement error. If False, an exact match is required.

Returns:

1 if the minimum value (within tolerance) appears more than once, 0 otherwise.

Return type:

int

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

  • Useful for identifying repeated dimming events, eclipses, or floor effects in light curves.

MicroLIA.features.check_max_last_loc(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Relative position of the last occurrence of the maximum value in a light curve.

This function checks where (in normalized index units) the last occurrence of the maximum value appears in the light curve. If apply_weights=True, matches to the maximum value are allowed within a 3σ photometric uncertainty tolerance.

Parameters:
  • time (array-like) – Time values for the light curve. Not used in the calculation but retained for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Measurement uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, the maximum match is evaluated using a tolerance of 3 times the measurement error. If False, an exact match is used.

Returns:

A value between 0 and 1 indicating how close to the end of the time series the last occurrence of the maximum value occurs. Returns NaN if the input is empty or no match is found.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

  • Useful for detecting whether a light curve ends with a peak (e.g., rising events, flares).

  • A value close to 1 means the max value appears near the start of the time series; close to 0 means it appears near the end.

MicroLIA.features.check_min_last_loc(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Relative position of the last occurrence of the minimum value in a light curve.

This function determines where (in normalized index units) the last occurrence of the minimum value appears in the light curve. If apply_weights=True, values within 3σ of the minimum are treated as equivalent matches.

Parameters:
  • time (array-like) – Time values for the light curve. Not used in the calculation but retained for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Measurement uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, the minimum match is evaluated using a tolerance of 3 times the measurement error. If False, an exact match is used.

Returns:

A value between 0 and 1 indicating how close to the end of the time series the last occurrence of the minimum value appears. Returns NaN if the input is empty or no match is found.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

  • Useful for detecting events where dimming or troughs occur at the end of the observation window.

  • A value near 0 implies the minimum occurred near the end; near 1 implies it occurred near the start of the light curve.

MicroLIA.features.complexity(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Estimate the local complexity of a light curve using root-mean-square of differences.

This feature quantifies short-timescale variability by computing the RMS of first-order differences in the light curve. It reflects the degree of irregularity in the signal and is sensitive to noise, flickering, and fast variability.

Parameters:
  • time (array-like) – Time values for the light curve. Not used in the calculation but retained for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Measurement uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, weights the squared differences using the inverse variance from magerr.

Returns:

Root-mean-square of first-order differences, optionally weighted. Returns NaN if the input length is less than 2 or weights are zero.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

  • Sensitive to both real high-frequency variability and measurement noise.

MicroLIA.features.con_above1(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Fraction of clusters of ≥3 consecutive significantly bright points.

This metric identifies and counts “clusters” of three or more consecutive light-curve points that are ≥1σ brighter than the baseline magnitude. The result is normalized by the total number of light-curve points.

Parameters:
  • time (array-like) – Time stamps of the light curve. Not used directly in the calculation.

  • mag (array-like) – Light curve values. Can fluxes, or normalized fluxes.

  • magerr (array-like) – Measurement uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, applies a per-point threshold of 1 × magerr relative to the median. If False, uses a global 1σ threshold based on the standard deviation of mag.

Returns:

Fraction of light curve points that are part of clusters of ≥3 consecutive ≥1σ bright excursions. Defined as N_clusters / N_points.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, and is designed for flux space.

  • Used to detect bursting or flare-like variability patterns.

MicroLIA.features.con_above3(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Fraction of clusters of ≥3 consecutive significantly bright points.

This metric identifies and counts “clusters” of three or more consecutive light-curve points that are ≥3σ brighter than the baseline magnitude. The result is normalized by the total number of light-curve points.

Parameters:
  • time (array-like) – Time stamps of the light curve. Not used directly in the calculation.

  • mag (array-like) – Light curve values. Can be fluxes, or normalized fluxes.

  • magerr (array-like) – Measurement uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, applies a per-point threshold of 3 × magerr relative to the median. If False, uses a global 3σ threshold based on the standard deviation of mag.

Returns:

Fraction of light curve points that are part of clusters of ≥3 consecutive ≥3σ bright excursions. Defined as N_clusters / N_points.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, and is designed for flux space.

  • Used to detect bursting or flare-like variability patterns.

MicroLIA.features.con_above5(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Fraction of clusters of ≥3 consecutive significantly bright points.

This metric identifies and counts “clusters” of three or more consecutive light-curve points that are ≥5σ brighter than the baseline magnitude. The result is normalized by the total number of light-curve points.

Parameters:
  • time (array-like) – Time stamps of the light curve. Not used directly in the calculation.

  • mag (array-like) – Light curve values. Can fluxes, or normalized fluxes.

  • magerr (array-like) – Measurement uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, applies a per-point threshold of 5 × magerr relative to the median. If False, uses a global 5σ threshold based on the standard deviation of mag.

Returns:

Fraction of light curve points that are part of clusters of ≥3 consecutive ≥5σ bright excursions. Defined as N_clusters / N_points.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, and is designed for flux space.

  • Used to detect bursting or flare-like variability patterns.

MicroLIA.features.con_below1(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Fraction of clusters of ≥3 consecutive significantly dim points.

This metric identifies and counts “clusters” of three or more consecutive light-curve points that are ≥1σ dimmer than the baseline magnitude. The result is normalized by the total number of light-curve points.

Parameters:
  • time (array-like) – Time stamps of the light curve. Not used directly in the calculation.

  • mag (array-like) – Light curve values. Can be fluxes or normalized fluxes.

  • magerr (array-like) – Measurement uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, applies a per-point threshold of 1 × magerr relative to the median. If False, uses a global 1σ threshold based on the standard deviation of mag.

Returns:

Fraction of light curve points that are part of clusters of ≥3 consecutive ≥1σ dim excursions. Defined as N_clusters / N_points.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, and is designed for flux space.

  • Useful for detecting dips, eclipses, or transits.

MicroLIA.features.con_below3(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Fraction of clusters of ≥3 consecutive significantly dim points.

This metric identifies and counts “clusters” of three or more consecutive light-curve points that are ≥3σ dimmer than the baseline magnitude. The result is normalized by the total number of light-curve points.

Parameters:
  • time (array-like) – Time stamps of the light curve. Not used directly in the calculation.

  • mag (array-like) – Light curve values. Can be fluxes or normalized fluxes.

  • magerr (array-like) – Measurement uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, applies a per-point threshold of 3 × magerr relative to the median. If False, uses a global 3σ threshold based on the standard deviation of mag.

Returns:

Fraction of light curve points that are part of clusters of ≥3 consecutive ≥3σ dim excursions. Defined as N_clusters / N_points.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, and is designed for flux space.

  • Useful for detecting dips, eclipses, or transits.

MicroLIA.features.con_below5(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Fraction of clusters of ≥3 consecutive significantly dim points.

This metric identifies and counts “clusters” of three or more consecutive light-curve points that are ≥5σ dimmer than the baseline magnitude. The result is normalized by the total number of light-curve points.

Parameters:
  • time (array-like) – Time stamps of the light curve. Not used directly in the calculation.

  • mag (array-like) – Light curve values. Can be fluxes or normalized fluxes.

  • magerr (array-like) – Measurement uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, applies a per-point threshold of 5 × magerr relative to the median. If False, uses a global 5σ threshold based on the standard deviation of mag.

Returns:

Fraction of light curve points that are part of clusters of ≥3 consecutive ≥5σ dim excursions. Defined as N_clusters / N_points.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, and is designed for flux space.

  • Useful for detecting dips, eclipses, or transits.

MicroLIA.features.count_above(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Fraction of light curve points above the median.

This metric calculates the proportion of light curve values that are greater than the median. It is a simple measure of asymmetry or skewness in the distribution of values. When apply_weights=True, the comparison is made to the weighted median, and the result is a weighted fraction.

Parameters:
  • time (array-like) – Time stamps of the light curve. Not used in the calculation but retained for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, uses inverse-variance weights to compute the median and resulting fraction. If False, performs an unweighted comparison to the simple median.

Returns:

Fraction of values greater than the (weighted) median. Returns a weighted sum of points above the median if apply_weights=True.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.count_below(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Fraction of light curve points below the median.

This metric computes the proportion of light curve values that are less than the median. It is a simple measure of asymmetry or skewness in the distribution of values. When apply_weights=True, the comparison is made to the weighted median, and the result is a weighted fraction.

Parameters:
  • time (array-like) – Time stamps of the light curve. Not used in the calculation but retained for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, uses inverse-variance weights to compute the median and resulting fraction. If False, performs an unweighted comparison to the simple median.

Returns:

Fraction of values less than the (weighted) median. Returns a weighted sum of points below the median if apply_weights=True.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.cusum(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Cumulative sum (CUSUM) variability index.

This statistic quantifies the overall deviation from stationarity by computing the normalized cumulative sum of residuals from the median. The final value is the range between the maximum and minimum of the CUSUM series. It captures gradual trends, systematic drifts, or long-term changes in the light curve.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but retained for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, uses inverse-variance weighting to compute a weighted standard deviation. If False, uses the unweighted standard deviation.

Returns:

The maximum cumulative deviation from the median, normalized by light curve length and scatter. Returns NaN if the input is empty and 0.0 if the scatter is zero.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

  • Sensitive to slow drifts or systematic trends in the light curve.

MicroLIA.features.first_loc_max(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Normalized location of the first occurrence of the maximum value.

This feature identifies the first (or weighted) index at which the light curve reaches its maximum value and returns its position normalized by the total number of points. It provides a simple temporal indicator of where brightening events occur in the light curve.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but retained for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, the product of mag * weight is used to determine the maximum value, where weight is the inverse-variance from magerr. If False, the raw maximum is used.

Returns:

Index of the first occurrence of the (weighted) maximum, normalized by array size. Returns NaN if the input is empty.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.first_loc_min(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Normalized location of the first occurrence of the minimum value.

This feature identifies the first (or weighted) index at which the light curve reaches its minimum value and returns its position normalized by the total number of points. It provides a simple temporal indicator of where dimming events occur in the light curve.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but retained for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, the product of mag * weight is used to determine the minimum value, where weight is the inverse-variance from magerr. If False, the raw minimum is used.

Returns:

Index of the first occurrence of the (weighted) minimum, normalized by array size. Returns NaN if the input is empty.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.FluxPercentileRatioMid20(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Flux percentile ratio for the middle 20% of the light curve.

This metric computes the ratio of the flux range between the 40th and 60th percentiles to the full flux range (2nd to 98th percentiles). It captures the concentration of values near the median and helps distinguish compact versus broad distributions.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, uses inverse-variance weighting when computing percentiles.

Returns:

Ratio of the 40–60th percentile range to the 2–98th percentile range.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, and is designed for flux space.

  • Higher values indicate that more of the light curve is concentrated near the median.

MicroLIA.features.FluxPercentileRatioMid35(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Flux percentile ratio for the middle 35% of the light curve.

Computes the ratio of the 32.5–67.5th percentile flux range to the total flux range (2nd to 98th percentiles). This measures how tightly flux values cluster around the center of the distribution.

Parameters:
  • time (array-like) – Time values. Not used in the calculation.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Associated 1σ uncertainties.

  • apply_weights (bool, optional (default=True)) – If True, uses inverse-variance weighting for percentile calculations.

Returns:

Ratio of the 32.5–67.5 percentile range to the 2–98 percentile range.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, and is designed for flux space.

  • Useful for identifying symmetric, compact light curve profiles.

MicroLIA.features.FluxPercentileRatioMid50(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Flux percentile ratio for the middle 50% of the light curve.

Computes the ratio of the interquartile range (25th to 75th percentile) to the total flux range (2nd to 98th percentiles), measuring the spread of the central portion of the distribution.

Parameters:
  • time (array-like) – Time values. Not used in the calculation.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Associated 1σ uncertainties.

  • apply_weights (bool, optional (default=True)) – If True, uses inverse-variance weighting for percentile calculations.

Returns:

Ratio of the 25–75 percentile range to the 2–98 percentile range.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, and is designed for flux space.

  • Equivalent to the interquartile flux ratio normalized to the full flux spread.

MicroLIA.features.FluxPercentileRatioMid65(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Flux percentile ratio for the middle 65% of the light curve.

Calculates the ratio between the 17.5–82.5th percentile flux range and the total flux range (2nd to 98th percentiles). Captures more of the light curve’s distribution than narrower windows.

Parameters:
  • time (array-like) – Time values. Not used in the calculation.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Associated 1σ uncertainties.

  • apply_weights (bool, optional (default=True)) – If True, uses inverse-variance weighting for percentile calculations.

Returns:

Ratio of the 17.5–82.5 percentile range to the 2–98 percentile range.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, and is designed for flux space.

  • Useful for characterizing moderately broad light curve distributions.

MicroLIA.features.FluxPercentileRatioMid80(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Flux percentile ratio for the middle 80% of the light curve.

Calculates the ratio between the 10–90th percentile flux range and the total flux range (2nd to 98th percentiles). Captures the majority of the distribution while being robust to outliers.

Parameters:
  • time (array-like) – Time values. Not used in the calculation.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Associated 1σ uncertainties.

  • apply_weights (bool, optional (default=True)) – If True, uses inverse-variance weighting for percentile calculations.

Returns:

Ratio of the 10–90 percentile range to the 2–98 percentile range.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, and is designed for flux space.

  • Captures broad variability without being fully dominated by outliers.

MicroLIA.features.Gskew(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Robust skewness estimator using extreme quantiles (G-skew).

This statistic measures the asymmetry of the light curve distribution by comparing the medians of the lower and upper 3% tails to the global median. It is more robust to outliers and non-Gaussian noise than classical skewness metrics.

Parameters:
  • time (array-like) – Time values for the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Associated 1σ uncertainties for each value in mag.

  • apply_weights (bool, optional (default=True)) – If True, uses inverse-variance weighting when computing medians and quantiles. If False, computes the unweighted G-skew.

Returns:

G-skew value, defined as: (median of bottom 3%) + (median of top 3%) - 2 × global median.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

  • More robust than classical skewness for non-symmetric or noisy light curves.

MicroLIA.features.half_mag_amplitude_ratio(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Ratio of variability amplitude above vs. below the median.

This statistic compares the root-mean-square (RMS) scatter of light curve points that are greater than the median to those that are lower, by computing:

sqrt( Σ[(Δm)²]_greater / Σ[(Δm)²]_lower )

where Δm is the deviation from the median. This provides a compact measure of flux asymmetry about the median.

Parameters:
  • time (array-like) – Time values for the light curve. Not used in the calculation but retained for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, uses inverse-variance weighting for the RMS computations.

Returns:

Ratio of RMS scatter in the fainter half to that in the brighter half, relative to the median. Returns NaN if either side has zero variance or no data.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.index_mass_quantile(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True, r: float = 0.5) float[source]

Index at which a given fraction of the absolute cumulative flux is reached.

This metric computes the index location (normalized to [0,1]) at which a specified fraction r of the total absolute flux (or amplitude) is accumulated in the sorted light curve. It reflects how quickly the “mass” of the light curve builds up and characterizes burstiness or concentration.

Parameters:
  • time (array-like) – Time stamps of the light curve. Not used directly in the calculation.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, uses inverse-variance weighting (1 / magerr²) when computing cumulative mass.

  • r (float, optional (default=0.5)) – The cumulative mass quantile to evaluate (must be in (0, 1)).

Returns:

The normalized index location at which the cumulative absolute “mass” exceeds the specified fraction r. Returns NaN if input is empty.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

  • Values closer to 0 imply early accumulation of flux; closer to 1 indicates late accumulation.

MicroLIA.features.integrate(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Numerical integration of the light curve using the trapezoidal rule.

This function computes the integral of the magnitude time series using the trapezoidal rule. The integration is performed over the time array with respect to the mag values. Magnitude errors (magerr) are ignored, as they do not affect the integration of the signal itself.

Parameters:
  • time (array-like) – Time values corresponding to each magnitude measurement.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Photometric uncertainties associated with mag. Ignored in this function.

  • apply_weights (bool, optional (default=True)) – Currently unused. Included for API compatibility only.

Returns:

The integrated magnitude over time, computed via the trapezoidal rule.

Return type:

float

Notes

  • This is a purely geometric integration; magerr is not used.

  • Works for unevenly sampled data.

MicroLIA.features.kurtosis(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True, fisher: bool = True) float[source]

Weighted or unweighted kurtosis of the light curve.

This statistic measures the “tailedness” of the light curve distribution. By default, the Fisher definition is used, where a normal distribution has kurtosis = 0. The function supports both weighted (inverse-variance) and unweighted computation.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties for each mag value.

  • apply_weights (bool, optional (default=True)) – If True, computes kurtosis using inverse-variance weights (1 / magerr²). If False, computes standard unweighted kurtosis via scipy.stats.kurtosis().

  • fisher (bool, optional (default=True)) – If True, returns excess kurtosis (i.e., subtracts 3 so that Gaussian = 0). If False, returns raw kurtosis (Gaussian = 3).

Returns:

Kurtosis of the light curve distribution. Returns NaN if the input length is < 4 or if the weighted variance is zero.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

  • High positive kurtosis indicates heavy tails (outliers); negative kurtosis indicates a flat-topped distribution.

MicroLIA.features.large_standard_deviation(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True, r: float = 0.3) float[source]

Binary indicator for large standard deviation relative to dynamic range.

This metric returns 1 if the standard deviation of the light curve exceeds the input fraction r of its total dynamic range (max - min), and 0 otherwise. It is intended as a coarse flag for strong variability.

Parameters:
  • time (array-like) – Time values for the light curve. Not used in the calculation but retained for API consistency.

  • mag (array-like) – Light curve values. Can be magnitudes, fluxes, or normalized fluxes.

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, computes a weighted standard deviation using inverse-variance weights.

  • r (float, optional (default=0.3)) – Threshold ratio. Returns 1 if std > r × (max - min); otherwise 0.

Returns:

1 if the standard deviation exceeds r × (max - min), otherwise 0.

Return type:

int

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.LinearTrend(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Slope of the best-fit linear trend in the light curve.

This feature quantifies the overall linear trend in the light curve by fitting a line to mag as a function of time. The result is the slope of the fit, which indicates whether the light curve is systematically brightening or dimming over time.

Parameters:
  • time (array-like) – Time values of the light curve.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties for each mag value.

  • apply_weights (bool, optional (default=True)) – If True, fits the line using weighted least squares (weights = 1 / magerr²). If False, uses an unweighted ordinary least squares fit.

Returns:

Slope of the best-fit line. A negative value indicates a brightening trend (in magnitudes), while a positive value indicates fading. Returns NaN if input is too short or the time variance is zero.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.longest_strike_above(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Longest consecutive run of points significantly above the median.

This metric computes the longest sequence of consecutive light curve points that are above the (weighted or unweighted) median. If apply_weights=True, a point is considered “above” only if it exceeds the median by more than its associated 1σ uncertainty.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties for each mag value.

  • apply_weights (bool, optional (default=True)) – If True, uses mag > (median + magerr) to determine significance. If False, uses a simple comparison to the median.

Returns:

The longest sequence of consecutive “above-median” points, normalized by the total number of points. Returns NaN if input is empty.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.longest_strike_below(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Longest consecutive run of points significantly below the median.

This metric computes the longest sequence of consecutive light curve points that are below the (weighted or unweighted) median. If apply_weights=True, a point is considered “below” only if it is less than the median by more than its associated 1σ uncertainty.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties for each mag value.

  • apply_weights (bool, optional (default=True)) – If True, uses mag < (median - magerr) to determine significance. If False, uses a simple comparison to the median.

Returns:

The longest sequence of consecutive “below-median” points, normalized by the total number of points. Returns NaN if input is empty.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.MaxSlope(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Maximum or weighted average absolute slope between consecutive light curve points.

This statistic computes the maximum (or weighted average) of the absolute slope between consecutive time-adjacent measurements. It is designed to detect rapid changes in the light curve and is sensitive to flares, eclipses, or steep rises/falls.

Parameters:
  • time (array-like) – Time values of the light curve. Must be in a consistent time unit (e.g., days).

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, returns the weighted average of absolute slopes using inverse-variance weights. If False, returns the maximum absolute slope.

Returns:

The maximum (or weighted average) absolute slope in units of mag / time. Returns NaN if the light curve has fewer than two points or invalid time steps.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

  • If any dt is zero or non-finite, it is automatically excluded from the calculation. Therefore time must be strictly increasing and free of duplicate values to avoid division by zero.

MicroLIA.features.mean_abs_change(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Mean or weighted mean of absolute changes between consecutive light curve points.

This statistic computes the mean of the absolute value of successive differences in the light curve values. It quantifies the typical fluctuation magnitude, regardless of direction, and is useful for measuring overall variability.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, computes a weighted mean using inverse-sum error weights. If False, computes an unweighted mean of absolute changes.

Returns:

The mean (or weighted mean) of absolute changes in the light curve. Returns NaN if fewer than two data points are present.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

  • Sensitive to noise; a noisy light curve may show large average absolute changes.

MicroLIA.features.mean_change(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Mean or weighted mean of signed changes between consecutive light curve points.

This statistic computes the average of the signed differences between adjacent light curve measurements. It reflects any long-term slope or drift in brightness and can help detect slow trends.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, computes a weighted mean using inverse-variance weights from adjacent errors. If False, computes an unweighted mean.

Returns:

The mean (or weighted mean) of signed changes in the light curve. Returns NaN if fewer than two data points are present.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

  • Ideal for trend detection in smoothed or denoised light curves.

MicroLIA.features.meanMag(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Mean or weighted mean of the light curve values.

This statistic computes the average brightness of the light curve, either as a simple arithmetic mean or as an inverse-variance weighted mean, depending on whether apply_weights is enabled. It provides a measure of the central tendency of the light curve, useful for normalization or baseline estimation.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, computes a weighted mean using inverse-variance weights. If False, computes a simple unweighted mean.

Returns:

The mean (or weighted mean) of the light curve values. Returns NaN if the array is empty.

Return type:

float

Notes

  • MAY NOT BE APPROPRIATE FOR MACHINE LEARNING CLASSIFICATION

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.mean_n_abs_max(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True, number_of_maxima: int = 10) float[source]

Mean or weighted mean of the top-N largest absolute light curve values.

This statistic computes the mean of the N largest absolute values in the light curve, optionally applying inverse-variance weighting. It is useful for capturing the contribution of extreme values (e.g., flares, outliers, strong variability) in magnitude or flux measurements.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, uses inverse-variance weighting. Otherwise, uses unweighted mean.

  • number_of_maxima (int, optional (default=10)) – Number of largest absolute values to include in the average.

Returns:

Mean (or weighted mean) of the top-N absolute values. Returns NaN if number_of_maxima is not in [1, len(mag)] or if mag is empty.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

  • A small N emphasizes only the most extreme events, while a large N includes broader variability.

MicroLIA.features.mean_second_derivative(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Mean or weighted mean of the discrete second derivative in a light curve.

This statistic estimates the average curvature of the light curve by computing the second derivative at each internal point using finite differences. It is sensitive to acceleration in brightness changes and can help identify sudden shifts in slope, such as flares or eclipses.

Parameters:
  • time (array-like) – Time values of the light curve. Must be in a consistent time unit (e.g., days).

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, computes a weighted average using inverse-variance weights from the three points contributing to each second-derivative estimate.

Returns:

The (weighted) mean of the discrete second derivative estimates. Returns NaN if fewer than three valid points exist or all weights are zero.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; each estimate uses three points: (i-1, i, i+1), assuming irregular sampling.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.medianAbsDev(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Median Absolute Deviation (MAD) of the light curve.

This statistic measures the median of the absolute deviations from the median value of the light curve. It provides a robust estimate of variability that is less sensitive to outliers than the standard deviation.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, computes the weighted median and weighted MAD using inverse-variance weights. If False, uses standard unweighted medians.

Returns:

Median absolute deviation of the light curve. Returns NaN if input is empty or invalid.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.median_buffer_range(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Fraction of light curve points within ±10% of the semi-amplitude around the central value.

This metric quantifies the concentration of measurements near the central brightness level by computing the fraction of points that lie within a narrow buffer region centered on the mean or median magnitude. The buffer has a width of 20% of the full amplitude.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, uses the inverse-variance weighted mean as the center value. If False, uses the unweighted median.

Returns:

Fraction of points within ±10% of the semi-amplitude around the center. Returns NaN if the amplitude is undefined or the input is empty.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.median_distance(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Median Euclidean distance between consecutive light curve points in time-magnitude space.

This statistic measures the typical spacing between adjacent measurements in the (time, magnitude) plane. It captures the smoothness and sampling density of the light curve trajectory.

Parameters:
  • time (array-like) – Time values of the light curve. Must be in a consistent time unit (e.g., days).

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, normalizes the squared magnitude difference by the sum of the variances of adjacent points to account for measurement uncertainty.

Returns:

Median Euclidean distance between consecutive points. Units are in (mag² + time²)⁰·⁵ or (normalized) units depending on the input scale. Returns NaN if fewer than two points or if all distances are invalid.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.number_cwt_like_peaks(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Normalized count of CWT-like peaks in a light curve using simple prominence and width criteria.

This statistic approximates a continuous wavelet transform (CWT)-style peak count by using scipy.signal.find_peaks. It identifies medium-scale features in the light curve such as flares or bumps.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, weights the magnitude values by the inverse of the error prior to peak detection.

Returns:

Number of detected peaks divided by the total number of points. Returns 0.0 if the input array is empty.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

  • Intended as a lightweight proxy for more sophisticated wavelet-based peak detection.

MicroLIA.features.number_of_crossings(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Fraction of sign changes relative to the median of the light curve.

This statistic estimates how frequently the light curve crosses its median value, indicating the presence of variability. When apply_weights is True, only consider crossings with significant changes relative to photometric uncertainty.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, only count crossings where the absolute difference exceeds the measurement error.

Returns:

Fraction of crossings relative to the total number of data points. Returns 0.0 if fewer than two measurements are present.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves but best if time is evenly spaced; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.PairSlopeTrend(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True, n_last: int = 30) float[source]

Trend fraction based on slopes of recent consecutive magnitude pairs.

This statistic computes the fraction of upward trends (positive slopes) among the last n_last data points. When apply_weights is True, it returns the weighted fraction of positive slopes using inverse-variance weights.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, uses inverse-variance weights to compare rising vs. falling slopes.

  • n_last (int, optional (default=30)) – Number of most recent points to consider. If fewer are available, all are used.

Returns:

Fraction of increasing slopes (weighted or unweighted) among recent pairs. Returns NaN if fewer than two valid points or no valid weights.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.PercentAmplitude(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Maximum percent deviation from the (weighted) median magnitude.

This statistic computes the maximum absolute deviation from the median, normalized by the median itself: max(|m_i − median|) / median

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (e.g., magnitudes or fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, computes the weighted median using inverse-variance weights.

Returns:

Maximum fractional deviation from the median magnitude. Returns NaN if the input is empty, or inf if the median is zero.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.PercentDifferenceFluxPercentile(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Inter-percentile range divided by the median: (F95 − F5) / median.

This variability metric captures the amplitude of the central 90% of the light curve distribution relative to the median, providing a robust estimate of variability that is less sensitive to outliers.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, computes weighted percentiles using inverse-variance weights.

Returns:

(95th percentile − 5th percentile) / median. Returns NaN if input is empty, or inf if the median is zero.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.permutation_entropy(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True, tau: int = 1, dimension: int = 3) float[source]

Permutation entropy of the light curve.

This non-parametric measure captures the complexity or randomness in the ordering of values over time by evaluating the distribution of ordinal patterns in embedded vectors. A high value indicates a more disordered or complex signal, while a low value indicates more regular behavior. No option to account for errors included.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (flux or magnitude).

  • magerr (array-like) – Photometric uncertainties. Not used in the calculation but included for API consistency.

  • apply_weights (bool, optional (default=True)) – Not used in the calculation, but included for API consistency.

  • tau (int, optional (default=1)) – Time delay between elements in each embedded vector.

  • dimension (int, optional (default=3)) – Embedding dimension (length of ordinal patterns).

Returns:

Permutation entropy value (non-negative). Returns NaN if the light curve is too short to compute the statistic.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.prominence_peaks(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True, thres: float = 0.3, min_dist: int = 25, thres_abs: bool = False) float[source]

Detects prominent peaks in a light curve using slope changes and thresholding.

This function identifies local maxima by detecting sign changes in the first derivative of the light curve. Optionally, it weights the signal by inverse variance and applies a threshold on the (weighted) amplitude to reject low-significance peaks. When multiple peaks are too close (within min_dist), only the most prominent one is retained.

Parameters:
  • time (array-like) – Time values of the light curve. Not directly used in peak detection.

  • mag (1-D array-like) – Light curve values (e.g., normalized fluxes or fluxes).

  • magerr (1-D array-like) – Photometric uncertainties corresponding to each mag value.

  • apply_weights (bool, optional (default=True)) – If True, signal values are weighted by inverse variance when computing the amplitude used for thresholding.

  • thres (float, optional (default=0.3)) – Threshold level for accepting peaks. If thres_abs=False, this is relative: a value between 0 and 1 indicating how far between the min and max amplitude a peak must lie. If thres_abs=True, it is an absolute threshold in the same units as mag.

  • min_dist (int, optional (default=25)) – Minimum separation (in samples) required between two retained peaks. If multiple peaks fall within min_dist, only the most prominent (weighted) one is kept.

  • thres_abs (bool, optional (default=False)) – If True, thres is interpreted as an absolute threshold. If False, thres is relative.

Returns:

Fraction of light curve points identified as significant peaks.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, and is designed for flux space.

  • Code adapted from the peakutils Python package (MIT license).

MicroLIA.features.quantile_5(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

5th percentile value of the light curve. This is useful for describing the brightness distribution without being sensitive to outliers.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties. Not used in the calculation but included for API consistency.

  • apply_weights (bool, optional (default=True)) – Currently unused; included for API consistency.

Returns:

The 5th percentile value of the light curve.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

MicroLIA.features.quantile_25(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

25th percentile value of the light curve. This is useful for describing the brightness distribution without being sensitive to outliers.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties. Not used in the calculation but included for API consistency.

  • apply_weights (bool, optional (default=True)) – Currently unused; included for API consistency.

Returns:

The 25th percentile value of the light curve.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

MicroLIA.features.quantile_50(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Median (50th percentile) value of the light curve. This is useful for describing the brightness distribution without being sensitive to outliers.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties. Not used in the calculation but included for API consistency.

  • apply_weights (bool, optional (default=True)) – Currently unused; included for API consistency.

Returns:

The median value of the light curve.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

MicroLIA.features.quantile_75(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

75th percentile value of the light curve. This is useful for describing the brightness distribution without being sensitive to outliers.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties. Not used in the calculation but included for API consistency.

  • apply_weights (bool, optional (default=True)) – Currently unused; included for API consistency.

Returns:

The 75th percentile value of the light curve.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

MicroLIA.features.quantile_95(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

95th percentile value of the light curve. This is useful for describing the brightness distribution without being sensitive to outliers.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties. Not used in the calculation but included for API consistency.

  • apply_weights (bool, optional (default=True)) – Currently unused; included for API consistency.

Returns:

The 95th percentile value of the light curve.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

MicroLIA.features.ratio_recurring_points(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Ratio of recurring values in the light curve.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, default True) – If True, recurrence is counted using per-point tolerance from magerr.

Returns:

Fraction of unique values that appear more than once. Uses exact matching unless apply_weights=True, in which case values are matched within ±1σ.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.root_mean_squared(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Root-mean-square (RMS) deviation of the light curve magnitudes.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, default True) – If True, compute weighted RMS using inverse-variance weights.

Returns:

RMS deviation of the light curve values. Returns NaN if input is empty.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.sample_entropy(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Sample entropy of the light curve.

Measures the negative log-likelihood that sequences of m consecutive points that are similar (within r) remain similar when extended to m+1 points.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties. Not used in the calculation but included for API consistency.

  • apply_weights (bool, default True) – Currently unused; included for API consistency.

Returns:

Sample entropy value, or NaN if undefined.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.shannon_entropy(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True, eps: float = 1e-12) float[source]

Shannon–type entropy of a light curve.

This metric estimates the total information content of a light curve by computing entropy contributions based on the Gaussian and inverse-Gaussian cumulative distribution functions (CDFs) around each point, integrated over a symmetric interval defined by the photometric uncertainty.

Parameters:
  • time (array-like) – Time values of the light curve. Must be in a consistent time unit (e.g., days).

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties corresponding to mag.

  • apply_weights (bool, default=True) – If True, entropy contributions are weighted by inverse variance.

  • eps (float, default=1e-12) – Small constant added to probabilities inside log terms to ensure numerical stability.

Returns:

Total Shannon entropy of the light curve, combining Gaussian and inverse-Gaussian contributions. Returns NaN if the input is too small or unstable (e.g., zero mean).

Return type:

float

Notes

  • Suitable for unevenly sampled light curves.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.shapiro_wilk(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Shapiro–Wilk normality test statistic for light-curve data.

This function returns the Shapiro–Wilk statistic, which tests the null hypothesis that the input data are drawn from a normal distribution. Values close to 1 indicate consistency with normality. No error propagation is included, as the underlying scipy.stats.shapiro implementation does not support weighting or uncertainties.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties. Not used in the calculation but included for API consistency.

  • apply_weights (bool, default True) – Not used in the calculation but included for API consistency.

Returns:

The Shapiro–Wilk W statistic. Values closer to 1 suggest normality.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.skewness(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Weighted or unweighted skewness of the light-curve distribution.

Computes the third standardized moment (skewness) of the light-curve values, which quantifies the asymmetry of the distribution. If apply_weights=True, inverse-variance weights (1/σ²) are used to compute a weighted, unbiased estimator.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, apply inverse-variance weighting. Otherwise, use unweighted skewness.

Returns:

The skewness of the light-curve distribution. A value of 0 indicates a symmetric distribution. Returns NaN for insufficient data (fewer than 3 points).

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.std_over_mean(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Coefficient of variation (σ / μ) of the light-curve values.

Computes the ratio of the standard deviation to the mean of the light-curve values, which quantifies relative variability. If apply_weights=True, inverse-variance weights (1/σ²) are used for a weighted estimator of the mean and variance.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, apply inverse-variance weighting. Otherwise, use unweighted statistics.

Returns:

The coefficient of variation (standard deviation divided by mean). Returns NaN if input is empty, and Inf if the mean is zero.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.stetsonJ(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Stetson’s J variability index.

Measures the degree of correlated variability in a time series. For a light curve, it is sensitive to the persistence of bright or faint measurements over time. High values indicate consecutive measurements that deviate similarly from the mean.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – Ignored in this implementation, weights are always used.

Returns:

Stetson J index. Higher values indicate stronger correlated variability.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.stetsonK(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Stetson’s K variability index.

Measures the kurtosis-like behavior of the normalized residuals in a light curve. A Gaussian distribution yields K ≈ 0.798, while larger values indicate variability.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – Ignored in this implementation, weights are always used.

Returns:

Stetson K index. Higher values suggest stronger variability or outliers.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.stetsonL(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Stetson’s L variability index.

Combines the Stetson J and K indices to give an overall measure of variability, normalized such that L ≈ 1 for Gaussian noise. Designed to detect both correlated deviations and excess kurtosis in photometric data.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – Ignored in this implementation, weights are always used.

Returns:

Stetson L index. Values significantly above 1 suggest variability.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.sum_values(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Mean value of the light curve (weighted or unweighted).

Computes the average of the light-curve values, either as a simple arithmetic mean or as an inverse-variance weighted mean depending on apply_weights.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, apply inverse-variance weighting. Otherwise, use unweighted statistics.

Returns:

Weighted or unweighted mean of the input values. Returns NaN if input array is empty.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.symmetry_looking(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True, r: float = 0.5) float[source]

Symmetry indicator based on mean–median agreement.

Returns 1 if the absolute difference between the (weighted) mean and (weighted) median is less than r times the full range of the values; otherwise returns 0. This is a simple heuristic for assessing the symmetry of a light-curve distribution.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, apply inverse-variance weighting for mean and medium calculations. Otherwise, use unweighted statistics.

  • r (float, optional (default=0.5)) – Tolerance factor for deciding whether the distribution is symmetric. The threshold is defined as r × (max − min).

Returns:

1 if the distribution is considered symmetric under the specified criterion, 0 otherwise.

Return type:

int

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.time_reversal_asymmetry(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True, lag: int = 1) float[source]

Time-reversal asymmetry statistic with τ-lag.

Computes: ⟨(x_{t+2τ} − x_t) (x_{t+τ} − x_t)⟩

which measures nonlinear time asymmetry in the light curve. A value of zero suggests time-reversibility.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, apply inverse-variance weighting. Otherwise, use unweighted statistics.

  • lag (int, optional (default=1)) – The lag τ to use when evaluating the statistic.

Returns:

Time-reversal asymmetry statistic, or NaN if input too short.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.time_reversal_asymmetry_normalized(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = False, tau: int = 3) float[source]

Normalized time-reversal asymmetry (TREV) statistic.

Computes: trev(τ) = ⟨(x_{t+τ} − x_t)^3⟩ / ⟨(x_{t+τ} − x_t)^2⟩^{3/2}

which is a skewness-like measure of time irreversibility.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=False)) – If True, applies inverse-variance weights derived from error propagation. Otherwise, use unweighted statistics.

  • tau (int, optional (default=3)) – The lag τ to use when computing the difference terms.

Returns:

Normalized time-reversal asymmetry statistic. Returns NaN if too few data points.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.variance(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Weighted/unweighted variance of the light curve.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, default=True) – If True, apply inverse-variance weighting. Otherwise, use unweighted statistics.

Returns:

Estimated variance.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.variance_larger_than_standard_deviation(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Binary test: is variance greater than standard deviation?

Compares variance to its square root and returns 1 if true, 0 otherwise.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, apply inverse-variance weighting. Otherwise, use unweighted statistics.

Returns:

1 if var > sqrt(var), 0 if not, np.nan if invalid.

Return type:

int or float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.variation_coefficient(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Coefficient of variation (σ / μ).

Measures relative dispersion by dividing the standard deviation by the mean. Useful for comparing variability across magnitudes.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, apply inverse-variance weighting. Otherwise, use unweighted statistics.

Returns:

Variation coefficient. Returns NaN if mean is zero.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.vonNeumannRatio(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True) float[source]

Von Neumann’s η statistic: ratio of successive differences to variance.

A low value suggests smoothness; high value suggests jumps or outliers.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, apply inverse-variance weighting. Otherwise, use unweighted statistics.

Returns:

Von Neumann ratio. Returns np.nan if lightcurve has fewer than 2 points.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, but compatible with magnitudes or fluxes.

MicroLIA.features.windowed_peak_fraction(time: numpy.typing.ArrayLike, mag: numpy.typing.ArrayLike, magerr: numpy.typing.ArrayLike, apply_weights: bool = True, n: int = 7) float[source]

Normalized number of local peaks in the light curve.

A point is considered a peak if it is greater than n neighbors on each side. When apply_weights is True, a point is a peak only if it exceeds its neighbors by more than the combined error budget.

Parameters:
  • time (array-like) – Time values of the light curve. Not used in the calculation but included for API consistency.

  • mag (array-like) – Light curve values (magnitudes, fluxes, or normalized fluxes).

  • magerr (array-like) – Photometric uncertainties associated with each mag value.

  • apply_weights (bool, optional (default=True)) – If True, requires the peak to be significantly above neighbors based on the combined uncertainty.

  • n (int, optional (default=7)) – Number of neighbors to compare on each side of the point. The light curve must have at least 2n+1 points.

Returns:

Fraction of peaks relative to the total number of data points. Returns 0.0 if there are fewer than 2n+1 data points.

Return type:

float

Notes

  • Suitable for unevenly sampled light curves; time is not used.

  • Most effective with normalized flux, and is designed for flux space.

  • Works best for high-cadence light curves with visible local maxima.