redback.transient.afterglow.Truncator

class redback.transient.afterglow.Truncator(x: ndarray, x_err: ndarray, y: ndarray, y_err: ndarray, time: ndarray, time_err: ndarray, truncate_method: str = 'prompt_time_error')[source]

Bases: object

__init__(x: ndarray, x_err: ndarray, y: ndarray, y_err: ndarray, time: ndarray, time_err: ndarray, truncate_method: str = 'prompt_time_error') None[source]

Truncation class for the truncation behaviour in Afterglow. This class can be subclassed and passed into Afterglow if user specific truncation is desired.

Parameters:
  • x (np.ndarray) – X-axis (time) data.

  • x_err (np.ndarray) – X-axis (time) error data.

  • y (np.ndarray) – Y-axis (flux/flux density/ counts) data

  • y_err (np.ndarray) – Y-axis (flux/flux density/ counts) error data

  • time (np.ndarray) – Time to be used for default truncation method.

  • time_err (np.ndarray) – Time error to be used for default truncation method.

  • truncate_method (str, optional) – Must be from Truncator.TRUNCATE_METHODS.

__call__(**kwargs)

Call self as a function.

Methods

__init__(x, x_err, y, y_err, time, time_err)

Truncation class for the truncation behaviour in Afterglow.

truncate()

Executes the truncation and returns data as a tuple.

truncate_default()

Truncate using the default method.

truncate_left_of_max()

Truncate all data left of the maximum.

truncate_prompt_time_error()

Truncate using the prompt time error method.

Attributes

TRUNCATE_METHODS

truncate() tuple[source]

Executes the truncation and returns data as a tuple.

Returns:

The truncated data (x, x_err, y, y_err)

Return type:

tuple

truncate_default() tuple[source]

Truncate using the default method.

Returns:

The truncated data (x, x_err, y, y_err)

Return type:

tuple

truncate_left_of_max() tuple[source]

Truncate all data left of the maximum.

Returns:

The truncated data (x, x_err, y, y_err)

Return type:

tuple

truncate_prompt_time_error() tuple[source]

Truncate using the prompt time error method. Does not data points after 2.0 seconds.

Returns:

The truncated data (x, x_err, y, y_err)

Return type:

tuple