next_weight_transit

sofia_redux.scan.integration.integration_numba_functions.next_weight_transit(frame_weights, level, frame_valid, frame_flags, time_weighting_flags, start_frame=0, above=True)[source]

Returns the next frame weight transit above or below a given level.

Parameters:
frame_weightsnumpy.ndarray (float)

The relative frame weights of shape (n_frames,).

levelfloat

The level for at which to find the next frame above or below this threshold.

frame_validnumpy.ndarray (bool)

A boolean mask of shape (n_frames,) where any invalid (False) frame will be skipped.

frame_flagsnumpy.ndarray (int)

The frame flag array of shape (n_frames,). Any frame flagged with the TIME_WEIGHTING_FLAGS frame flag will be skipped.

time_weighting_flagsint

The integer flag marking the TIME_WEIGHTING_FLAGS value.

start_frameint, optional

The frame from which to begin looking for the next transit (inclusive).

abovebool, optional

If True, looks for the next weight transit above level. If False, looks for the next weight transit below level.

Returns:
frameint

The next weight transit. If not found, a value of -1 is returned.