uvex_transients.models.core.lightcurve_metrics.first_true_index#

uvex_transients.models.core.lightcurve_metrics.first_true_index(condition: NDArray[bool]) → tuple[NDArray[int64], NDArray[bool]][source]#

Find the first sample of each row at which a condition holds.

Parameters:

condition (numpy.ndarray) – Boolean array, shape (M, K).

Returns:

  • index (numpy.ndarray) – Shape (M,): the first column of each row where condition is true, and 0 for a row where it never is.

  • found (numpy.ndarray) – Shape (M,): whether the row has such a column.