slice_info

jwst.residual_fringe.utils.slice_info(slice_map, channel)[source]

Identify pixels by slice.

Parameters:
slice_mapndarray of int

2D image containing slice identification values by pixel. Slice ID values are integers with the value 100 * channel number + slice number. Pixels not included in a slice have value 0.

channelint

Channel number.

Returns:
slices_in_channelndarray of int

1D array of slice IDs included in the channel.

xrange_channelndarray of int

1D array with two elements: minimum and maximum x indices for the channel.

slice_x_rangesndarray of int

N x 3 array for N slices, where the first column is the slice ID, second column is the minimum x index for the slice, and the third column is the maximum x index for the slice.

all_slice_masksndarray of int

N x nx x ny for N slices, matching the x and y shape of the input slice_map. Values are 1 for pixels included in the slice, 0 otherwise.