uvex_transients.models.core.lightcurve_metrics.resolve_time_grid#

uvex_transients.models.core.lightcurve_metrics.resolve_time_grid(t_rest: Quantity | None, t_min: Quantity | None, t_max: Quantity | None, n_time: int, spacing: str = 'log') → NDArray[float64][source]#

Turn the user’s time-grid arguments into rest-frame times in seconds.

Parameters:
  • t_rest (Quantity or None) – An explicit grid. If given, t_min, t_max and n_time are ignored.

  • t_min (Quantity or None) – Ends of the grid, used when t_rest is None. Logarithmic spacing (the default) puts the resolution where light curves change fastest, near rise and peak.

  • t_max (Quantity or None) – Ends of the grid, used when t_rest is None. Logarithmic spacing (the default) puts the resolution where light curves change fastest, near rise and peak.

  • n_time (int) – Number of points of the grid.

  • spacing ({"log", "linear"}, optional) – How the points are spaced between t_min and t_max.

Returns:

Times in seconds, shape (T,).

Return type:

numpy.ndarray

Raises:

ValueError – If neither an explicit grid nor both ends are given, if 0 < t_min < t_max fails, or if spacing is not "log" or "linear". A model has no notion of its own duration, so there is deliberately no default.