Variability & trend features
light_curve.Eta
Bases: light_curve.light_curve_ext._FeatureEvaluator
Von Neummann \(\eta\)
$$ \eta \equiv \frac1{(N - 1)\,\sigma_m^2} \sum_{i=0}^{N-2}(m_{i+1} - m_i)^2, $$ where \(N\) is the number of observations, \(\sigma_m = \sqrt{\sum_i (m_i - \langle m \rangle)^2 / (N-1)}\) is the magnitude standard deviation.
- Depends on: magnitude
- Minimum number of observations: 2
- Number of features: 1
Kim et al. 2014, DOI:10.1051/0004-6361/201323252
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
transform
|
str or bool or None
|
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' - 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 |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
names |
list of str
|
Feature names |
descriptions |
list of str
|
Feature descriptions |
Methods:
| Name | Description |
|---|---|
__call__ |
Extract features and return them as a numpy array Parameterst : numpy.ndarray of np.float32 or np.float64 dtype
Time moments
m : numpy.ndarray
Signal in magnitude or fluxes. Refer to the feature description to
decide which would work better in your case
sigma : numpy.ndarray, optional
Observation error, if None it is assumed to be unity
fill_value : float or None, optional
Value to fill invalid feature values, for example if count of
observations is not enough to find a proper value.
None causes exception for invalid features
sorted : bool or None, optional
Specifies if input array are sorted by time moments.
True is for certainly sorted, False is for unsorted.
If None is specified than sorting is checked and an exception is
raised for unsorted ndarray of np.float32 or np.float64 Extracted feature array |
many |
Parallel light curve feature extraction It is a parallel executed equivalent of
Parameterslcs : list of (t, m, sigma) or Arrow array
Either a list of light curves packed into three-tuples (all numpy.ndarray
of the same dtype), or an Arrow array/chunked array of type
List<Struct<...>> where the selected fields share the same float dtype
(float32 or float64). Arrow input is auto-detected via the
arrow_c_array / arrow_c_stream protocol and enables zero-copy
data access from pyarrow, polars, and other Arrow-compatible libraries.
arrow_fields : list of (str or int)
Required when lcs is an Arrow array. Field names or indices specifying
which struct fields to use as t, m, and optionally sigma. Must contain
2 elements [t, m] or 3 elements [t, m, sigma]. Each element may be a
field name (str) or a zero-based positional index (int); all elements
must be of the same type. Ignored for non-Arrow input.
fill_value : float or None, optional
Fill invalid values by this or raise an exception if None
sorted : bool or None, optional
Specifies if input array are sorted by time moments, see call
documentation for details
check : bool, optional
Check all input arrays for NaNs, |
default_transform = 'identity'
class-attribute
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
supported_transforms = ['arcsinh', 'clipped_lg', 'identity', 'lg', 'ln1p', 'sqrt']
class-attribute
Built-in mutable sequence.
If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.
light_curve.EtaE
Bases: light_curve.light_curve_ext._FeatureEvaluator
\(\eta^e\) — modification of Eta for unevenly time series
$$ \eta^e \equiv \frac{(t_{N-1} - t_0)^2}{(N - 1)^3} \frac{\sum_{i=0}^{N-2} \left(\frac{m_{i+1} - m_i}{t_{i+1} - t_i}\right)^2}{\sigma_m^2} $$ where \(N\) is the number of observations, \(\sigma_m = \sqrt{\sum_i (m_i - \langle m \rangle)^2 / (N-1)}\) is the magnitude standard deviation. Note that this definition is a bit different from both Kim et al. 2014 and feets
Note that this feature can have very high values and be highly cadence-dependent in the case of large range of time lags. In this case consider to use this feature with Bins.
- Depends on: time, magnitude
- Minimum number of observations: 2
- Number of features: 1
Kim et al. 2014, DOI:10.1051/0004-6361/201323252
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
transform
|
str or bool or None
|
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 'lg' - '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' - 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 |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
names |
list of str
|
Feature names |
descriptions |
list of str
|
Feature descriptions |
Methods:
| Name | Description |
|---|---|
__call__ |
Extract features and return them as a numpy array Parameterst : numpy.ndarray of np.float32 or np.float64 dtype
Time moments
m : numpy.ndarray
Signal in magnitude or fluxes. Refer to the feature description to
decide which would work better in your case
sigma : numpy.ndarray, optional
Observation error, if None it is assumed to be unity
fill_value : float or None, optional
Value to fill invalid feature values, for example if count of
observations is not enough to find a proper value.
None causes exception for invalid features
sorted : bool or None, optional
Specifies if input array are sorted by time moments.
True is for certainly sorted, False is for unsorted.
If None is specified than sorting is checked and an exception is
raised for unsorted ndarray of np.float32 or np.float64 Extracted feature array |
many |
Parallel light curve feature extraction It is a parallel executed equivalent of
Parameterslcs : list of (t, m, sigma) or Arrow array
Either a list of light curves packed into three-tuples (all numpy.ndarray
of the same dtype), or an Arrow array/chunked array of type
List<Struct<...>> where the selected fields share the same float dtype
(float32 or float64). Arrow input is auto-detected via the
arrow_c_array / arrow_c_stream protocol and enables zero-copy
data access from pyarrow, polars, and other Arrow-compatible libraries.
arrow_fields : list of (str or int)
Required when lcs is an Arrow array. Field names or indices specifying
which struct fields to use as t, m, and optionally sigma. Must contain
2 elements [t, m] or 3 elements [t, m, sigma]. Each element may be a
field name (str) or a zero-based positional index (int); all elements
must be of the same type. Ignored for non-Arrow input.
fill_value : float or None, optional
Fill invalid values by this or raise an exception if None
sorted : bool or None, optional
Specifies if input array are sorted by time moments, see call
documentation for details
check : bool, optional
Check all input arrays for NaNs, |
default_transform = 'lg'
class-attribute
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
supported_transforms = ['arcsinh', 'clipped_lg', 'identity', 'lg', 'ln1p', 'sqrt']
class-attribute
Built-in mutable sequence.
If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.
light_curve.LinearFit
Bases: light_curve.light_curve_ext._FeatureEvaluator
Slope, its error and reduced \(\chi^2\) of the light curve in the linear fit
Least squares fit of the linear stochastic model with Gaussian noise described by observation errors \(\{\delta_i\}\): $$ m_i = c + \mathrm{slope} t_i + \delta_i \varepsilon_i $$ where \(c\) is a constant, \(\{\varepsilon_i\}\) are standard distributed random variables.
Feature values are \(\mathrm{slope}\), \(\sigma_\mathrm{slope}\) and \(\frac{\sum{((m_i - c - \mathrm{slope} t_i) / \delta_i)^2}}{N - 2}\).
- Depends on: time, magnitude, magnitude error
- Minimum number of observations: 3
- Number of features: 3
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
transform
|
str or bool or None
|
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' - 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 |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
names |
list of str
|
Feature names |
descriptions |
list of str
|
Feature descriptions |
Methods:
| Name | Description |
|---|---|
__call__ |
Extract features and return them as a numpy array Parameterst : numpy.ndarray of np.float32 or np.float64 dtype
Time moments
m : numpy.ndarray
Signal in magnitude or fluxes. Refer to the feature description to
decide which would work better in your case
sigma : numpy.ndarray, optional
Observation error, if None it is assumed to be unity
fill_value : float or None, optional
Value to fill invalid feature values, for example if count of
observations is not enough to find a proper value.
None causes exception for invalid features
sorted : bool or None, optional
Specifies if input array are sorted by time moments.
True is for certainly sorted, False is for unsorted.
If None is specified than sorting is checked and an exception is
raised for unsorted ndarray of np.float32 or np.float64 Extracted feature array |
many |
Parallel light curve feature extraction It is a parallel executed equivalent of
Parameterslcs : list of (t, m, sigma) or Arrow array
Either a list of light curves packed into three-tuples (all numpy.ndarray
of the same dtype), or an Arrow array/chunked array of type
List<Struct<...>> where the selected fields share the same float dtype
(float32 or float64). Arrow input is auto-detected via the
arrow_c_array / arrow_c_stream protocol and enables zero-copy
data access from pyarrow, polars, and other Arrow-compatible libraries.
arrow_fields : list of (str or int)
Required when lcs is an Arrow array. Field names or indices specifying
which struct fields to use as t, m, and optionally sigma. Must contain
2 elements [t, m] or 3 elements [t, m, sigma]. Each element may be a
field name (str) or a zero-based positional index (int); all elements
must be of the same type. Ignored for non-Arrow input.
fill_value : float or None, optional
Fill invalid values by this or raise an exception if None
sorted : bool or None, optional
Specifies if input array are sorted by time moments, see call
documentation for details
check : bool, optional
Check all input arrays for NaNs, |
default_transform = 'identity'
class-attribute
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
supported_transforms = ['arcsinh', 'clipped_lg', 'identity', 'lg', 'ln1p', 'sqrt']
class-attribute
Built-in mutable sequence.
If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.
light_curve.LinearTrend
Bases: light_curve.light_curve_ext._FeatureEvaluator
The slope, its error and noise level of the light curve in the linear fit
Least squares fit of the linear stochastic model with constant Gaussian noise \(\Sigma\) assuming observation errors to be zero: $$ m_i = c + \mathrm{slope} t_i + \Sigma \varepsilon_i, $$ where \(c\) is a constant, \(\{\varepsilon_i\}\) are standard distributed random variables. \(\mathrm{slope}\), \(\sigma_\mathrm{slope}\) and \(\Sigma\) are returned.
- Depends on: time, magnitude
- Minimum number of observations: 3
- Number of features: 3
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
transform
|
str or bool or None
|
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' - 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 |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
names |
list of str
|
Feature names |
descriptions |
list of str
|
Feature descriptions |
Methods:
| Name | Description |
|---|---|
__call__ |
Extract features and return them as a numpy array Parameterst : numpy.ndarray of np.float32 or np.float64 dtype
Time moments
m : numpy.ndarray
Signal in magnitude or fluxes. Refer to the feature description to
decide which would work better in your case
sigma : numpy.ndarray, optional
Observation error, if None it is assumed to be unity
fill_value : float or None, optional
Value to fill invalid feature values, for example if count of
observations is not enough to find a proper value.
None causes exception for invalid features
sorted : bool or None, optional
Specifies if input array are sorted by time moments.
True is for certainly sorted, False is for unsorted.
If None is specified than sorting is checked and an exception is
raised for unsorted ndarray of np.float32 or np.float64 Extracted feature array |
many |
Parallel light curve feature extraction It is a parallel executed equivalent of
Parameterslcs : list of (t, m, sigma) or Arrow array
Either a list of light curves packed into three-tuples (all numpy.ndarray
of the same dtype), or an Arrow array/chunked array of type
List<Struct<...>> where the selected fields share the same float dtype
(float32 or float64). Arrow input is auto-detected via the
arrow_c_array / arrow_c_stream protocol and enables zero-copy
data access from pyarrow, polars, and other Arrow-compatible libraries.
arrow_fields : list of (str or int)
Required when lcs is an Arrow array. Field names or indices specifying
which struct fields to use as t, m, and optionally sigma. Must contain
2 elements [t, m] or 3 elements [t, m, sigma]. Each element may be a
field name (str) or a zero-based positional index (int); all elements
must be of the same type. Ignored for non-Arrow input.
fill_value : float or None, optional
Fill invalid values by this or raise an exception if None
sorted : bool or None, optional
Specifies if input array are sorted by time moments, see call
documentation for details
check : bool, optional
Check all input arrays for NaNs, |
default_transform = 'identity'
class-attribute
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
supported_transforms = ['arcsinh', 'clipped_lg', 'identity', 'lg', 'ln1p', 'sqrt']
class-attribute
Built-in mutable sequence.
If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.
light_curve.MaximumSlope
Bases: light_curve.light_curve_ext._FeatureEvaluator
Maximum slope between two sub-sequential observations
Note that this feature can have high values and be cadence-dependent in the case of large range of time lags. In this case consider to use this feature with Bins.
- Depends on: time, magnitude
- Minimum number of observations: 2
- Number of features: 1
D’Isanto et al. 2016 DOI:10.1093/mnras/stw157
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
transform
|
str or bool or None
|
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 'clipped_lg' - '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' - 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 |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
names |
list of str
|
Feature names |
descriptions |
list of str
|
Feature descriptions |
Methods:
| Name | Description |
|---|---|
__call__ |
Extract features and return them as a numpy array Parameterst : numpy.ndarray of np.float32 or np.float64 dtype
Time moments
m : numpy.ndarray
Signal in magnitude or fluxes. Refer to the feature description to
decide which would work better in your case
sigma : numpy.ndarray, optional
Observation error, if None it is assumed to be unity
fill_value : float or None, optional
Value to fill invalid feature values, for example if count of
observations is not enough to find a proper value.
None causes exception for invalid features
sorted : bool or None, optional
Specifies if input array are sorted by time moments.
True is for certainly sorted, False is for unsorted.
If None is specified than sorting is checked and an exception is
raised for unsorted ndarray of np.float32 or np.float64 Extracted feature array |
many |
Parallel light curve feature extraction It is a parallel executed equivalent of
Parameterslcs : list of (t, m, sigma) or Arrow array
Either a list of light curves packed into three-tuples (all numpy.ndarray
of the same dtype), or an Arrow array/chunked array of type
List<Struct<...>> where the selected fields share the same float dtype
(float32 or float64). Arrow input is auto-detected via the
arrow_c_array / arrow_c_stream protocol and enables zero-copy
data access from pyarrow, polars, and other Arrow-compatible libraries.
arrow_fields : list of (str or int)
Required when lcs is an Arrow array. Field names or indices specifying
which struct fields to use as t, m, and optionally sigma. Must contain
2 elements [t, m] or 3 elements [t, m, sigma]. Each element may be a
field name (str) or a zero-based positional index (int); all elements
must be of the same type. Ignored for non-Arrow input.
fill_value : float or None, optional
Fill invalid values by this or raise an exception if None
sorted : bool or None, optional
Specifies if input array are sorted by time moments, see call
documentation for details
check : bool, optional
Check all input arrays for NaNs, |
default_transform = 'clipped_lg'
class-attribute
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
supported_transforms = ['arcsinh', 'clipped_lg', 'identity', 'lg', 'ln1p', 'sqrt']
class-attribute
Built-in mutable sequence.
If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.