get_index_range

jwst.wfs_combine.wfs_combine.get_index_range(offset, length)[source]

Get the initial and final indices for the given offset and array length.

  • For offset less than or equal to 0:
    • i = 0

    • f = length - abs(offset)

  • For offset greater than 0:
    • i = offset

    • f = length

Parameters:
offsetint

Offset

lengthint

Length of 1D array

Returns:
initial_1, final_1, initial_2, final_2int

Initial and final indices for the given offset