Source code for feets.extractors.ext_excess_variance

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2017-2024, Cabral, Juan
# Copyright (c) 2025, QuatroPe; Clariá, Felipe
# License: MIT
# Full Text:
#     https://github.com/quatrope/feets/blob/master/LICENSE


# =============================================================================
# DOC
# =============================================================================

"""Excess variance extractor."""


# =============================================================================
# IMPORTS
# =============================================================================

from light_curve import ExcessVariance as _ExcessVariance

from .light_curve_extractor import LightCurveExtractor
from ..libs import doctools


# =============================================================================
# EXTRACTOR CLASS
# =============================================================================


[docs] class ExcessVariance(LightCurveExtractor): r"""Excess variance extractor. **ExcessVariance** Measure of the variability amplitude .. math:: \frac{\sigma_m^2 - \langle \delta^2 \rangle}{\langle m \rangle^2}, Note that this definition differs from [sanchez2017infrared]_. Parameters ---------- transform : str or bool or None, optional Transformer to apply to the feature values. If str, must be one of: - 'default' - use default transformer for the feature, it same as giving True. The default for this feature is 'identity' - 'arcsinh' - Hyperbolic arcsine feature transformer - 'clipped_lg' - Decimal logarithm of a value clipped to a minimum value - 'identity' - Identity feature transformer - 'lg' - Decimal logarithm feature transformer - 'ln1p' - :math:`ln(1+x)` feature transformer - 'sqrt' - Square root feature transformer If bool, must be True to use default transformer or False to disable. If None, no transformation is applied. References ---------- .. [sanchez2017infrared] Sánchez, P., Lira, P., Cartier, R., Pérez, V., Miranda, N., Yovaniniz, C., ... & Marchesi, S. (2017). Near-infrared variability of obscured and unobscured X-ray-selected AGNs in the COSMOS field. The Astrophysical Journal, 849(2), 110. """ features = ["ExcessVariance"] def __init__(self, transform=None): self.transform = transform self._extract = _ExcessVariance(**self.params)
[docs] @doctools.doc_inherit(LightCurveExtractor.extract) def extract(self, magnitude, error, time=None): """ Parameters ---------- magnitude : array-like error : array-like time : array-like, optional """ [excess_variance] = self._extract(time, magnitude, error) return {"ExcessVariance": excess_variance}